VOP_FSYNC(9)
π VOP_FSYNC(9) π
okay so bestie, this is the Kernel Developer's Manual page for VOP_FSYNC(9), and itβs literally about flushing file system buffers for a file. itβs giving βmake sure your crash recovery is cuteβ energy, no cap. π
πΈ NAME πΈ
VOP_FDATASYNC, VOP_FSYNC β flush file system buffers for a file β¨
β¨ SYNOPSIS β¨
bestie, hereβs the exact shape of it:
#include <sys/param.h>
#include <sys/vnode.h>
int
VOP_FDATASYNC(struct vnode *vp, struct thread *td);
int
VOP_FSYNC(struct vnode *vp, int waitfor, struct thread *td);
π DESCRIPTION π
VOP_FSYNC() makes sure a file can be recovered to its current state following a crash. that typically means flushing the fileβs dirty buffers, its inode, and possibly other filesystem metadata to persistent media. VOP_FSYNC() is used to implement the sync(2) and fsync(2) system calls. slay.
Its arguments are:
vpβ the vnode of the file. iconic.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.
tdβ the calling thread. hi bestie π
VOP_FDATASYNC() is similar, but it does not require that all of the fileβs metadata be flushed. it only requires that the fileβs data be recoverable after a crash. that implies the data itself must be flushed to disk, as well as some metadata such as the fileβs size but not necessarily its attributes. VOP_FDATASYNC() should always wait for I/O to complete, as if called with MNT_WAIT. VOP_FDATASYNC() is used to implement fdatasync(2). periodt. π
π LOCKS π
the vnode should be exclusively locked on entry, and it stays locked on return. no sneaky unlocking, bestie β thatβs the rule. π
π RETURN VALUES π
Zero is returned if the call is successful; otherwise an appropriate error code is returned. thatβs it, thatβs the vibe check. β
π¨ ERRORS π¨
[ENOSPC]β The file system is full. π[EDQUOT]β Quota exceeded. π
π SEE ALSO π
vnode(9)β go read that one too, iykyk. π¦
π«Ά AUTHORS π«Ά
This manual page was written by Doug Rabson. shoutout, king. π
okay thatβs the whole page, bestie! this one is from Debian, dated March 22, 2019, and itβs the VOP_FSYNC(9) manual page. mwah πβ¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 1996 Doug Rabson
- Copyright (c) 2019 The FreeBSD Foundation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms