VOP_INOTIFY(9)
π VOP_INOTIFY(9) β kernel dev manual, but make it cute
okay bestie, welcome to VOP_INOTIFY(9) from the Kernel Developer's Manual β¨ this is your vnode inotify interface, and yes it's as niche as it sounds, but we're gonna get through it together π«Ά
πΈ NAME πΈ
VOP_INOTIFY β vnode inotify interface. literally the whole vibe of this page, no cap π
β¨ SYNOPSIS β¨
#include <sys/param.h>
#include <sys/vnode.h>
int
VOP_INOTIFY(struct, vnode, *vp, struct, vnode, *dvp, struct,
componentname, *cnp, int, event, uint32_t, cookie);
int
VOP_INOTIFY_ADD_WATCH(struct, vnode, *vp, struct, inotify_softc, *sc,
uint32_t, mask, uint32_t, *wdp, struct, thread, *td);
like, copy these exactly, bestie, don't get creative with the parameter lists π
π¦ DESCRIPTION π¦
so the VOP_INOTIFY() operation is the one that goes and tells the inotify(2) subsystem that a file system event just happened on a vnode π it's giving "hey girl, something went down over here."
the dvp and cnp arguments are optional β they're only there so the operation can grab a file name for the event π if you leave them out, the inotify subsystem will fall back to the file name cache to find a name for the vnode, but heads up, that path is more expensive πΈ so if you can pass them, pass them, iykyk.
then there's VOP_INOTIFY_ADD_WATCH(), which is for internal use by the inotify subsystem to add a watch to a vnode π§ it's not really your main character, it's the sidekick doing the quiet work. respectfully.
π LOCKS π
lock rules, everyone's favorite part π so:
VOP_INOTIFY()does not assume any particular vnode lock state. free spirit. no lock dress code β¨VOP_INOTIFY_ADD_WATCH()should be called with the vnode locked π periodt.
bestie do NOT forget the lock on that second one, it is literally the one rule they wrote down for it π
π RETURN VALUES π
zero 0 is returned on success π (slay). otherwise, an error code is returned, and you get to go figure out what went wrong bestie, good luck π
π SEE ALSO π
go read those too, they're the lore π
and that's the whole page, bestie π from the Kernel Developer's Manual, this one's from Debian, dated May 27, 2025 β so it's fresh-ish, and yes the footer says it's from the VOP_INOTIFY(9) page itself. now go add some watches, but lock that vnode first, mwah πππ¦
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- π the page's license: BSD-2-Clause
- Copyright (c) 2025 Klara, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms