__fcntl_getlease(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __fcntl_getlease β€” the lease-check queen πŸ’…

okay so bestie, welcome to the Kernel API Manual entry for __fcntl_getlease β€” the function whose whole main-character job is to enquire what lease is currently active. ngl, it's giving β€œwho's holding the lease rn?” energy, and we're obsessed. ✨

🌸 NAME 🌸

__fcntl_getlease β€” Enquire what lease is currently active. periodt. πŸ’…

πŸ¦‹ SYNOPSIS πŸ¦‹

Here's the signature, bestie β€” exact vibes only:

int __fcntl_getlease (struct file *filp , unsigned int flavor );

πŸ’– ARGUMENTS πŸ’–

Two arguments, no cap:

  • filp β€” the file πŸ—‚οΈ
  • flavor β€” type of lease flags to check πŸ”

πŸŽ€ DESCRIPTION πŸŽ€

okay so here's the tea: the value returned by this function will be one of these (if no lease break is pending):

  • F_RDLCK β€” to indicate a shared lease is held. πŸ’ž
  • F_WRLCK β€” to indicate an exclusive lease is held. πŸ‘‘
  • F_UNLCK β€” to indicate no lease is held. 🚫

and if a lease break is pending, it's one of these:

  • F_RDLCK β€” to indicate an exclusive lease needs to be changed to a shared lease (or removed). πŸ”
  • F_UNLCK β€” to indicate the lease needs to be removed. 🧹
XXX: sfr & willy disagree over whether F_INPROGRESS should be returned to userspace. πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./fs/locks.c is where the lock lore lives, and the whole lock-adjacent friend group is:


source/version: ./fs Β· date: October 2026 β€” mwah, bye bestie πŸ’‹πŸ«Ά

πŸ“¦ where this page comes from