is_last_write(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… is_last_write(9) β€” like, the Kernel API Manual page for is_last_write πŸŽ€

okay so bestie, sit down, we're reading a kernel page together and honestly? it's a short one, we ate. ✨


🌸 NAME 🌸

is_last_write β€” literally figures out if some offset was chillin' in the last write to a LEB. that's it, that's the whole vibe check. πŸ¦‹


✨ SYNOPSIS ✨

int is_last_write (const struct ubifs_info *c , void *buf , int offs );

look at her go, three args, int out the other side. iconic. πŸ’…


πŸ“ ARGUMENTS πŸ“

  • c β€” the UBIFS file-system description object, the main character of the story ngl 🫢
  • buf β€” the buffer we're checking, like the little container of data we're snooping in πŸ”
  • offs β€” the offset we're checking, the specific spot bestie, the coords πŸ“

πŸ’– DESCRIPTION πŸ’–

so the way this works is: this function returns 1 if offs was in the last write to the LEB whose data lives in buf. otherwise you get 0. no cap, that's the whole deal. 😌

and how does it know? the determination is made by checking for subsequent empty space starting from the next c->max_write_size boundary. like, it peeks past that boundary looking for emptiness and goes "yeah, that was the last write" or "nope". detective behaviour fr fr πŸ”₯


🌈 SEE ALSO 🌈

Kernel file ./fs/ubifs/recovery.c has a whole friend group, and they're all here β€” say hi besties πŸ‘‹πŸ’œ


k byeee, that's the page 🫢 this lil masterpiece comes from ./fs/ubifs, dated October 2026 β€” and this rewrite's filed under is_last_write(9) too, obviously, she contains multitudes πŸ’€βœ¨πŸ‘‘

πŸ“¦ where this page comes from