lease_get_mtime(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… lease_get_mtime(9) β€” Kernel API Manual, bestie edition πŸŽ€

Okay so we're in section 9 of the Kernel API Manual today and the star of the show is lease_get_mtime. Yes, that name is doing the absolute most, but stick with me, it's actually kind of iconic. ✨


🌸 NAME 🌸

lease_get_mtime β€” updates the modified time of an inode that's holding an exclusive lease. That's the whole gig. She's a one-job girlie and she does it flawlessly. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

void lease_get_mtime (struct inode *inode , struct timespec64 *time );

Returns nothing (void), takes two args, no cap. 🫢


πŸ“ ARGUMENTS πŸ“

  • inode β€” the inode. That's it, that's the description. The inode in question, the main character of this whole function. πŸ‘‘
  • time β€” pointer to a timespec which contains the last modified time. Like, it's pointing at the timestamp, it doesn't own it, we're not doing that today. πŸ™ˆ

✨ DESCRIPTION ✨

So here's the vibe: this function exists to force NFS clients to flush their caches for files that have exclusive leases on them. Like, politely but firmly making them let go of their stale little cached copies. πŸ”₯

And the justification? Lowkey genius. The reasoning is that if someone has an exclusive lease, then they could be modifying it. So the cache can't be trusted anymore, bestie. If you're holding the exclusive lease you might be out here editing files, and stale cache data is not the moment. πŸ’€

It's giving "trust but verify," but for kernel file timestamps. Periodt.


🌈 SEE ALSO 🌈

The source of all this wisdom lives in the Kernel file ./fs/locks.c, and honestly the friend group is huge. Here's the whole squad, all at section 9, no gatekeeping: 🧚

All of them are literally one man 9 away. Iykyk. πŸ’œ


Fr fr, that's the whole page β€” every flag, every arg, every reference, nothing skipped. Slay. πŸŽ€

Sign-off time, bestie: this lil masterpiece is filed under ./fs, and it's dated October 2026, stamped lease_get_mtime(9) at the bottom like a little signature. πŸ¦‹ Stay cachy, stay leased, and don't forget to flush. Mwah. πŸ’–

πŸ“¦ where this page comes from