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

Function kern_fhstat

freebsd/kern/vfs_syscalls.c:4565–4584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4563}
4564
4565int
4566kern_fhstat(struct thread *td, struct fhandle fh, struct stat *sb)
4567{
4568 struct mount *mp;
4569 struct vnode *vp;
4570 int error;
4571
4572 error = priv_check(td, PRIV_VFS_FHSTAT);
4573 if (error != 0)
4574 return (error);
4575 if ((mp = vfs_busyfs(&fh.fh_fsid)) == NULL)
4576 return (ESTALE);
4577 error = VFS_FHTOVP(mp, &fh.fh_fid, LK_EXCLUSIVE, &vp);
4578 vfs_unbusy(mp);
4579 if (error != 0)
4580 return (error);
4581 error = VOP_STAT(vp, sb, td->td_ucred, NOCRED, td);
4582 vput(vp);
4583 return (error);
4584}
4585
4586/*
4587 * Implement fstatfs() for (NFS) file handles.

Callers 2

freebsd11_fhstatFunction · 0.85
sys_fhstatFunction · 0.85

Calls 4

vfs_busyfsFunction · 0.85
vfs_unbusyFunction · 0.85
vputFunction · 0.85
priv_checkFunction · 0.70

Tested by

no test coverage detected