summaryrefslogtreecommitdiff
path: root/fs/bcachefs/recovery.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2022-12-06 00:49:13 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:52 +0300
commit83f33d686553c5105ff36da4dd554c34125094e9 (patch)
tree3ec96acbfeb14d67d96f027fb7d888f1156cd200 /fs/bcachefs/recovery.c
parent350175bf9b0fe5da12a2fd8bfd453a49f038ceb4 (diff)
downloadlinux-83f33d686553c5105ff36da4dd554c34125094e9.tar.xz
bcachefs: Rework lru btree
This patch changes how the LRU index works: Instead of using KEY_TYPE_lru where the bucket the lru entry points to is part of the value, this switches to KEY_TYPE_set and encoding the bucket we refer to in the low bits of the key. This means that we no longer have to check for collisions when inserting LRU entries. We'll be making using of this in the next patch, which adds a btree write buffer - a pure write buffer for btree updates, where updates are appended to a simple array and then periodically sorted and batch inserted. This is a new on disk format version, and a forced upgrade. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/recovery.c')
-rw-r--r--fs/bcachefs/recovery.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index b10ba8963350..8a78377bf9c5 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -1094,14 +1094,11 @@ int bch2_fs_recovery(struct bch_fs *c)
}
if (!c->opts.nochanges) {
- if (c->sb.version < bcachefs_metadata_version_backpointers) {
+ if (c->sb.version < bcachefs_metadata_version_lru_v2) {
bch_info(c, "version prior to backpointers, upgrade and fsck required");
c->opts.version_upgrade = true;
c->opts.fsck = true;
c->opts.fix_errors = FSCK_OPT_YES;
- } else if (c->sb.version < bcachefs_metadata_version_inode_v3) {
- bch_info(c, "version prior to inode_v3, upgrade required");
- c->opts.version_upgrade = true;
}
}