VWAITFORIO(9)
π€ VWAITFORIO(9) π€
okay so real talk, bestie β this is a Kernel Developer's Manual page, section 9, and we're about to talk about vwaitforio. yes the name is a mouthful. no i will not be pronouncing it out loud. let's get into it π
πΈ NAME πΈ
vwaitforio β literally just chillin' until every single outstanding asynchronous write is done. that's the whole vibe. waiting. patiently. for writes. slay. β¨
π¦ SYNOPSIS π¦
#include <sys/types.h>
#include <sys/vnode.h>
int
vwaitforio(struct vnode *vp, int slpflag, char *wmesg,
uint64_t slptimeo);
yep, that's four arguments. don't skip any of them, okay? π
π DESCRIPTION π
so the vwaitforio() call sleeps until all the asynchronous writes tied to the vnode vp are finished. that's it, that's the gig. the way it works is that functions needing to be sure the writes they kicked off have actually completed call this. like "hey bestie, wake me up when you're done" energy. π«Ά
and where does it sleep? at priority PRIBIO + 1. very specific. iconic of it. π
the slpflag, wmesg, and slptimeo arguments are flags that get passed to tsleep_nsec(9) β so if you know that one, you already get it. iykyk. π«
β οΈ okay important: this function must be called at splbio(9). like, non-negotiable. no cap. π₯
also, and this is the part that lowkey matters: it may be important to make sure no other process submits asynchronous writes while a process is waiting for I/O on this vnode. because otherwise?? vwaitforio() might never return. ππ and then you're just stuck there, forever, in the void, in splbio, thinking about your choices. so, like, don't do that.
π RETURN VALUES π
vwaitforio()returns0on success β the good ending, we love her π- for the possible error returns, go check
tsleep(9), bestie, i don't make the rules πΈ
π§ SEE ALSO π§
okay bestie, that's the whole page π stay hydrated, keep your spls high, and never let another process sneak writes in while you're sleeping πβ¨
β written up in the Debian manual collection, dated July 19, 2019, page VWAITFORIO(9). mwah, bye ππ¦π
π¦ where this page comes from
- nixpkgs unstable: cvs-export
- Copyright (c) 2001 Constantine Sapuntzakis
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms