VCOUNT(9)

πŸ’… VCOUNT(9) πŸ’…

okay bestie, welcome to VCOUNT(9) from the Kernel Developer's Manual β€” yes it's a section 9 page, yes it's for kernel devs, yes you're gonna eat this up πŸ“


✨ NAME ✨

vcount, count_dev β€” get total number of references to a device πŸŽ€


🌸 SYNOPSIS 🌸

#include <sys/param.h>
#include <sys/time.h>
#include <sys/conf.h>
#include <sys/vnode.h>

int
vcount(struct vnode *vp);

int
count_dev(struct cdev *dev);

like, copy those includes exactly, they're not decorative bestie πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

So vcount() is the girl who counts how many references there are to one specific device. The whole reason she exists? Because multiple vnodes can reference the same device β€” and she's built to handle that reality, no cap. πŸ‘‘

count_dev() does the exact same thing as vcount(), but instead of taking a struct vnode pointer as its argument, it takes a struct cdev. Same energy, different entry point πŸ’…


πŸ’– RETURN VALUES πŸ’–

Both vcount() and count_dev() return the number of references to the device. That's it. That's the whole return value. Periodt. ✨


🌈 SEE ALSO 🌈

go read those too, iykyk 🫢


πŸ‘‘ AUTHORS πŸ‘‘

This manual page was written by Andrew Stevenson. icon behavior, honestly πŸŽ€


and that's the whole page bestie!! this one shipped from Debian, dated January 19, 2012 β€” so like, it's older than most of the internet but it still slays πŸ’€βœ¨ mwah, go count some device references πŸ¦‹πŸ’–

πŸ“¦ where this page comes from