ocfs2_prep_n...rphaned_file(9)
π 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_headthe 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
- 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