Commit 5dccefd3 authored by Coly Li's avatar Coly Li Committed by Jens Axboe

bcache: add code comments in bch_btree_leaf_dirty()

This patch adds code comments in bch_btree_leaf_dirty() to explain
why w->journal should always reference the eldest journal pin of
all the writing bkeys in the btree node. To make the bcache journal
code to be easier to be understood.
Signed-off-by: default avatarColy Li <colyli@suse.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 84c529ae
...@@ -569,6 +569,11 @@ static void bch_btree_leaf_dirty(struct btree *b, atomic_t *journal_ref) ...@@ -569,6 +569,11 @@ static void bch_btree_leaf_dirty(struct btree *b, atomic_t *journal_ref)
set_btree_node_dirty(b); set_btree_node_dirty(b);
/*
* w->journal is always the oldest journal pin of all bkeys
* in the leaf node, to make sure the oldest jset seq won't
* be increased before this btree node is flushed.
*/
if (journal_ref) { if (journal_ref) {
if (w->journal && if (w->journal &&
journal_pin_cmp(b->c, w->journal, journal_ref)) { journal_pin_cmp(b->c, w->journal, journal_ref)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment