summaryrefslogtreecommitdiff
path: root/fs/bcachefs
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-07-09 05:33:29 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:10:06 +0300
commit78328fec704e316b36142a9a13af8665cd46da47 (patch)
treeae9d6c489930380932921fccb24dfcb9eafef135 /fs/bcachefs
parent10a6ced2da8e4b53a14ab172b0ce70b83543bbfb (diff)
downloadlinux-78328fec704e316b36142a9a13af8665cd46da47.tar.xz
bcachefs: Stash journal replay params in bch_fs
For the upcoming enumeration of recovery passes, we need all recovery passes to be called the same way - including journal replay. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs')
-rw-r--r--fs/bcachefs/bcachefs.h3
-rw-r--r--fs/bcachefs/recovery.c11
2 files changed, 11 insertions, 3 deletions
diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h
index 1ab32b61f060..67ed55761aec 100644
--- a/fs/bcachefs/bcachefs.h
+++ b/fs/bcachefs/bcachefs.h
@@ -993,6 +993,9 @@ struct bch_fs {
/* QUOTAS */
struct bch_memquota_type quotas[QTYP_NR];
+ /* RECOVERY */
+ u64 journal_replay_seq_start;
+ u64 journal_replay_seq_end;
/* DEBUG JUNK */
struct dentry *fs_debug_dir;
struct dentry *btree_debug_dir;
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index 4c61a28e492c..1499efc9d2a0 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -624,11 +624,13 @@ static int journal_sort_seq_cmp(const void *_l, const void *_r)
return cmp_int(l->journal_seq, r->journal_seq);
}
-static int bch2_journal_replay(struct bch_fs *c, u64 start_seq, u64 end_seq)
+static int bch2_journal_replay(struct bch_fs *c)
{
struct journal_keys *keys = &c->journal_keys;
struct journal_key **keys_sorted, *k;
struct journal *j = &c->journal;
+ u64 start_seq = c->journal_replay_seq_start;
+ u64 end_seq = c->journal_replay_seq_start;
size_t i;
int ret;
@@ -1256,6 +1258,9 @@ use_clean:
blacklist_seq = journal_seq = le64_to_cpu(clean->journal_seq) + 1;
}
+ c->journal_replay_seq_start = last_seq;
+ c->journal_replay_seq_end = blacklist_seq - 1;;
+
if (c->opts.reconstruct_alloc) {
c->sb.compat &= ~(1ULL << BCH_COMPAT_alloc_info);
drop_alloc_keys(&c->journal_keys);
@@ -1346,7 +1351,7 @@ use_clean:
set_bit(BCH_FS_MAY_GO_RW, &c->flags);
bch_info(c, "starting journal replay, %zu keys", c->journal_keys.nr);
- ret = bch2_journal_replay(c, last_seq, blacklist_seq - 1);
+ ret = bch2_journal_replay(c);
if (ret)
goto err;
if (c->opts.verbose || !c->sb.clean)
@@ -1406,7 +1411,7 @@ use_clean:
set_bit(BCH_FS_MAY_GO_RW, &c->flags);
bch_verbose(c, "starting journal replay, %zu keys", c->journal_keys.nr);
- ret = bch2_journal_replay(c, last_seq, blacklist_seq - 1);
+ ret = bch2_journal_replay(c);
if (ret)
goto err;
if (c->opts.verbose || !c->sb.clean)