lock_4_inodes(9)
π 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:
inherit_flags(9)ubifs_new_inode(9)lock_2_inodes(9)unlock_2_inodes(9)vfs_dent_type(9)ubifs_check_dir_empty(9)unlock_4_inodes(9)
iykyk π§
lowkey important reminder bestie: four inodes get locked, two of them might be the same inode, two of them might beNULL, and the ordering situation is handled by VFS on thei_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
- 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