is_last_write(9)
π
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 ππ
is_empty(9)first_non_ff(9)get_master_node(9)write_rcvrd_mst_node(9)ubifs_recover_master_node(9)ubifs_write_rcvrd_mst_node(9)clean_buf(9)no_more_nodes(9)fix_unclean_leb(9)drop_last_group(9)drop_last_node(9)ubifs_recover_leb(9)get_cs_sqnum(9)ubifs_recover_log_leb(9)recover_head(9)ubifs_recover_inl_heads(9)clean_an_unclean_leb(9)ubifs_clean_lebs(9)grab_empty_leb(9)ubifs_rcvry_gc_commit(9)struct size_entry(9)add_ino(9)find_ino(9)remove_ino(9)ubifs_destroy_size_tree(9)ubifs_recover_size_accum(9)fix_size_in_place(9)inode_fix_size(9)ubifs_recover_size(9)
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
- 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