Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/fuse/fuse_vnops.c
Show First 20 Lines • Show All 644 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
*/ | */ | ||||
static int | static int | ||||
fuse_vnop_copy_file_range(struct vop_copy_file_range_args *ap) | fuse_vnop_copy_file_range(struct vop_copy_file_range_args *ap) | ||||
{ | { | ||||
struct vnode *invp = ap->a_invp; | struct vnode *invp = ap->a_invp; | ||||
struct vnode *outvp = ap->a_outvp; | struct vnode *outvp = ap->a_outvp; | ||||
struct mount *mp = vnode_mount(invp); | struct mount *mp = vnode_mount(invp); | ||||
struct fuse_vnode_data *outfvdat = VTOFUD(outvp); | |||||
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; | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | fuse_vnop_copy_file_range(struct vop_copy_file_range_args *ap) | ||||
err = fdisp_wait_answ(&fdi); | err = fdisp_wait_answ(&fdi); | ||||
if (err == 0) { | if (err == 0) { | ||||
fwo = fdi.answ; | fwo = fdi.answ; | ||||
*ap->a_lenp = fwo->size; | *ap->a_lenp = fwo->size; | ||||
*ap->a_inoffp += fwo->size; | *ap->a_inoffp += fwo->size; | ||||
*ap->a_outoffp += fwo->size; | *ap->a_outoffp += fwo->size; | ||||
fuse_internal_clear_suid_on_write(outvp, outcred, td); | fuse_internal_clear_suid_on_write(outvp, outcred, td); | ||||
if (*ap->a_outoffp > outfvdat->cached_attrs.va_size) | |||||
fuse_vnode_setsize(outvp, *ap->a_outoffp, false); | |||||
} | } | ||||
fdisp_destroy(&fdi); | fdisp_destroy(&fdi); | ||||
unlock: | unlock: | ||||
if (invp != outvp) | if (invp != outvp) | ||||
VOP_UNLOCK(invp); | VOP_UNLOCK(invp); | ||||
VOP_UNLOCK(outvp); | VOP_UNLOCK(outvp); | ||||
▲ Show 20 Lines • Show All 1,987 Lines • Show Last 20 Lines |