__jbd2_journal_erase(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __jbd2_journal_erase β€” the kernel API manual, bestie edition ✨

Okay so welcome to __jbd2_journal_erase(9), the page where we literally wipe journal blocks clean. Grab a snack, this one's short and cute πŸ“


🌸 NAME 🌸

__jbd2_journal_erase β€” the function that discards or zeroouts journal blocks (and like, not the superblock, she's exempt, she's booked and busy, main character energy πŸ‘‘)


✨ SYNOPSIS ✨

int __jbd2_journal_erase (journal_t *journal , unsigned int flags );

That's the whole vibe. An int comes back, you hand her a journal_t *journal and an unsigned int flags, and she handles it 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • journal β€” the journal to erase. That's the one. The target. The moment πŸ’…
  • flags β€” okay so a discard/zeroout request gets sent for each physically contigous region of the journal. (yes, that's how the original spells "contiguous" β€” we do not fix, we respect ⭐) Either JBD2_JOURNAL_FLUSH_DISCARD or JBD2_JOURNAL_FLUSH_ZEROOUT must be set, because that's literally how she knows which operation to perform. No flag, no vibe check passed, bestie πŸ™ˆ

πŸ”₯ NOTE πŸ”₯

JBD2_JOURNAL_FLUSH_ZEROOUT attempts to use hardware offload. But if there's no hardware offload available, the zeroes get explicitly written anyway β€” so it still slays, just manually. See blkdev_issue_zeroout for more details πŸ’–

Fr fr though: no hardware offload β‰  no zeros. She writes them herself. Iconic behaviour, no cap.

🌈 SEE ALSO 🌈

Kernel file ./fs/jbd2/journal.c β€” and here's the whole friend group, all of them listed, all of them linked, all of them invited to the group chat πŸ˜­πŸ’€


That's the page, bestie, you ate πŸ“πŸ¦‹

Source: ./fs/jbd2 Β· Date: October 2026 Β· Doc name: __jbd2_journal_erase(9) β€” mwah, kiss kiss, go erase some blocks πŸ’œβœ¨

πŸ“¦ where this page comes from