Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/fuse/fuse_vnops.c
Show First 20 Lines • Show All 714 Lines • ▼ Show 20 Lines | fuse_vnop_copy_file_range(struct vop_copy_file_range_args *ap) | ||||
struct fuse_dispatcher fdi; | struct fuse_dispatcher fdi; | ||||
struct fuse_filehandle *infufh, *outfufh; | struct fuse_filehandle *infufh, *outfufh; | ||||
struct fuse_copy_file_range_in *fcfri; | struct fuse_copy_file_range_in *fcfri; | ||||
struct ucred *incred = ap->a_incred; | struct ucred *incred = ap->a_incred; | ||||
struct ucred *outcred = ap->a_outcred; | struct ucred *outcred = ap->a_outcred; | ||||
struct fuse_write_out *fwo; | struct fuse_write_out *fwo; | ||||
struct thread *td; | struct thread *td; | ||||
struct uio io; | struct uio io; | ||||
off_t outfilesize; | |||||
pid_t pid; | pid_t pid; | ||||
int err; | int err; | ||||
if (mp != vnode_mount(outvp)) | if (mp != vnode_mount(outvp)) | ||||
goto fallback; | goto fallback; | ||||
if (incred->cr_uid != outcred->cr_uid) | if (incred->cr_uid != outcred->cr_uid) | ||||
goto fallback; | goto fallback; | ||||
Show All 38 Lines | fuse_vnop_copy_file_range(struct vop_copy_file_range_args *ap) | ||||
if (ap->a_fsizetd) { | if (ap->a_fsizetd) { | ||||
io.uio_offset = *ap->a_outoffp; | io.uio_offset = *ap->a_outoffp; | ||||
io.uio_resid = *ap->a_lenp; | io.uio_resid = *ap->a_lenp; | ||||
err = vn_rlimit_fsize(outvp, &io, ap->a_fsizetd); | err = vn_rlimit_fsize(outvp, &io, ap->a_fsizetd); | ||||
if (err) | if (err) | ||||
goto unlock; | goto unlock; | ||||
} | } | ||||
err = fuse_vnode_size(outvp, &outfilesize, outcred, curthread); | |||||
if (err) | |||||
goto unlock; | |||||
err = fuse_inval_buf_range(outvp, outfilesize, *ap->a_outoffp, | |||||
*ap->a_outoffp + *ap->a_lenp); | |||||
if (err) | |||||
goto unlock; | |||||
fdisp_init(&fdi, sizeof(*fcfri)); | fdisp_init(&fdi, sizeof(*fcfri)); | ||||
fdisp_make_vp(&fdi, FUSE_COPY_FILE_RANGE, invp, td, incred); | fdisp_make_vp(&fdi, FUSE_COPY_FILE_RANGE, invp, td, incred); | ||||
fcfri = fdi.indata; | fcfri = fdi.indata; | ||||
fcfri->fh_in = infufh->fh_id; | fcfri->fh_in = infufh->fh_id; | ||||
fcfri->off_in = *ap->a_inoffp; | fcfri->off_in = *ap->a_inoffp; | ||||
fcfri->nodeid_out = VTOI(outvp); | fcfri->nodeid_out = VTOI(outvp); | ||||
fcfri->fh_out = outfufh->fh_id; | fcfri->fh_out = outfufh->fh_id; | ||||
▲ Show 20 Lines • Show All 2,117 Lines • Show Last 20 Lines |