get_leaf_nr(9)
β¨ get_leaf_nr(9) β¨
okay bestie, welcome to the <pink>get_leaf_nr</pink> page of the Kernel API Manual π
this one's a little function from the GFS2 crew and honestly it's giving "small but crucial" energy.
πΈ NAME πΈ
get_leaf_nr β get a leaf number associated with the index π
π¦ SYNOPSIS π¦
int get_leaf_nr (struct gfs2_inode *dip , u32 index , u64 *leaf_out );
π ARGUMENTS π
dipβ the GFS2 inode, aka the main character of this operation π«Άindexβ hash table index of the targeted leaf, like the coordinate of the leaf you're hunting for πleaf_outβ the resulting leaf block number lands here, that's your output slot β¨
β RETURN β
Returns 0 on success, and an error code otherwise β so like, if it's not 0, something went sideways, no cap π
π SEE ALSO π
Kernel file ./fs/gfs2/dir.c and its whole friend group:
gfs2_dir_write_data(9)gfs2_dir_read_data(9)gfs2_dir_get_hash_table(9)gfs2_dir_hash_inval(9)dirent_next(9)dirent_del(9)dir_make_exhash(9)dir_split_leaf(9)dir_double_exhash(9)compare_dents(9)do_filldir_main(9)gfs2_dir_readahead(9)dir_e_read(9)gfs2_dir_search(9)dir_new_leaf(9)gfs2_dir_add(9)gfs2_dir_del(9)gfs2_dir_mvino(9)leaf_dealloc(9)gfs2_dir_exhash_dealloc(9)gfs2_diradd_alloc_required(9)
and that's the whole vibe check, bestie π this page lives in ./fs/gfs2, dated October 2026, and it's literally titled get_leaf_nr(9) β slay, go read the source, periodt π§ββοΈπΈ
π¦ 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