lock_4_inodes(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… lock_4_inodes(9) β€” like, the Kernel API Manual page, bestie πŸŽ€

okay so this is lock_4_inodes from the Kernel API Manual and honestly? it's a little four-inode moment and i'm obsessed. let's get into it ✨


🌸 NAME 🌸

lock_4_inodes β€” a wrapper for locking three UBIFS inodes.

not me clocking that the NAME line says three while the function is literally called lock_4_inodes and takes four args πŸ’€ i'm just the messenger, that's what the page says, no cap.

✨ SYNOPSIS ✨

void lock_4_inodes (struct inode *inode1 , struct inode *inode2 , struct
inode *inode3 , struct inode *inode4 );

returns nothing (void), takes four struct inode * pointers, and that's the whole mood 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • inode1 β€” first inode πŸ‘‘
  • inode2 β€” second inode ⭐
  • inode3 β€” third inode 🌈
  • inode4 β€” fourth inode πŸ’œ

four inodes, four icons, all lined up πŸŽ€


πŸ’– DESCRIPTION πŸ’–

so here's the tea: this function is used for ubifs_rename, and plot twist β€” inode1 may be the same as inode2, whereas inode3 and inode4 may be NULL. slay, flexible friend group πŸ’…

and ngl? there are no tricks in here to guarantee strict lock ordering. not one. zero. because VFS already did it for us on the i_mutex β€” it ate and left no crumbs πŸ”₯ so this is literally just a simple wrapper function. that's it. that's the whole function. main character energy but make it minimal ✨


πŸ‘‘ SEE ALSO πŸ‘‘

kernel file ./fs/ubifs/dir.c plus the whole squad:

iykyk 🧚


lowkey important reminder bestie: four inodes get locked, two of them might be the same inode, two of them might be NULL, and the ordering situation is handled by VFS on the i_mutex β€” not by any extra trickery in here πŸ™ˆ

and that's a wrap, gorgeous πŸ’œ this page lives in ./fs/ubifs and it's dated October 2026 β€” mwah, mwah, periodt πŸ“βœ¨

πŸ“¦ where this page comes from