ocfs2_prep_n...rphaned_file(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ocfs2_prep_new_orphaned_file β€” Kernel API Manual, but make it make sense ✨

okay so bestie, welcome to the Kernel API Manual page for ocfs2_prep_new_orphaned_file. The header is doing its little ocfs2_prep_n...rphaned_file(9) abbreviation thing, but we're talking about ocfs2_prep_new_orphaned_file β€” periodt. 🫢 This one is highkey a special case, so let's get into it.


✨ NAME ✨

ocfs2_prep_new_orphaned_file β€” prepare the orphan dir to receive a newly allocated file.

This is different from the typical add to orphan dir operation in that the inode does not yet exist. And that's a problem: the orphan dir stringifies the inode block number to come up with its dirent, so obvi if the inode does not yet exist we have a chicken and egg problem. 🐣πŸ₯š This function works around it by calling deeper into the orphan and suballoc code than other callers. Use this only by necessity. no cap. πŸ’€

πŸ’… SYNOPSIS πŸ’…

int ocfs2_prep_new_orphaned_file (struct inode *dir , struct buffer_head *dir_bh , char *orphan_name , struct inode **ret_orphan_dir , u64 *ret_di_blkno , struct ocfs2_dir_lookup_result *orphan_insert , struct ocfs2_alloc_context **ret_inode_ac );

πŸŽ€ ARGUMENTS πŸŽ€

  • dir β€” the directory which this inode will ultimately wind up under β€” not the orphan dir! πŸ™ˆ
  • dir_bh β€” buffer_head the dir inode block.
  • orphan_name β€” string of length (CFS2_ORPHAN_NAMELEN + 1). Will be filled with the string to be used for orphan dirent. Pass back to the orphan dir code.
  • ret_orphan_dir β€” orphan dir inode returned to be passed back into orphan dir code.
  • ret_di_blkno β€” block number where the new inode will be allocated.
  • orphan_insert β€” Dir insert context to be passed back into orphan dir code.
  • ret_inode_ac β€” Inode alloc context to be passed back to the allocator.

πŸ¦‹ DESCRIPTION πŸ¦‹

Returns zero on success and the ret_orphan_dir, name and lookup fields will be populated. ✨

Returns non-zero on failure. 😭

🌸 SEE ALSO 🌸

Kernel file ./fs/ocfs2/namei.c and ocfs2_prepare_orphan_dir(9) β€” go read, iykyk. 🧚


peace out from ./fs/ocfs2, October 2026 β€” your girl ocfs2_prep_n...rphaned_file(9) πŸ’–βœ¨

πŸ“¦ where this page comes from