Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/fuse/fuse_vnops.c
| Show First 20 Lines • Show All 789 Lines • ▼ Show 20 Lines | |||||
| */ | */ | ||||
| static int | static int | ||||
| fuse_vnop_close(struct vop_close_args *ap) | fuse_vnop_close(struct vop_close_args *ap) | ||||
| { | { | ||||
| struct vnode *vp = ap->a_vp; | struct vnode *vp = ap->a_vp; | ||||
| struct mount *mp = vnode_mount(vp); | struct mount *mp = vnode_mount(vp); | ||||
| struct ucred *cred = ap->a_cred; | struct ucred *cred = ap->a_cred; | ||||
| int fflag = ap->a_fflag; | int fflag = ap->a_fflag; | ||||
| struct thread *td = ap->a_td; | struct thread *td = ap->a_td ? ap->a_td : curthread; | ||||
markj: I'd add a comment explaining why we do this and noting it might be some async kernel context… | |||||
| pid_t pid = td->td_proc->p_pid; | pid_t pid = td->td_proc->p_pid; | ||||
| struct fuse_vnode_data *fvdat = VTOFUD(vp); | struct fuse_vnode_data *fvdat = VTOFUD(vp); | ||||
| int err = 0; | int err = 0; | ||||
| if (fuse_isdeadfs(vp)) | if (fuse_isdeadfs(vp)) | ||||
| return 0; | return 0; | ||||
| if (vnode_isdir(vp)) | if (vnode_isdir(vp)) | ||||
| return 0; | return 0; | ||||
| Show All 26 Lines | if (access_e == 0) { | ||||
| * Ignore errors setting when setting atime. That | * Ignore errors setting when setting atime. That | ||||
| * should not cause close(2) to fail. | * should not cause close(2) to fail. | ||||
| */ | */ | ||||
| fuse_internal_setattr(vp, &vap, td, NULL); | fuse_internal_setattr(vp, &vap, td, NULL); | ||||
| } | } | ||||
| } | } | ||||
| /* TODO: close the file handle, if we're sure it's no longer used */ | /* TODO: close the file handle, if we're sure it's no longer used */ | ||||
| if ((fvdat->flag & FN_SIZECHANGE) != 0) { | if ((fvdat->flag & FN_SIZECHANGE) != 0) { | ||||
| fuse_vnode_savesize(vp, cred, td->td_proc->p_pid); | fuse_vnode_savesize(vp, cred, pid); | ||||
| } | } | ||||
| return err; | return err; | ||||
| } | } | ||||
| /* | /* | ||||
| struct vop_copy_file_range_args { | struct vop_copy_file_range_args { | ||||
| struct vop_generic_args a_gen; | struct vop_generic_args a_gen; | ||||
| struct vnode *a_invp; | struct vnode *a_invp; | ||||
| ▲ Show 20 Lines • Show All 2,434 Lines • Show Last 20 Lines | |||||
I'd add a comment explaining why we do this and noting it might be some async kernel context rather than a user thread.