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

Function kern_fstatfs

freebsd/kern/vfs_syscalls.c:369–392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367}
368
369int
370kern_fstatfs(struct thread *td, int fd, struct statfs *buf)
371{
372 struct file *fp;
373 struct mount *mp;
374 struct vnode *vp;
375 int error;
376
377 AUDIT_ARG_FD(fd);
378 error = getvnode(td, fd, &cap_fstatfs_rights, &fp);
379 if (error != 0)
380 return (error);
381 vp = fp->f_vnode;
382 vn_lock(vp, LK_SHARED | LK_RETRY);
383#ifdef AUDIT
384 AUDIT_ARG_VNODE1(vp);
385#endif
386 mp = vp->v_mount;
387 if (mp != NULL)
388 vfs_ref(mp);
389 VOP_UNLOCK(vp);
390 fdrop(fp, td);
391 return (kern_do_statfs(td, mp, buf));
392}
393
394/*
395 * Get statistics on all filesystems.

Callers 3

sys_fstatfsFunction · 0.85
freebsd4_fstatfsFunction · 0.85
freebsd11_fstatfsFunction · 0.85

Calls 4

getvnodeFunction · 0.85
vn_lockFunction · 0.85
vfs_refFunction · 0.85
kern_do_statfsFunction · 0.85

Tested by

no test coverage detected