summaryrefslogtreecommitdiff
path: root/fs/bcachefs/super.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-12-04 20:07:19 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:18 -0400
commit2430e72f42778a9448ff386686856b61b49f5074 (patch)
treee24bdbedd9ff95a5c6d165e5feceeae4094d3440 /fs/bcachefs/super.c
parent92d2ec10926d2ba8c38ba0ecada69cfd7a4dd3c4 (diff)
bcachefs: Convert journal sysfs params to regular options
This converts journal_write_delay, journal_flush_disabled, and journal_reclaim_delay to normal filesystems options, and also adds them to the superblock. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/super.c')
-rw-r--r--fs/bcachefs/super.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c
index b24e64317a73..22dbbf77d687 100644
--- a/fs/bcachefs/super.c
+++ b/fs/bcachefs/super.c
@@ -752,6 +752,15 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts)
scnprintf(c->name, sizeof(c->name), "%pU", &c->sb.user_uuid);
+ /* Compat: */
+ if (sb->version <= bcachefs_metadata_version_inode_v2 &&
+ !BCH_SB_JOURNAL_FLUSH_DELAY(sb))
+ SET_BCH_SB_JOURNAL_FLUSH_DELAY(sb, 1000);
+
+ if (sb->version <= bcachefs_metadata_version_inode_v2 &&
+ !BCH_SB_JOURNAL_RECLAIM_DELAY(sb))
+ SET_BCH_SB_JOURNAL_RECLAIM_DELAY(sb, 100);
+
c->opts = bch2_opts_default;
bch2_opts_apply(&c->opts, bch2_opts_from_sb(sb));
bch2_opts_apply(&c->opts, opts);