lookup_metapath(9)
π« lookup_metapath(9) β like, the kernel API manual, section 9 bestie π«
okay so real talk, this is a page from the Kernel API Manual, section 9 β the deep-lore zone where all the kernel-internals girlies live. gather round π
β¨ NAME β¨
lookup_metapath β walk the metadata tree all the way to a specific point πΆββοΈπ³
β¨ SYNOPSIS β¨
int lookup_metapath (struct gfs2_inode *ip , struct metapath *mp );
β¨ ARGUMENTS β¨
ipβ the inode. that's the main character right there πmpβ the metapath. the itinerary. the lil map she's following πΊοΈ
πΈ DESCRIPTION πΈ
so here's the vibe check π β this function assumes that the inode's buffer has already been looked up and hooked onto mp->mp_bh[0], and that the metapath has been initialised by find_metapath. no cap, those two things are on you, not on her π
if she runs into a part of the tree that hasn't been allocated yet? she doesn't panic, she just returns the current height of the tree at the exact point where she found that unallocated block πβ¨
and every block she does find? added straight to the mp->mp_bh[] list. she's collecting them, she's stacking them, she's building the whole thing π«Ά
β RETURN β
error β that's it, that's the return value, periodt π
π¦ SEE ALSO π¦
kernel file ./fs/gfs2/bmap.c, plus the whole friend group (and honestly, this is a big friend group π):
gfs2_unstuffer_folio(9)gfs2_unstuff_dinode(9)find_metapath(9)metaptr1(9)metapointer(9)fillup_metapath(9)gfs2_extent_length(9)gfs2_hole_size(9)__gfs2_iomap_alloc(9)gfs2_alloc_size(9)__gfs2_iomap_get(9)gfs2_block_map(9)gfs2_journaled_truncate(9)sweep_bh_for_rgrps(9)find_nonnull_ptr(9)punch_hole(9)do_shrink(9)do_grow(9)gfs2_setattr_size(9)gfs2_free_journal_extents(9)gfs2_add_jextent(9)gfs2_map_journal_extents(9)gfs2_write_alloc_required(9)
like I said. huge friend group. all iconique, all linked, iykyk π
okay that's the whole page bestie!! this one was brought to you straight outta ./fs/gfs2, dated October 2026 β screenshot it, cite it, put it on your fridge, mwah π«Άππ
π¦ 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