lockd_set_file_lock_range3(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… lockd_set_file_lock_range3(9) πŸ’…

okay so bestie, this is the lockd_set_file_lock_range3(9) page from the Kernel API Manual β€” yes, we're doing kernel lock ranges today and it's lowkey iconic ✨

🌸 NAME 🌸

lockd_set_file_lock_range3 β€” set the byte range of a file_lock

πŸ¦‹ SYNOPSIS πŸ¦‹

void lockd_set_file_lock_range3 (struct file_lock *fl , u32 off , u32
       len );

πŸŽ€ ARGUMENTS πŸŽ€

  • fl β€” the file_lock whose length fields are to be initialized 🫢
  • off β€” starting offset of the lock, in bytes
  • len β€” length of the byte range, in bytes, or zero

✨ DESCRIPTION ✨

okay so here's the tea: NLMv3 uses a (start, length) representation for lock byte ranges, while the kernel's file_lock uses (start, end). literally two different vibes bestie 😭

Treat a length of zero or arithmetic overflow β€” that's when end wraps negative because the sum exceeds S32_MAX β€” as "lock to end of file." πŸ’…

no cap: zero length and that overflow case both mean the lock goes all the way to the end of the file. periodt.

πŸ”₯ SEE ALSO πŸ”₯


mwah πŸ’‹ this page's source/version is ./fs/lockd, its date is October 2026, and it's all about lockd_set_file_lock_range3(9) β€” bye bestie, go set those ranges! 🫢✨

πŸ“¦ where this page comes from