__fcntl_getlease(9)
π
__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&willydisagree over whetherF_INPROGRESSshould 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:
locks_owner_has_blockers(9)lease_open_conflict(9)locks_delete_block(9)posix_lock_file(9)posix_lock_inode_wait(9)inode_lease_ignore_mask(9)__break_lease(9)lease_get_mtime(9)generic_setlease(9)vfs_setlease(9)fcntl_setlease(9)fcntl_setdeleg(9)flock_lock_inode_wait(9)locks_lock_inode_wait(9)sys_flock(9)vfs_test_lock(9)locks_translate_pid(9)vfs_lock_file(9)vfs_cancel_lock(9)vfs_inode_has_locks(9)
source/version: ./fs Β· date: October 2026 β mwah, bye bestie ππ«Ά
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms