VFS_STATFS(9)
π VFS_STATFS(9) β it's giving kernel developer's manual β¨
okay so bestie, welcome to VFS_STATFS(9), section 9 of the Kernel Developer's Manual. this is the page where we spill the tea on how the kernel peeks at a file system and reports back everything it knows. no cap. π«Ά
πΈ NAME πΈ
VFS_STATFS β return file system status π
β¨ SYNOPSIS β¨
#include <sys/param.h>
#include <sys/mount.h>
#include <sys/vnode.h>
int
VFS_STATFS(struct mount *mp, struct statfs *sbp);
π DESCRIPTION π
The VFS_STATFS() macro returns various pieces of information about the file system, including recommended I/O sizes, free space, free inodes, etc. like it's literally the receipts of your filesystem, periodt. π
The arguments it expects are:
mpβ The file system. (the main character we're asking about π)sbpβ Astatfsstructure, as defined by<sys/mount.h>, into which information is placed about the file system. (this is where the answers get dropped off π)
The fields of struct statfs related to the file system are as follows:
f_typeβ Type of file system.f_flagsβ A copy of mount exported flags.f_bsizeβ Fragment size.f_iosizeβ Optimal transfer block size.f_blocksβ The total number of data blocks in the file system.f_bfreeβ The number of free blocks in the file system.f_bavailβ The number of free blocks available to non-superuser processes.f_filesβ The total number of file nodes in the file system.f_ffreeβ The number of free nodes available to non-superuser processes.f_syncwritesβ The number of synchronous writes since the file system was mounted.f_asyncwritesβ The number of asynchronous writes since the file system was mounted.f_syncreadsβ The number of synchronous reads since the file system was mounted.f_asyncreadsβ The number of asynchronous reads since the file system was mounted.f_namemaxβ The maximum file name length for this file system.f_ownerβ The user ID of the user that mounted the file system.f_fsidβ Unique file system ID.f_fstypenameβ The file system type name; a string of at mostMFSNAMELENbytes.f_mntfromnameβ The device name the file system was mounted from; a string of at mostMNAMELENbytes.f_mntonnameβ The name of the directory on which the file system is mounted; a string of at mostMNAMELENbytes.
ngl the way that struct is just β¨fullβ¨ of lore. every field is a little piece of the filesystem's autobiography fr fr. π¦
π SEE ALSO π
π AUTHORS π
This manual page was written by Doug Rabson. iconic behaviour honestly, we stan a manpage author π
okay bestie that's the whole vibe check β
this Debian edition dropped on May 23, 2009 and it still eats, no crumbs. go forth and statfs responsibly. mwah ππβ¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 1996 Doug Rabson
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms