gfs2_write_alloc_required(9)
π« gfs2_write_alloc_required(9) π«
okay bestie, welcome to the Kernel API Manual β¨ this one lives in the kernel API docs and tbh it's a little icon β it's literally just a yes/no girlie. no cap.
πΈ NAME πΈ
gfs2_write_alloc_required β figure out if a write will require an allocation π§
like, will this write need new blocks carved out of the filesystem, or are we chillin' in space that's already ours? that's the whole vibe check.
β¨ SYNOPSIS β¨
int gfs2_write_alloc_required (struct gfs2_inode *ip , u64 offset ,
unsigned int len );
three args, one int coming back at you. simple. iconic. π
π ARGUMENTS π
ipβ the file being written to ποΈ your main character inode, fr fr.offsetβ the offset to write to π like, where in the file are we dropping this data.lenβ the number of bytes being written π the size of the little payload, bestie.
π¦ RETURN π¦
1β an alloc is required π₯ yes queen, go allocate.0β otherwise π nope, no allocation needed, we're good.
that's it. that's the return value.1or0. no secret third thing π
π SEE ALSO π
Kernel file ./fs/gfs2/bmap.c β and honestly the whole bmap.c friend group showed up, so let's give them their shoutouts π
gfs2_unstuffer_folio(9)gfs2_unstuff_dinode(9)find_metapath(9)metaptr1(9)metapointer(9)lookup_metapath(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)
π quick reminder bestie:1means allocation required,0means it's not. don't flip them, i'm begging π
and that's the page!! π«Ά this little cutie is from ./fs/gfs2, dated October 2026, under the Kernel API Manual banner β go forth and allocate responsibly, 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