jbd2_journal_start(9)
β¨ jbd2_journal_start(9) β¨
ok so this is a page from the Kernel API Manual, and bestie, we're talking about jbd2_journal_start β the function that gets you a brand new handle. π
πΈ NAME πΈ
jbd2_journal_start β obtain a new handle. that's it, that's the vibe. π
π¦ SYNOPSIS π¦
handle_t * jbd2_journal_start (journal_t *journal , int nblocks );
look at her. iconic signature. no notes. β¨
π ARGUMENTS π
journalβ the journal you're starting the transaction on. your main character journal, fr fr.nblocksβ the number of block buffer we might modify. yes, "block buffer," that's literally what it says. count your blocks, bestie. π₯
π DESCRIPTION π
okay so here's what's actually going down. we make sure that the transaction can guarantee at least nblocks of modified buffers in the log. not vibes, not hopes β actual guarantee. and the way that works is we block until the log can guarantee that much space. so yeah, you might sit there waiting a sec. it's giving patient. π§
additionally β and this is the part you gotta pay attention to β if rsv_blocks > 0, we also create another handle with rsv_blocks reserved blocks in the journal. that handle gets stored in h_rsv_handle. she's special like that. π
this reserved handle is not attached to any particular transaction, and thus doesn't block transaction commit. so she's just chilling, unbothered, moisturized. π
π¨ okay listen, this next bit is the important part: if the caller uses this reserved handle, it has to seth_rsv_handletoNULLβ as otherwisejbd2_journal_stopon the parent handle will dispose the reserved one. and likeβ¦ you do not want that happening behind your back. π
also the reserved handle has to be converted to a normal handle using jbd2_journal_start_reserved before it can be used. so don't just grab her and go β convert first. π
it returns a pointer to a newly allocated handle, or an ERR_PTR value on failure. so check for the error, bestie, please. π
π₯ SEE ALSO π₯
all the siblings, all in the kernel file ./fs/jbd2/transaction.c:
jbd2_journal_start_reserved(9)jbd2_journal_extend(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)
and that's the whole page, bestie! this one lives at ./fs/jbd2 and it's dated October 2026 β so yeah, she's from the future, we stan. π«Άβ¨
π¦ 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