jbd2_journal_extend(9)
β¨ jbd2_journal_extend(9) β¨
okay so this is a page from the Kernel API Manual (yes, the Kernel API Manual, we're fancy now π
) and it's all about jbd2_journal_extend β the function that's basically the "bestie can I have a little more??" of the journaling world π«Ά
πΈ NAME πΈ
jbd2_journal_extend β extend buffer credits. like literally just. more credits. π
π¦ SYNOPSIS π¦
int jbd2_journal_extend (handle_t *handle , int nblocks , int
revoke_records );
she takes three things and gives you back an int, no cap β¨
π ARGUMENTS π
handleβ the handle you wanna 'extend'. that's the one, right there πnblocksβ nr blocks to try to extend by. try being the operative word here, we'll get to that πrevoke_recordsβ number of revoke records to try to extend by. also a try situation π
π DESCRIPTION π
so some transactions β think large extends and truncates β can be done atomically all at once, or in several stages. the operation requests a credit for a number of buffer modifications in advance, but it can extend its credit if it needs more. growth mindset fr fr π±
jbd2_journal_extend tries to give the running handle more buffer credits. key word: tries. it does not guarantee that allocation β this is a best-effort only situation, lowkey. and like, the calling process MUST be able to deal cleanly with a failure to extend here. no throwing a tantrum, no crashing, just handle it gracefully bestie π
β οΈ real talk: this is best-effort. if it fails, that's on you to deal with cleanly. the manpage is yelling MUST in all caps for a reason π
Return 0 on success, non-zero on failure.
and the vibes of those non-zero returns:
- return code
< 0implies an error - return code
> 0implies normal transaction-full status
so like. negative = something went wrong π, positive = the transaction is just full, which is a whole normal thing, it's giving "we're at capacity, respectfully" π
π₯ SEE ALSO π₯
Kernel file ./fs/jbd2/transaction.c β and honestly the whole friend group:
jbd2_journal_start(9)jbd2_journal_start_reserved(9)jbd2__journal_restart(9)jbd2_journal_lock_updates(9)jbd2_journal_unlock_updates(9)jbd2_journal_get_write_access(9)jbd2_journal_get_create_access(9)jbd2_journal_get_undo_access(9)jbd2_journal_set_triggers(9)jbd2_journal_dirty_metadata(9)jbd2_journal_forget(9)jbd2_journal_stop(9)jbd2_journal_try_to_free_buffers(9)jbd2_journal_invalidate_folio(9)
like that's the entire group chat, go read all of them, iykyk π
and that's the page!! brought to you by ./fs/jbd2, dated October 2026, and yeah the title up top is jbd2_journal_extend(9) in case you forgot already π mwah, go extend some credits responsibly π§β¨
π¦ 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