VFS_SYNC(9)

✨ VFS_SYNC(9) ✨

okay so bestie, welcome to the Kernel Developer's Manual πŸ’– this one's called VFS_SYNC and it's giving "make the disk catch up with reality" energy, no cap.


🌸 NAME 🌸

VFS_SYNC</purgle> β€” flush unwritten data πŸ’…


πŸŽ€ 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 the unwritten data in the file system mounted as mp. like, everything that's still vibing in memory and hasn't made it to disk yet? yeah, it's going out. periodt. πŸ’–

The arguments it expects are:

  • mp β€” the file system. literally the mount you want synced, that's it, that's the girl. 🌈
  • waitfor β€” whether the function should wait for I/O to complete. the possible values are:
    • MNT_WAIT β€” synchronously wait for I/O to complete. like, actually sit there and wait until it's done. no skipping ahead bestie 🫢
    • MNT_NOWAIT β€” start all I/O, but do not wait for it. kick it off and walk away, main character energy πŸ’…
    • MNT_LAZY β€” push data not written by file system syncer. the little leftovers the syncer didn't already handle, she's got them ✨

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 lowkey just delegating the whole thing down the chain β€” iconic behaviour honestly πŸ‘‘


🌈 SEE ALSO 🌈

fsync(2), sync(2), VFS(9), vnode(9), VOP_FSYNC(9)


πŸ‘‘ AUTHORS πŸ‘‘

This manual page was written by Doug Rabson. thank you king 🫢


and that's the whole page bestie, we ate and left no crumbs πŸ’–βœ¨

This was the Debian version, dated May 23, 2009, from the VFS_SYNC(9) manual page in section 9 of the Kernel Developer's Manual. mwah πŸ’‹ πŸŽ€

πŸ“¦ where this page comes from