---
name: "VFS_STATFS"
section: "9"
platform: "linux"
package: "freebsd-manpages"
version: "6.0-5"
release: "Debian 4.0 (Etch)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/VFS_STATFS"
---

# VFS\_STATFS(9)

return file system status

## 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*, *struct thread \*td*);

## DESCRIPTION

The **VFS\_STATFS**() macro returns various pieces of information about the file system, including recommended I/O sizes, free space, free inodes, etc.

The arguments it expects are:

- *mp*

  The file system.

- *sbp*

  A *statfs* structure, as defined by ⟨sys/mount.h⟩, into which information is placed about the file system.

- *td*

  The thread which is querying the file system.

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 most MFSNAMELEN bytes.

- *f\_mntfromname*

  The device name the file system was mounted from; a string of at most MNAMELEN bytes.

- *f\_mntonname*

  The name of the directory on which the file system is mounted; a string of at most MNAMELEN bytes.

## SEE ALSO

[VFS(9)](/VFS/9.md), [vnode(9)](/vnode/9.md)

## AUTHORS

This manual page was written by Doug Rabson.
