jbd2_journal_extend(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 < 0 implies an error
  • return code > 0 implies 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:

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