diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-05-14 13:58:51 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:32 +0300 |
commit | d8a161ad5493016aa6eba8853990456aa78316c9 (patch) | |
tree | c9ae4377cfbe748f12d4e145f41caa511e0e0641 | |
parent | facc81479cab081cbcb962bfbe5d61f25230d013 (diff) | |
download | linux-d8a161ad5493016aa6eba8853990456aa78316c9.tar.xz |
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.c | 6 | ||||
-rw-r--r-- | fs/bcachefs/lru.h | 2 | ||||
-rw-r--r-- | fs/bcachefs/recovery.c | 9 |
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); |