ubifs_new_inode(9)
π ubifs_new_inode(9) π
okay so this is a page straight outta the Kernel API Manual (ubifs_new_inode(9), yes the whole vibe) and it's literally about birthing a brand-new UBIFS inode. icon behavior. let's get into it π«Ά
β¨ NAME β¨
ubifs_new_inode β allocate new UBIFS inode object. that's it, that's the whole job, and she does it flawlessly π
πΈ SYNOPSIS πΈ
struct inode * ubifs_new_inode (struct ubifs_info *c , struct inode *dir
, umode_t mode , bool is_xattr );
copy it exactly bestie, spacing and all, do not come for me about the comma placement π
π ARGUMENTS π
cβ the UBIFS file-system description object. like, the whole filesystem's little ID card π³dirβ the parent directory inode. every new inode needs a mother figure okay πmodeβ inode mode flags π·οΈis_xattrβ whether the inode is an xattr inode. yes or no, bestie, pick one β¨
π¦ DESCRIPTION π¦
So what she does: this function finds an unused inode number, allocates a new inode, and initializes it. three steps, zero drama, main character energy π
but here's the part where you gotta pay attention π₯ β a non-xattr new inode may be written with xattrs (selinux/encryption) before the dentry gets written. and that combination could cause an inconsistent problem if a powercut happens between those two operations. yes, a literal powercut, mid-operation, chaos π
to deal with that, the non-xattr new inode is initialized with zero-nlink and added into the orphan list. and listen, this is on the caller:
caller should make sure that inode is relinked later, and make sure that orphan removing and journal writing into an committing atomic operation. π no cap, both of those are requirements, not suggestions.
returns new inode in case of success and an error code in case of failure. slay, standard, we love a clear contract π
π SEE ALSO π
Kernel file ./fs/ubifs/dir.c β and her entire friend group:
inherit_flags(9)lock_2_inodes(9)unlock_2_inodes(9)vfs_dent_type(9)ubifs_check_dir_empty(9)lock_4_inodes(9)unlock_4_inodes(9)
okay that's the page bestie, mwah π and for the cute sign-off: this lil masterpiece lives in ./fs/ubifs, dated October 2026, and yes it's still ubifs_new_inode(9) β go forth and allocate responsibly π§β
π¦ 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