VFS_BUSY(9)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’… VFS_BUSY(9) β€” the vfs_busy girlies' guide πŸ’…

okay so this is a page from the Kernel Developer's Manual and it's about vfs_busy, bestie. it's short, it's iconic, it's giving "small but mighty." let's get into it ✨


🌸 NAME 🌸

vfs_busy β€” marks a mount point as busy

πŸŽ€ SYNOPSIS πŸŽ€

#include <sys/param.h>
#include <sys/mount.h>

int
vfs_busy(struct mount *mp, int flags);

πŸ¦‹ DESCRIPTION πŸ¦‹

so the vfs_busy() function marks a mount point as busy by incrementing the reference count of a mount point. that's the whole glow-up, no cap πŸ’…

it also delays unmounting by sleeping on mp if the MNTK_UNMOUNT flag is set in mp->mnt_kern_flag and the MBF_NOWAIT flag is not set. like, it literally says "not right now, we're busy" and takes a little nap about it 😴

its arguments are:

  • mp β€” the mount point to busy. this is the main character, the one getting marked.
  • flags β€” flags controlling how vfs_busy() should act. the vibes controller, basically πŸŽ›οΈ
    • MBF_NOWAIT β€” do not sleep if MNTK_UNMOUNT is set. no naps allowed, periodt πŸ™…β€β™€οΈ
    • MBF_MNTLSTLOCK β€” drop the mountlist_mtx in the critical path. release the lock, it's not holding you back bestie πŸ”“

⭐ RETURN VALUES ⭐

A 0 value is returned on success. slay! πŸŽ‰

If the mount point is being unmounted and the MBF_NOWAIT flag is specified, ENOENT will be returned. not the win we wanted, but the win we deserved 😭

πŸ”₯ ERRORS πŸ”₯

  • [ENOENT] β€” the mount point is being unmounted (MNTK_UNMOUNT is set). it's literally on its way out, sorry babe πŸ’€

🌈 SEE ALSO 🌈

  • vfs_unbusy(9) β€” the counterpart, the "okay we're done here" energy. iykyk 🫢

πŸ‘‘ AUTHORS πŸ‘‘

This manual page was written by Chad David <davidc@acns.ab.ca>. thank you Chad, you ate that fr fr πŸ“


ngl this one's short, but everything in it matters β€” don't skip the flags, don't skip the errors, that's the whole plot 🧚

and that's the tea πŸŽ€ β€” much love from Debian, dated February 11, 2013. go busy a mount point responsibly, bestie πŸ’–

πŸ“¦ where this page comes from