summaryrefslogtreecommitdiff
path: root/fs/bcachefs/btree_key_cache.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-03-16 07:42:25 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:12 +0300
commit14b393ee768e8339b9c64f82df24e8c081bdbff9 (patch)
treeb13103661ffcc09863d14e1c33b951d21d1941a3 /fs/bcachefs/btree_key_cache.c
parent8948fc8f1521702d87a21b9c43c1228e53e3fc29 (diff)
downloadlinux-14b393ee768e8339b9c64f82df24e8c081bdbff9.tar.xz
bcachefs: Subvolumes, snapshots
This patch adds subvolume.c - support for the subvolumes and snapshots btrees and related data types and on disk data structures. The next patches will start hooking up this new code to existing code. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/btree_key_cache.c')
-rw-r--r--fs/bcachefs/btree_key_cache.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/bcachefs/btree_key_cache.c b/fs/bcachefs/btree_key_cache.c
index 9bdc2c3f21bf..7be580555374 100644
--- a/fs/bcachefs/btree_key_cache.c
+++ b/fs/bcachefs/btree_key_cache.c
@@ -164,6 +164,11 @@ btree_key_cache_create(struct btree_key_cache *c,
was_new = false;
}
+ if (btree_id == BTREE_ID_subvolumes)
+ six_lock_pcpu_alloc(&ck->c.lock);
+ else
+ six_lock_pcpu_free(&ck->c.lock);
+
ck->c.level = 0;
ck->c.btree_id = btree_id;
ck->key.btree_id = btree_id;