fsverity_ini..._tree_params(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 fsverity_init_merkle_tree_params 🌸

okay bestie, so this is a page straight out of the Kernel API Manual β€” like, actual kernel-level stuff, and yes you can sit with us πŸ’…. The function is fsverity_init_merkle_tree_params, and its whole job is to get your Merkle tree parameters all set up and cute before anything else happens. No cap.


✨ SYNOPSIS ✨

int fsverity_init_merkle_tree_params (struct merkle_tree_params *params
, const struct inode *inode , unsigned int hash_algorithm , unsigned int
log_blocksize , const u8 *salt , size_t salt_size );

literally the whole signature, character for character, because I would never do you dirty like that 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • params β€” the parameters struct you're initializing. this is the main character of the whole operation, honestly πŸ’–
  • inode β€” the inode the Merkle tree is being built for. it's giving "the reason we're all here" energy.
  • hash_algorithm β€” the number of the hash algorithm to use. just the number, bestie, not the algorithm itself πŸ”’
  • log_blocksize β€” log base 2 of the block size you want. so like, math. she's a little mathy but we respect her 🧚
  • salt β€” pointer to the salt. it's optional, so if you don't have one, no biggie πŸ’œ
  • salt_size β€” the size of the salt β€” and yes, it's possibly 0. zero is a valid size, we love that for her ⭐

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the vibe check. this function validates the hash algorithm and the block size first (gotta make sure everything checks out, periodt), then it computes the tree topology β€” the num levels, the num blocks in each level, etc. β€” and then it initializes params with all of it. basically it's doing the whole layout calculation and the setup in one go. obsessed πŸ”₯


πŸ’€ RETURN πŸ’€

  • 0 on success, slay πŸ’…
  • -errno on failure, and yeah, that's the whole story 😭

🌈 SEE ALSO 🌈

  • Kernel file ./fs/verity/open.c β€” go look, iykyk πŸ‘‘

and that's the page! brought to you by ./fs/verity, dated October 2026 β€” catching you in the future, bestie, mwah πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from