clean_buf(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… clean_buf(9) β€” from the Kernel API Manual ✨

okay bestie, buckle up, because today we're reading a manpage straight out of the kernel's clean_buf(9) era β€” that's the manual name, yes, it's giving "deep in the file system, no thoughts just LEBs" πŸ’œ


🌸 NAME 🌸

clean_buf β€” she cleans the data out of an LEB that's just sitting there in a buffer. that's it. that's the job. periodt.


✨ SYNOPSIS ✨

void clean_buf (const struct ubifs_info *c , void **buf , int lnum , int
*offs , int *len );

like, look at that signature. void return, so no receipts come back β€” everything happens through the pointers. main character energy fr fr 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • c β€” the UBIFS file-system description object. she's the vibe check for the whole thing, everything runs through her πŸ’…
  • buf β€” the buffer that's getting cleaned. yes, that one. go get her 🧚
  • lnum β€” the LEB number we're cleaning. LEB = logical erase block, if you know you know πŸ¦‹
  • offs β€” the offset we start cleaning from πŸ“
  • len β€” how long the buffer is 🌈

πŸ’– DESCRIPTION πŸ’–

okay so here's the tea πŸ”₯ β€” this function pads things up to the next min_io_size boundary (only if there actually is one, don't come for her), and then it sets all that empty space to 0xff. all of it. not a single byte left behind πŸ’€

and the glow-up doesn't stop there β€” buf, offs and len all get updated to the next c->min_io_size boundary too. so like, they don't just walk away unchanged, they get refreshed. slay ✨


πŸ¦‹ SEE ALSO πŸ¦‹

the whole friend group, no cap β€” kernel file ./fs/ubifs/recovery.c and her 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), is_last_write(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)


ngl, that's a lot of siblings. go say hi to at least three of them or you're not a real one πŸ™ˆ

okay that's the whole page, mwah πŸ’‹ β€” this one came from ./fs/ubifs, dated October 2026, and it signs off as clean_buf(9). catch you on the next manpage, bestie πŸŽ€πŸ’œ

πŸ“¦ where this page comes from