summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-04-06 07:11:01 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2024-05-09 00:29:18 +0300
commit68e142405cf4cf01461012ec72d675038c514b92 (patch)
treeb2d7f9e013e9122976b2c0e225a995b1a2151394
parent665e8b32393523f0fb4752ccd4831ae6a10b1145 (diff)
downloadlinux-68e142405cf4cf01461012ec72d675038c514b92.tar.xz
bcachefs: bch2_gc() is now private to btree_gc.c
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r--fs/bcachefs/btree_gc.c14
-rw-r--r--fs/bcachefs/btree_gc.h2
-rw-r--r--fs/bcachefs/recovery_passes.c5
-rw-r--r--fs/bcachefs/sysfs.c12
4 files changed, 8 insertions, 25 deletions
diff --git a/fs/bcachefs/btree_gc.c b/fs/bcachefs/btree_gc.c
index 791470b0c654..606e1120ab7c 100644
--- a/fs/bcachefs/btree_gc.c
+++ b/fs/bcachefs/btree_gc.c
@@ -1756,7 +1756,7 @@ static void bch2_gc_stripes_reset(struct bch_fs *c, bool metadata_only)
* move around - if references move backwards in the ordering GC
* uses, GC could skip past them
*/
-int bch2_gc(struct bch_fs *c, bool initial, bool metadata_only)
+static int bch2_gc(struct bch_fs *c, bool initial, bool metadata_only)
{
unsigned iter = 0;
int ret;
@@ -1843,6 +1843,11 @@ out:
return ret;
}
+int bch2_check_allocations(struct bch_fs *c)
+{
+ return bch2_gc(c, true, false);
+}
+
static int gc_btree_gens_key(struct btree_trans *trans,
struct btree_iter *iter,
struct bkey_s_c k)
@@ -2024,14 +2029,7 @@ static int bch2_gc_thread(void *arg)
last = atomic64_read(&clock->now);
last_kick = atomic_read(&c->kick_gc);
- /*
- * Full gc is currently incompatible with btree key cache:
- */
-#if 0
- ret = bch2_gc(c, false, false);
-#else
bch2_gc_gens(c);
-#endif
debug_check_no_locks_held();
}
diff --git a/fs/bcachefs/btree_gc.h b/fs/bcachefs/btree_gc.h
index 607575f83a00..0d6c0a2df613 100644
--- a/fs/bcachefs/btree_gc.h
+++ b/fs/bcachefs/btree_gc.h
@@ -6,7 +6,7 @@
#include "btree_types.h"
int bch2_check_topology(struct bch_fs *);
-int bch2_gc(struct bch_fs *, bool, bool);
+int bch2_check_allocations(struct bch_fs *);
int bch2_gc_gens(struct bch_fs *);
void bch2_gc_thread_stop(struct bch_fs *);
int bch2_gc_thread_start(struct bch_fs *);
diff --git a/fs/bcachefs/recovery_passes.c b/fs/bcachefs/recovery_passes.c
index 0cec0f7d9703..c065c0d01212 100644
--- a/fs/bcachefs/recovery_passes.c
+++ b/fs/bcachefs/recovery_passes.c
@@ -26,11 +26,6 @@ const char * const bch2_recovery_passes[] = {
NULL
};
-static int bch2_check_allocations(struct bch_fs *c)
-{
- return bch2_gc(c, true, false);
-}
-
static int bch2_set_may_go_rw(struct bch_fs *c)
{
struct journal_keys *keys = &c->journal_keys;
diff --git a/fs/bcachefs/sysfs.c b/fs/bcachefs/sysfs.c
index b6bfd7cbce18..4011ab4e710b 100644
--- a/fs/bcachefs/sysfs.c
+++ b/fs/bcachefs/sysfs.c
@@ -501,18 +501,8 @@ STORE(bch2_fs)
if (attr == &sysfs_btree_wakeup)
bch2_btree_wakeup_all(c);
- if (attr == &sysfs_trigger_gc) {
- /*
- * Full gc is currently incompatible with btree key cache:
- */
-#if 0
- down_read(&c->state_lock);
- bch2_gc(c, false, false);
- up_read(&c->state_lock);
-#else
+ if (attr == &sysfs_trigger_gc)
bch2_gc_gens(c);
-#endif
- }
if (attr == &sysfs_trigger_discards)
bch2_do_discards(c);