ubifs_write_node_hmac(9)
π ubifs_write_node_hmac(9) π
okay so bestie, welcome to the Kernel API Manual β this one's a function page, and it's lowkey iconic. it's giving "write a node to the media, but with integrity." let's get into it π
β¨ NAME β¨
ubifs_write_node_hmac β write node to the media. that's it, that's the vibe. π
πΈ SYNOPSIS πΈ
int ubifs_write_node_hmac (struct ubifs_info *c , void *buf , int len ,
int lnum , int offs , int hmac_offs );
look at her. six args. main character energy fr fr. π
π¦ ARGUMENTS π¦
cβ the UBIFS file-system description object. your whole file system, basically. slay.bufβ the node to write. this is the thing. the moment. βlenβ node length. how long the node is. measure her.lnumβ logical eraseblock number. which eraseblock we're landing in.offsβ offset within the logical eraseblock. where inside that block, bestie.hmac_offsβ offset of the HMAC within the node. yes, we do HMACs here. security ate. π₯
π§ DESCRIPTION π§
so what does this gorgeous function actually do? she automatically fills in the node magic number, assigns the sequence number, and calculates the node CRC checksum. not me doing three jobs at once ππ
one thing to know β the length of the buf buffer has to be aligned to the minimal I/O unit size. no cap, that's a requirement. β οΈ
she also automatically appends the padding node and padding bytes if needed. so thoughtful of her honestly π«Ά
and the return? returns zero in case of success and a negative error code in case of failure. classic. zero = she ate, negative = something went off. π
π SEE ALSO π
okay here's the whole friend group, all of them, no one left out π
Kernel file ./fs/ubifs/io.c, plus these iconic pages:
ubifs_ro_mode(9)ubifs_check_node(9)ubifs_pad(9)next_sqnum(9)ubifs_prepare_node_hmac(9)ubifs_prepare_node(9)ubifs_prep_grp_node(9)wbuf_timer_callback_nolock(9)new_wbuf_timer_nolock(9)cancel_wbuf_timer_nolock(9)ubifs_wbuf_sync_nolock(9)ubifs_wbuf_seek_nolock(9)ubifs_bg_wbufs_sync(9)ubifs_wbuf_write_nolock(9)ubifs_write_node(9)ubifs_read_node_wbuf(9)ubifs_read_node(9)ubifs_wbuf_init(9)ubifs_wbuf_add_ino_nolock(9)wbuf_has_ino(9)ubifs_sync_wbufs_by_inode(9)
aaaand that's the whole page! this little gem lives in ./fs/ubifs and it's dated October 2026 β remember when? ποΈβ¨ anyway bestie, go write some nodes, stay aligned, and remember: zero means success. periodt. π
π
π¦ 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