| 324 | } |
| 325 | |
| 326 | int |
| 327 | kern_statfs(struct thread *td, const char *path, enum uio_seg pathseg, |
| 328 | struct statfs *buf) |
| 329 | { |
| 330 | struct mount *mp; |
| 331 | struct nameidata nd; |
| 332 | int error; |
| 333 | |
| 334 | NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1, |
| 335 | pathseg, path, td); |
| 336 | error = namei(&nd); |
| 337 | if (error != 0) |
| 338 | return (error); |
| 339 | mp = nd.ni_vp->v_mount; |
| 340 | vfs_ref(mp); |
| 341 | NDFREE_NOTHING(&nd); |
| 342 | vput(nd.ni_vp); |
| 343 | return (kern_do_statfs(td, mp, buf)); |
| 344 | } |
| 345 | |
| 346 | /* |
| 347 | * Get filesystem statistics. |
no test coverage detected