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

Function kern_do_statfs

freebsd/kern/vfs_syscalls.c:275–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273}
274
275static int
276kern_do_statfs(struct thread *td, struct mount *mp, struct statfs *buf)
277{
278 int error;
279
280 if (mp == NULL)
281 return (EBADF);
282 error = vfs_busy(mp, 0);
283 vfs_rel(mp);
284 if (error != 0)
285 return (error);
286#ifdef MAC
287 error = mac_mount_check_stat(td->td_ucred, mp);
288 if (error != 0)
289 goto out;
290#endif
291 error = VFS_STATFS(mp, buf);
292 if (error != 0)
293 goto out;
294 if (priv_check_cred_vfs_generation(td->td_ucred)) {
295 buf->f_fsid.val[0] = buf->f_fsid.val[1] = 0;
296 prison_enforce_statfs(td->td_ucred, mp, buf);
297 }
298out:
299 vfs_unbusy(mp);
300 return (error);
301}
302
303/*
304 * Get filesystem statistics.

Callers 2

kern_statfsFunction · 0.85
kern_fstatfsFunction · 0.85

Calls 6

vfs_busyFunction · 0.85
vfs_relFunction · 0.85
mac_mount_check_statFunction · 0.85
prison_enforce_statfsFunction · 0.85
vfs_unbusyFunction · 0.85

Tested by

no test coverage detected