bcachefs: Convert snapshot table to RCU array
This switches the generic radix tree for the in-memory table of snapshot
nodes to a simple rcu array. This means we have to add new locking to
deal with reallocations, but is faster than traversing the radix tree.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h
index d8c0206..445d010 100644
--- a/fs/bcachefs/bcachefs.h
+++ b/fs/bcachefs/bcachefs.h
@@ -774,9 +774,10 @@ struct bch_fs {
struct mutex sb_lock;
/* snapshot.c: */
- GENRADIX(struct snapshot_t) snapshots;
- struct bch_snapshot_table __rcu *snapshot_table;
+ struct snapshot_table __rcu *snapshots;
+ size_t snapshot_table_size;
struct mutex snapshot_table_lock;
+
struct work_struct snapshot_delete_work;
struct work_struct snapshot_wait_for_pagecache_and_delete_work;
snapshot_id_list snapshots_unlinked;