gfs2_journaled_truncate(9)
π gfs2_journaled_truncate(9) β like, the Kernel API Manual, bestie β¨
okay so this is a page straight out of the Kernel API Manual, and it's about one very specific little function. no cap, it's niche but it's iconic. let's get into it π«Ά
β¨ NAME β¨
gfs2_journaled_truncate β a wrapper for truncate_pagecache for jdata files. that's the whole vibe. it's giving "middle management for cache truncation" πΌβ¨
πΈ SYNOPSIS πΈ
int gfs2_journaled_truncate (struct inode *inode , u64 oldsize , u64
newsize );
three things go in, one int comes out. simple as that, periodt π
π ARGUMENTS π
inodeβ the inode being truncated. the main character of this whole operation, honestly πoldsizeβ the original (larger) size. the before pic πΈnewsizeβ the new smaller size. the glow-down, if you will β¨
π¦ DESCRIPTION π¦
so here's the tea π΅: with jdata files, we have to journal a revoke for each block which is truncated. every single one. no skipping, no shortcuts, iykyk π
and because of that, if the number of pages being truncated gets too large, we need to split this into separate transactions. like, you can't just throw it all in one β that's not how any of this works, bestie π§β¨
lowkey important: the splitting is a need, not a nice-to-have. too many pages in one go = too many revokes in one transaction, and that's the whole reason this wrapper exists fr fr π
π SEE ALSO π
Kernel file ./fs/gfs2/bmap.c β go read it, it's right there π and while you're at it, these iconic siblings:
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)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 a whole friend group of functions, and honestly? they all ate π
that's the page!! mwah π it lives in ./fs/gfs2, dated October 2026 β screenshot it, cite it, tell your friends, stan the kernel docs ππ§ββοΈπ
π¦ 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