gfs2_free_extlen(9)
π« gfs2_free_extlen β a Kernel API Manual moment (section 9, bestie) π«
okay so real talk, we're in the Kernel API Manual, section 9, and today's main character is gfs2_free_extlen(9). she's a tiny function with one job and she does it immaculately. let's get into it π
β¨ NAME β¨
gfs2_free_extlen β Return extent length of free blocks
like... that's the whole vibe. she counts how long a run of free blocks is. no cap. π¦
πΈ SYNOPSIS πΈ
u32 gfs2_free_extlen (const struct gfs2_rbm *rrbm , u32 len );
yes she takes a const struct gfs2_rbm * pointer and a u32 and she returns a u32. signature stays exactly like that, don't @ me π
π ARGUMENTS π
rrbmβ Starting position. like, where we begin the little block-stroll, bestie. πΆββοΈlenβ Max length to check. this is your hard ceiling, she will not read past it.
π DESCRIPTION π
so here's the tea β β starting at the block specified by the rbm, she sees how many free blocks there are, and she does not read more than len blocks ahead. boundaries, queen. respect them. π
now, the fun part: this can be done using memchr_inv when the blocks are byte aligned, but it has to be done on a block by block basis in case of unaligned blocks. no shortcuts for the messy ones, unfortunately. π
also, this function can cope with bitmap boundaries β iconique β although it must stop on a resource group boundary. that one's non-negotiable, fr fr. so she's flexible, but not that flexible. π«Ά
π₯ RETURN π₯
Number of free blocks in the extent. that's it, that's the payoff. count 'em and hand 'em over. β¨
π SEE ALSO π
Kernel file ./fs/gfs2/rgrp.c β and honestly the whole group chat showed up for this one:
gfs2_setbit(9)gfs2_testbit(9)gfs2_bit_search(9)rs_cmp(9)gfs2_bitfit(9)gfs2_rbm_from_block(9)gfs2_rbm_add(9)gfs2_unaligned_extlen(9)gfs2_bitcount(9)gfs2_rgrp_verify(9)gfs2_blk2rgrpd(9)gfs2_rgrpd_get_first(9)gfs2_rgrpd_get_next(9)__rs_deltree(9)gfs2_rs_deltree(9)gfs2_rs_delete(9)return_all_reservations(9)compute_bitstructs(9)gfs2_ri_total(9)read_rindex_entry(9)set_rgrp_preferences(9)gfs2_ri_update(9)gfs2_rindex_update(9)gfs2_rgrp_go_instantiate(9)gfs2_rgrp_brelse(9)gfs2_fitrim(9)rs_insert(9)rgd_free(9)rg_mblk_search(9)gfs2_next_unreserved_block(9)gfs2_reservation_check_and_update(9)gfs2_rbm_find(9)try_rgrp_unlink(9)gfs2_rgrp_congested(9)gfs2_rgrp_used_recently(9)fast_to_acquire(9)gfs2_inplace_reserve(9)gfs2_inplace_release(9)gfs2_alloc_extent(9)rgblk_free(9)gfs2_rgrp_dump(9)gfs2_adjust_reservation(9)gfs2_set_alloc_start(9)gfs2_alloc_blocks(9)__gfs2_free_blocks(9)gfs2_free_meta(9)gfs2_check_blk_type(9)gfs2_rlist_add(9)gfs2_rlist_alloc(9)gfs2_rlist_free(9)
like I said. the whole group chat. ππ
and that's the page, bestie π β brought to you by the source directory ./fs/gfs2, dated October 2026, filed under gfs2_free_extlen(9). go forth and count your free blocks. slay. π
β¨
π¦ 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