gfs2_read_super(9)
π gfs2_read_super(9) β kernel API manual energy β¨
okay so bestie, we're in the Kernel API Manual today and the main character is gfs2_read_super(9). buckle up π
πΈ NAME πΈ
gfs2_read_super β read the gfs2 super block from disk. that's it, that's the vibe π¦
β¨ SYNOPSIS β¨
int gfs2_read_super (struct gfs2_sbd *sdp , sector_t sector , int silent
);
π«Ά ARGUMENTS π«Ά
sdpβ the GFS2 super block. your fave struct, the whole point πsectorβ the location of the super block. where it lives on disk, iykyksilentβ don't print a message if the check fails. quiet queen behaviour π€«
π DESCRIPTION π
so like. this uses the bio functions to read the super block from disk, and the reason is honestly so valid β we want to be 100% sure that we never read cached data. no cap, not even a little bit of cached data. π
here's the tea on when a super block gets read: it's read twice only during each GFS2 mount, and it is never written to by the filesystem. literally never. π
the first time it's read, no locks are held, and the only details that get looked at are the ones relating to the locking protocol. once locking is up and working, the sb is read again under the lock to establish the location of:
- the master directory (contains pointers to journals etc)
- the root directory π
π₯ RETURN π₯
0 on success or error. slay β¨
π SEE ALSO π
- Kernel file
./fs/gfs2/ops_fstype.c gfs2_tune_init(9)gfs2_check_sb(9)gfs2_read_sb(9)gfs2_jindex_hold(9)init_statfs(9)gfs2_lm_mount(9)gfs2_fill_super(9)gfs2_get_tree(9)gfs2_evict_inodes(9)
this one's brought to you by./fs/gfs2, October 2026 edition, and the wholegfs2_read_super(9)moment. ily, go read your super blocks responsibly ππ§β
π¦ 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