aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Kent Overstreet <kent.overstreet@gmail.com> 2022-05-14 06:58:51 -0400
committerGravatar Kent Overstreet <kent.overstreet@linux.dev> 2023-10-22 17:09:32 -0400
commitd8a161ad5493016aa6eba8853990456aa78316c9 (patch)
treec9ae4377cfbe748f12d4e145f41caa511e0e0641
parentbcachefs: Delete bch_writepage (diff)
downloadlinux-d8a161ad5493016aa6eba8853990456aa78316c9.tar.gz
linux-d8a161ad5493016aa6eba8853990456aa78316c9.tar.bz2
linux-d8a161ad5493016aa6eba8853990456aa78316c9.zip
bcachefs: LRU repair tweaks
- Drop old unneeded parameter for whether we're in initial GC - which was from when btree updates had to be done differently before we went RW. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--fs/bcachefs/lru.c6
-rw-r--r--fs/bcachefs/lru.h2
-rw-r--r--fs/bcachefs/recovery.c9
3 files changed, 6 insertions, 11 deletions
diff --git a/fs/bcachefs/lru.c b/fs/bcachefs/lru.c
index ce23b38382f5..d278331776dd 100644
--- a/fs/bcachefs/lru.c
+++ b/fs/bcachefs/lru.c
@@ -130,7 +130,7 @@ int bch2_lru_change(struct btree_trans *trans, u64 id, u64 idx,
}
static int bch2_check_lru_key(struct btree_trans *trans,
- struct btree_iter *lru_iter, bool initial)
+ struct btree_iter *lru_iter)
{
struct bch_fs *c = trans->c;
struct btree_iter iter;
@@ -193,7 +193,7 @@ fsck_err:
return ret;
}
-int bch2_check_lrus(struct bch_fs *c, bool initial)
+int bch2_check_lrus(struct bch_fs *c)
{
struct btree_trans trans;
struct btree_iter iter;
@@ -207,7 +207,7 @@ int bch2_check_lrus(struct bch_fs *c, bool initial)
ret = __bch2_trans_do(&trans, NULL, NULL,
BTREE_INSERT_NOFAIL|
BTREE_INSERT_LAZY_RW,
- bch2_check_lru_key(&trans, &iter, initial));
+ bch2_check_lru_key(&trans, &iter));
if (ret)
break;
}
diff --git a/fs/bcachefs/lru.h b/fs/bcachefs/lru.h
index bfe38a67e585..3decb7b1dde2 100644
--- a/fs/bcachefs/lru.h
+++ b/fs/bcachefs/lru.h
@@ -14,6 +14,6 @@ int bch2_lru_delete(struct btree_trans *, u64, u64, u64, struct bkey_s_c);
int bch2_lru_set(struct btree_trans *, u64, u64, u64 *);
int bch2_lru_change(struct btree_trans *, u64, u64, u64, u64 *, struct bkey_s_c);
-int bch2_check_lrus(struct bch_fs *, bool);
+int bch2_check_lrus(struct bch_fs *);
#endif /* _BCACHEFS_LRU_H */
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index f54859b49416..87a4bced853a 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -1256,11 +1256,10 @@ use_clean:
bch_info(c, "checking lrus");
err = "error checking lrus";
- ret = bch2_check_lrus(c, true);
+ ret = bch2_check_lrus(c);
if (ret)
goto err;
bch_verbose(c, "done checking lrus");
-
set_bit(BCH_FS_CHECK_LRUS_DONE, &c->flags);
bch_info(c, "checking alloc to lru refs");
@@ -1268,12 +1267,8 @@ use_clean:
ret = bch2_check_alloc_to_lru_refs(c);
if (ret)
goto err;
- set_bit(BCH_FS_CHECK_ALLOC_TO_LRU_REFS_DONE, &c->flags);
-
- ret = bch2_check_lrus(c, true);
- if (ret)
- goto err;
bch_verbose(c, "done checking alloc to lru refs");
+ set_bit(BCH_FS_CHECK_ALLOC_TO_LRU_REFS_DONE, &c->flags);
} else {
set_bit(BCH_FS_MAY_GO_RW, &c->flags);
set_bit(BCH_FS_INITIAL_GC_DONE, &c->flags);