VFS_SYNC(9)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

okay bestie, welcome to VFS_SYNC(9) from the Kernel Developer's Manual β€” the page that's literally about making sure your file system's unwritten data gets flushed. no cap, this is the group-chat explanation. πŸ’…

🌸 NAME

VFS_SYNC β€” flush unwritten data. that's it. that's the whole name. ✨

πŸ¦‹ SYNOPSIS

#include <sys/param.h>
#include <sys/mount.h>
#include <sys/vnode.h>

int
VFS_SYNC(struct mount *mp, int waitfor);

πŸ’– DESCRIPTION

The VFS_SYNC() macro writes out all unwritten data in the file system mounted as mp. it's giving β€œclean up your room before guests arrive” but for kernel I/O. πŸ”₯

The arguments it expects are:

  • mp β€” the file system. literally the mount we're talking about. 🫢
  • waitfor β€” whether the function should wait for I/O to complete. Possible values are:
    • MNT_WAIT β€” synchronously wait for I/O to complete.
    • MNT_NOWAIT β€” start all I/O, but do not wait for it.
    • MNT_LAZY β€” push data not written by file system syncer.

The VFS_SYNC() macro calls the vfs_sync method of the file system, which normally calls VOP_FSYNC(9) for all the vnodes in the file system. so it's not out here doing random stuff β€” it's delegating to the file system's own sync method, iykyk. πŸ‘‘

🌈 SEE ALSO

πŸŽ€ AUTHORS

This manual page was written by Doug Rabson. iconic behavior, honestly. πŸ’œ


Debian Β· May 23, 2009 Β· VFS_SYNC(9) β€” that's the source, version, and date sign-off, and we're done. periodt. πŸ’–

πŸ“¦ where this page comes from