summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/bcachefs.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-06-28 22:09:13 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:10:05 -0400
commitfaa6cb6c13c7223240366ebbf0217a6191fbfc32 (patch)
treec41d92045b9cdd9f84c1f0188ab4d7311796c2bc /fs/bcachefs/bcachefs.h
parentbc652905c60b504ded266448b2810242d24c8d88 (diff)
downloadlinux-stable-faa6cb6c13c7223240366ebbf0217a6191fbfc32.tar.gz
linux-stable-faa6cb6c13c7223240366ebbf0217a6191fbfc32.tar.bz2
linux-stable-faa6cb6c13c7223240366ebbf0217a6191fbfc32.zip
bcachefs: Allow for unknown btree IDs
We need to allow filesystems with metadata from newer versions to be mountable and usable by older versions. This patch enables us to roll out new btrees without a new major version number; we can now handle btree roots for unknown btree types. The unknown btree roots will be retained, and fsck (including backpointers) will check them, the same as other btree types. We add a dynamic array for the extra, unknown btree roots, in addition to the fixed size btree root array, and add new helpers for looking up btree roots. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bcachefs.h')
-rw-r--r--fs/bcachefs/bcachefs.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h
index b8d50fe64b3c..a8488d4e18e8 100644
--- a/fs/bcachefs/bcachefs.h
+++ b/fs/bcachefs/bcachefs.h
@@ -749,7 +749,8 @@ struct bch_fs {
struct bio_set btree_bio;
struct workqueue_struct *io_complete_wq;
- struct btree_root btree_roots[BTREE_ID_NR];
+ struct btree_root btree_roots_known[BTREE_ID_NR];
+ DARRAY(struct btree_root) btree_roots_extra;
struct mutex btree_root_lock;
struct btree_cache btree_cache;