generic_fh_to_parent(9)
π generic_fh_to_parent(9)
okay so this is from the Kernel API Manual, and bestie, it's a whole little helper function and honestly? she's iconic. β¨
πΈ NAME πΈ
generic_fh_to_parent β the generic helper for the fh_to_parent export operation π«Ά
β¨ SYNOPSIS β¨
struct dentry * generic_fh_to_parent (struct super_block *sb , struct
fid *fid , int fh_len , int fh_type , struct inode *(*get_inode) (struct
super_block *sb, u64 ino, u32 gen) );
no cap, that's the whole signature. look at her go. π
π ARGUMENTS π
sbβ the filesystem we're doing the file handle conversion on, like that's her whole jobfidβ the file handle that's getting converted, yes ma'amfh_lenβ length of the file handle, measured in bytes (bytes!! not vibes!!)fh_typeβ the type of the file handle, iykykget_inodeβ the filesystem callback that goes and retrieves the inode π§
π DESCRIPTION π
So here's the tea: this function decodes fid β but only as long as it's one of the well-known Linux filehandle types, okay? vibe check first, always.
Once that's confirmed, she calls get_inode on it to retrieve the inode for the _parent_ object specified in the file handle, if it's actually specified in the file handle. And if it's not? NULL otherwise. periodt. π¦
π₯ SEE ALSO π₯
Kernel file ./fs/libfs.c:
simple_offset_init(9)simple_offset_add(9)simple_offset_remove(9)simple_offset_rename(9)simple_offset_rename_exchange(9)simple_offset_destroy(9)offset_dir_llseek(9)offset_readdir(9)simple_rename_timestamp(9)simple_setattr(9)simple_write_end(9)simple_read_from_buffer(9)simple_write_to_buffer(9)memory_read_from_buffer(9)generic_encode_ino32_fh(9)generic_fh_to_dentry(9)simple_fsync_noflush(9)simple_fsync(9)generic_check_addressable(9)simple_get_link(9)generic_ci_d_compare(9)generic_ci_d_hash(9)generic_ci_match(9)generic_set_sb_d_ops(9)inode_maybe_inc_iversion(9)inode_query_iversion(9)simple_inode_init_ts(9)path_from_stashed(9)simple_start_creating(9)
like, that's the whole friend group right there π
k bye bestie, ily β this page lives in ./fs, dated October 2026, and she ate, no crumbs ππ
π¦ 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