BUF_TIMELOCK(9)

✨ BUF_TIMELOCK(9) ✨

okay bestie, welcome to the Kernel Developer's Manual πŸ’… this one's called BUF_TIMELOCK, and it lives in section 9 (kernel land, iykyk) β€” she locks a buffer, but make it timeout energy β°πŸ¦‹


🌸 NAME 🌸

BUF_TIMELOCK β€” locks a buffer πŸŽ€


🧚 SYNOPSIS 🧚

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/uio.h>
#include <sys/bio.h>
#include <sys/buf.h>

int
BUF_TIMELOCK(struct buf *bp, int locktype, char *wmesg, int catch,
    int timo);

like. look at her. five args, one int, zero chill πŸ’–


πŸ’œ DESCRIPTION πŸ’œ

So the way that BUF_TIMELOCK() works is: it locks the buffer you hand it, and it puts a cap on how long it's allowed to sleep β€” that cap is timo. It also OR's catch into the sleep's priority. and wmesg is the wmesg used in the sleep. no notes, that's just the vibe 🌈

Her arguments, one by one, no gatekeeping:

  • bp β€” the buffer to lock. this is the main character of the whole operation πŸ‘‘
  • locktype β€” flags that control the type of lock. for the details, go read lockmgr(9), she has the lore πŸ“–
  • wmesg β€” the wmesg used in any sleeps while acquiring the lock 😴
  • catch β€” priority that gets OR'd into the sleep's priority πŸ”€
  • timo β€” the timeout for any sleeps encountered during the lock. so if she's sleeping too long, that's the cutoff ⏳

πŸ”₯ RETURN VALUES πŸ”₯

A value of 0 is returned on success. slay. βœ…

For details on what the non-zero return values mean, see lockmgr(9) β€” she's got the receipts 🧾


πŸ‘€ SEE ALSO πŸ‘€

go read them, bestie, it's giving ✨well-rounded kernel dev✨


🫢 AUTHORS 🫢

This manual page was written by Chad David <davidc@acns.ab.ca>. ty for your service, king πŸ’


πŸ’– lowkey reminder: every flag, every argument, every default up there is doing real work β€” don't skip the locktype details, lockmgr(9) is right there.

Debian Β· July 9, 2001 Β· BUF_TIMELOCK(9) β€” ok that's the whole page, mwah, go lock some buffers responsibly πŸ’…πŸŽ€βœ¨

πŸ“¦ where this page comes from