generic_setlease(9)
π 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 forlm_setup(may beNULLiflm_setupdoesn't require it). so iflm_setupis lowkey chill and doesn't need it, you can just passNULLπ
π¦ 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 inputflp's field, andbreak_leaseneeds 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:
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)__fcntl_getlease(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)
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
- 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