MCPcopy Create free account
hub / github.com/F-Stack/f-stack / kern_fhstatfs

Function kern_fhstatfs

freebsd/kern/vfs_syscalls.c:4613–4643  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4611}
4612
4613int
4614kern_fhstatfs(struct thread *td, fhandle_t fh, struct statfs *buf)
4615{
4616 struct mount *mp;
4617 struct vnode *vp;
4618 int error;
4619
4620 error = priv_check(td, PRIV_VFS_FHSTATFS);
4621 if (error != 0)
4622 return (error);
4623 if ((mp = vfs_busyfs(&fh.fh_fsid)) == NULL)
4624 return (ESTALE);
4625 error = VFS_FHTOVP(mp, &fh.fh_fid, LK_EXCLUSIVE, &vp);
4626 if (error != 0) {
4627 vfs_unbusy(mp);
4628 return (error);
4629 }
4630 vput(vp);
4631 error = prison_canseemount(td->td_ucred, mp);
4632 if (error != 0)
4633 goto out;
4634#ifdef MAC
4635 error = mac_mount_check_stat(td->td_ucred, mp);
4636 if (error != 0)
4637 goto out;
4638#endif
4639 error = VFS_STATFS(mp, buf);
4640out:
4641 vfs_unbusy(mp);
4642 return (error);
4643}
4644
4645/*
4646 * Unlike madvise(2), we do not make a best effort to remember every

Callers 3

freebsd4_fhstatfsFunction · 0.85
freebsd11_fhstatfsFunction · 0.85
sys_fhstatfsFunction · 0.85

Calls 6

vfs_busyfsFunction · 0.85
vfs_unbusyFunction · 0.85
vputFunction · 0.85
prison_canseemountFunction · 0.85
mac_mount_check_statFunction · 0.85
priv_checkFunction · 0.70

Tested by

no test coverage detected