| 4563 | } |
| 4564 | |
| 4565 | int |
| 4566 | kern_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. |
no test coverage detected