ubifs_jnl_rename(9)
π ubifs_jnl_rename(9) π
okay so bestie, you found a page from the Kernel API Manual β yes, that ubifs_jnl_rename(9) one β and I'm gonna walk you through it like we're texting at 2am. pull up a chair. π
β¨ NAME β¨
ubifs_jnl_rename β rename a directory entry. that's it, that's the whole vibe. one job, and it does it. π
πΈ SYNOPSIS πΈ
int ubifs_jnl_rename (struct ubifs_info *c , const struct inode *old_dir
, const struct inode *old_inode , const struct fscrypt_name *old_nm ,
const struct inode *new_dir , const struct inode *new_inode , const
struct fscrypt_name *new_nm , const struct inode *whiteout , int sync ,
int delete_orphan );
look at all those parameters. ten of them. she's high-maintenance and we respect it. returns an int, obviously. π
π¦ ARGUMENTS π¦
cβ the UBIFS file-system description object. it's giving "main character" β everything else just hangs off this.old_dirβ parent inode of the directory entry you wanna rename. the old one. the origin story.old_inodeβ the inode of the directory entry you're renaming. that's the thing being moved, bestie.old_nmβ the old name of the directory entry being renamed. its government name, if you will.new_dirβ parent inode of the directory entry you're renaming to. new home, new energy.new_inodeβ the new directory entry's inode (or, plot twist, the directory entry's inode that's getting replaced). both cases, one slot. πnew_nmβ the new name for the new directory entry. glow-up name. β¨whiteoutβ the whiteout inode. yes that's a real thing, no I'm not making it up.syncβ non-zero if the write-buffer has to be synchronized. so: zero means nah, non-zero means yes bestie flush it. π₯delete_orphanβ indicates an orphan entry deletion for whiteout. lowkey important, don't skip it.
π DESCRIPTION π
so this function? it implements the re-name operation. and listen β this is not a lil casual thing, because it may involve writing up to 4 inodes (the new inode, the whiteout inode, and the old and new parent directory inodes) and 2 directory entries. that's a whole lot of writing, hence the jnl in the name β journal business, iykyk. π
then it marks the written inodes as clean and returns zero on success. iconic. zero is the good number here.
but if something goes wrong? it returns a negative error code. that's the "not me crying in errno" moment. π no cap, negative means bad news.
π SEE ALSO π
the Kernel file ./fs/ubifs/journal.c, plus a whole squad of friends β literally the entire group chat:
zero_ino_node_unused(9)zero_dent_node_unused(9)zero_trun_node_unused(9)reserve_space(9)write_head(9)__queue_and_wait(9)wait_for_reservation(9)wake_up_reservation(9)add_or_start_queue(9)make_reservation(9)release_head(9)finish_reservation(9)get_dent_type(9)pack_inode(9)mark_inode_clean(9)ubifs_jnl_update(9)ubifs_jnl_write_data(9)ubifs_jnl_write_inode(9)ubifs_jnl_delete_inode(9)ubifs_jnl_xrename(9)truncate_data_node(9)ubifs_jnl_truncate(9)ubifs_jnl_delete_xattr(9)ubifs_jnl_change_xattr(9)
all 24 of them, present and accounted for. π«Ά go read them, they're literally all in ./fs/ubifs/journal.c and they all ate. π
heads up bestie: this page lives under ./fs/ubifs and it's dated October 2026, so yes, it's from the future (of this doc, anyway). stay hydrated, back up your filesystems, and remember β zero is success, negative is a whole mood. β
bye bestie, ily, go rename something 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