gfs2_free_extlen(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« 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:

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