diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-04-11 22:39:39 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:20 -0400 |
commit | d07343561e263fcbbdb8042f35ca29a602190e18 (patch) | |
tree | 5dbc1590f373699e01b1f319c072e14d6688d751 /fs/bcachefs/ec.c | |
parent | 644d180b055fa47be7e6ca8b684f45e2350dfafd (diff) | |
download | lwn-d07343561e263fcbbdb8042f35ca29a602190e18.tar.gz lwn-d07343561e263fcbbdb8042f35ca29a602190e18.zip |
bcachefs: Deduplicate keys in the journal before replay
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/ec.c')
-rw-r--r-- | fs/bcachefs/ec.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/fs/bcachefs/ec.c b/fs/bcachefs/ec.c index 6a357e5b652e..47d197ed5c99 100644 --- a/fs/bcachefs/ec.c +++ b/fs/bcachefs/ec.c @@ -12,8 +12,8 @@ #include "ec.h" #include "error.h" #include "io.h" -#include "journal_io.h" #include "keylist.h" +#include "recovery.h" #include "super-io.h" #include "util.h" @@ -1235,9 +1235,9 @@ static void bch2_stripe_read_key(struct bch_fs *c, struct bkey_s_c k) bch2_mark_key(c, k, true, 0, NULL, 0, 0); } -int bch2_stripes_read(struct bch_fs *c, struct list_head *journal_replay_list) +int bch2_stripes_read(struct bch_fs *c, struct journal_keys *journal_keys) { - struct journal_replay *r; + struct journal_key *i; struct btree_trans trans; struct btree_iter *iter; struct bkey_s_c k; @@ -1258,14 +1258,9 @@ int bch2_stripes_read(struct bch_fs *c, struct list_head *journal_replay_list) if (ret) return ret; - list_for_each_entry(r, journal_replay_list, list) { - struct bkey_i *k, *n; - struct jset_entry *entry; - - for_each_jset_key(k, n, entry, &r->j) - if (entry->btree_id == BTREE_ID_EC) - bch2_stripe_read_key(c, bkey_i_to_s_c(k)); - } + for_each_journal_key(*journal_keys, i) + if (i->btree_id == BTREE_ID_EC) + bch2_stripe_read_key(c, bkey_i_to_s_c(i->k)); return 0; } |