Changeset View
Changeset View
Standalone View
Standalone View
head/sys/fs/fuse/fuse_internal.c
Show First 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | if (bintime_cmp(&(VTOFUD(*vpp)->entry_cache_timeout), &now, >)){ | ||||
cache_purge(*vpp); | cache_purge(*vpp); | ||||
vput(*vpp); | vput(*vpp); | ||||
*vpp = NULL; | *vpp = NULL; | ||||
} | } | ||||
} | } | ||||
return 0; | return 0; | ||||
} | } | ||||
SDT_PROBE_DEFINE0(fusefs, , internal, access_vadmin); | |||||
/* Synchronously send a FUSE_ACCESS operation */ | /* Synchronously send a FUSE_ACCESS operation */ | ||||
int | int | ||||
fuse_internal_access(struct vnode *vp, | fuse_internal_access(struct vnode *vp, | ||||
accmode_t mode, | accmode_t mode, | ||||
struct thread *td, | struct thread *td, | ||||
struct ucred *cred) | struct ucred *cred) | ||||
{ | { | ||||
int err = 0; | int err = 0; | ||||
Show All 36 Lines | fuse_internal_access(struct vnode *vp, | ||||
if (dataflags & FSESS_DEFAULT_PERMISSIONS) { | if (dataflags & FSESS_DEFAULT_PERMISSIONS) { | ||||
struct vattr va; | struct vattr va; | ||||
fuse_internal_getattr(vp, &va, cred, td); | fuse_internal_getattr(vp, &va, cred, td); | ||||
return vaccess(vp->v_type, va.va_mode, va.va_uid, | return vaccess(vp->v_type, va.va_mode, va.va_uid, | ||||
va.va_gid, mode, cred, NULL); | va.va_gid, mode, cred, NULL); | ||||
} | } | ||||
if (mode & VADMIN) { | |||||
/* | |||||
* The FUSE protocol doesn't have an equivalent of VADMIN, so | |||||
* it's a bug if we ever reach this point with that bit set. | |||||
*/ | |||||
SDT_PROBE0(fusefs, , internal, access_vadmin); | |||||
} | |||||
if (!fsess_isimpl(mp, FUSE_ACCESS)) | if (!fsess_isimpl(mp, FUSE_ACCESS)) | ||||
return 0; | return 0; | ||||
if ((mode & (VWRITE | VAPPEND | VADMIN)) != 0) | if ((mode & (VWRITE | VAPPEND)) != 0) | ||||
mask |= W_OK; | mask |= W_OK; | ||||
if ((mode & VREAD) != 0) | if ((mode & VREAD) != 0) | ||||
mask |= R_OK; | mask |= R_OK; | ||||
if ((mode & VEXEC) != 0) | if ((mode & VEXEC) != 0) | ||||
mask |= X_OK; | mask |= X_OK; | ||||
fdisp_init(&fdi, sizeof(*fai)); | fdisp_init(&fdi, sizeof(*fai)); | ||||
fdisp_make_vp(&fdi, FUSE_ACCESS, vp, td, cred); | fdisp_make_vp(&fdi, FUSE_ACCESS, vp, td, cred); | ||||
▲ Show 20 Lines • Show All 1,024 Lines • Show Last 20 Lines |