ubifs_prepare_node_hmac(9)
π ubifs_prepare_node_hmac(9) β the kernel API manual, but make it make sense
okay so bestie, welcome to the Kernel API Manual entry for ubifs_prepare_node_hmac β yes that's a mouthful, yes it's iconic, and yes we're gonna get through it together π«Ά
β¨ NAME β¨
ubifs_prepare_node_hmac β literally the function that preps a node so it's ready to be written to flash πΎβ¨
β¨ SYNOPSIS β¨
int ubifs_prepare_node_hmac (struct ubifs_info *c , void *node , int len
, int hmac_offs , int pad );
that's the whole vibe check right there, no cap π₯
β¨ ARGUMENTS β¨
cβ the UBIFS file-system description object, aka the main character of this whole file system πnodeβ the node that needs padding, our little glow-up victim πlenβ the length of the node, keep it exact bestie πhmac_offsβ the offset of the HMAC inside the node, iykyk πpadβ tells us whether the buffer has to be padded or not π
β¨ DESCRIPTION β¨
so here's the tea β β this function takes the node sitting at node and gets it fully ready to be written to the media. it does the whole routine:
- it calculates the node CRC β
- it fills in the common header π
- and it adds proper padding up to the next minimum I/O unit β but only if
padis not zero, okay? don't forget that condition π
and one more thing: if hmac_offs is positive, then a HMAC gets inserted into the node at the given offset πβ¨
as for what it gives back β this function returns 0 for success, or a negative error code otherwise. so zero means slay, negative means something went off π
β¨ SEE ALSO β¨
the kernel file ./fs/ubifs/io.c and honestly the whole friend group π
ubifs_ro_mode(9)ubifs_check_node(9)ubifs_pad(9)next_sqnum(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_hmac(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)
like, that's the whole squad, go read them too π¦
ngl bestie, if you're touching flash nodes in UBIFS you already have main character energy. go off π
and that's a wrap! this page came to you from ./fs/ubifs, dated October 2026 β mwah, bye bestie πππ·
π¦ 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