generic_setlease(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… generic_setlease(9)

okay so bestie, welcome to the Kernel API Manual page for generic_setlease β€” yes we're in the kernel API manual today, we're being ✨academic✨ and also a little unhinged about file leases. it's giving "locks but make it dramatic." let's get into it 🫢


🌸 NAME 🌸

generic_setlease β€” sets a lease on an open file. literally that's the whole vibe. a lease. on an open file. slay πŸ”₯


✨ SYNOPSIS ✨

int generic_setlease (struct file *filp , int arg , struct file_lease
**flp , void **priv );

πŸŽ€ ARGUMENTS πŸŽ€

  • filp β€” file pointer. yep, the file. the actual file pointer. no cap πŸ¦‹
  • arg β€” type of lease to obtain. which flavor of lease are we getting bestie πŸ‘€
  • flp β€” input β€” file_lock to use, output β€” file_lock inserted. so it's serving double duty: comes in as the lock you wanna use, leaves as the lock that actually got inserted. main character energy tbh πŸ’…
  • priv β€” private data for lm_setup (may be NULL if lm_setup doesn't require it). so if lm_setup is lowkey chill and doesn't need it, you can just pass NULL πŸ™ˆ

πŸ¦‹ DESCRIPTION πŸ¦‹

the (input) flp->fl_lmops->lm_break function is required by break_lease. like, not optional, not a nice-to-have, it's required, periodt. πŸ”₯

heads up bestie: flp->fl_lmops->lm_break β€” that's the input flp's field, and break_lease needs it. don't come for me, that's just what it says πŸ’€

🌈 SEE ALSO 🌈

kernel file ./fs/locks.c and also the whole friend group:

like, the entire lease-and-locking friend group is here. iykyk πŸ§šπŸ’œ


okay that's the whole page bestie!! this one came from the source ./fs, dated October 2026, and it's filed under generic_setlease(9) in the Kernel API Manual. go set some leases responsibly, mwah πŸ’–βœ¨πŸ“

πŸ“¦ where this page comes from