jbd2_journal_dirty_metadata(9)
π jbd2_journal_dirty_metadata β like, the Kernel API Manual era, bestie π
okay so real talk, this page is jbd2_journal_dirty_metadata(9) and it lives in the Kernel API Manual and it is literally the "hey bestie, this buffer is dirty" function, iykyk π
β¨ NAME β¨
jbd2_journal_dirty_metadata β mark a buffer as containing dirty metadata π«Ά
πΈ SYNOPSIS πΈ
int jbd2_journal_dirty_metadata (handle_t *handle , struct buffer_head
*bh );
like yes that's the whole vibe, two args, no notes π
π¦ ARGUMENTS π¦
handleβ the transaction you're adding the buffer to, main character energy frbhβ the buffer we're marking, that's the one, slay
π DESCRIPTION π
so what this does is mark dirty metadata that needs to be journaled as part of the current transaction. that's the whole job, iconic behavior honestly β¨
β οΈ but listen, there's a prerequisite and it is not optional: the buffer must have previously hadjbd2_journal_get_write_accesscalled on it, so that it has a validjournal_headattached to the buffer head. no cap, if you skip that step you're not doing the vibe check and it's giving chaos π
once you do it right, the buffer gets placed on the transaction's metadata list and is marked as belonging to the transaction. cute, tidy, put it on the list ππΈ
it returns an error number, or 0 on success β so like, 0 = you ate π₯
π the special-care part (do not skip this one)
special care needs to be taken if the buffer already belongs to the current committing transaction (in which case we should have frozen data present for that commit). π§
in that case, we don't relink the buffer β that only gets done when the old transaction finally completes its commit. so like, hands off, it's still finishing its thing, let the old transaction have its moment π periodt.
π SEE ALSO π
kernel file ./fs/jbd2/transaction.c β home of the source material, go read it bestie π
jbd2_journal_start(9)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_forget(9)jbd2_journal_stop(9)jbd2_journal_try_to_free_buffers(9)jbd2_journal_invalidate_folio(9)
okay that's the whole page, and yes I'm obsessed with it π sourced from ./fs/jbd2, dated October 2026, and the whole thing is filed under jbd2_journal_dirty_metadata(9) β mwah, go journal something, bestie π§ββοΈπ
π¦ 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