Commit c7652f25 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: promote_whole_extents is now a normal option

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent cfd273f1
...@@ -1086,7 +1086,6 @@ struct bch_fs { ...@@ -1086,7 +1086,6 @@ struct bch_fs {
u64 __percpu *counters; u64 __percpu *counters;
unsigned copy_gc_enabled:1; unsigned copy_gc_enabled:1;
bool promote_whole_extents;
struct bch2_time_stats times[BCH_TIME_STAT_NR]; struct bch2_time_stats times[BCH_TIME_STAT_NR];
......
...@@ -795,6 +795,8 @@ LE64_BITMASK(BCH_SB_HAS_ERRORS, struct bch_sb, flags[0], 60, 61); ...@@ -795,6 +795,8 @@ LE64_BITMASK(BCH_SB_HAS_ERRORS, struct bch_sb, flags[0], 60, 61);
LE64_BITMASK(BCH_SB_HAS_TOPOLOGY_ERRORS,struct bch_sb, flags[0], 61, 62); LE64_BITMASK(BCH_SB_HAS_TOPOLOGY_ERRORS,struct bch_sb, flags[0], 61, 62);
LE64_BITMASK(BCH_SB_BIG_ENDIAN, struct bch_sb, flags[0], 62, 63); LE64_BITMASK(BCH_SB_BIG_ENDIAN, struct bch_sb, flags[0], 62, 63);
LE64_BITMASK(BCH_SB_PROMOTE_WHOLE_EXTENTS,
struct bch_sb, flags[0], 63, 64);
LE64_BITMASK(BCH_SB_STR_HASH_TYPE, struct bch_sb, flags[1], 0, 4); LE64_BITMASK(BCH_SB_STR_HASH_TYPE, struct bch_sb, flags[1], 0, 4);
LE64_BITMASK(BCH_SB_COMPRESSION_TYPE_LO,struct bch_sb, flags[1], 4, 8); LE64_BITMASK(BCH_SB_COMPRESSION_TYPE_LO,struct bch_sb, flags[1], 4, 8);
......
...@@ -286,7 +286,7 @@ static struct promote_op *promote_alloc(struct btree_trans *trans, ...@@ -286,7 +286,7 @@ static struct promote_op *promote_alloc(struct btree_trans *trans,
*/ */
bool promote_full = (failed || bool promote_full = (failed ||
*read_full || *read_full ||
READ_ONCE(c->promote_whole_extents)); READ_ONCE(c->opts.promote_whole_extents));
/* data might have to be decompressed in the write path: */ /* data might have to be decompressed in the write path: */
unsigned sectors = promote_full unsigned sectors = promote_full
? max(pick->crc.compressed_size, pick->crc.live_size) ? max(pick->crc.compressed_size, pick->crc.live_size)
......
...@@ -265,6 +265,11 @@ enum fsck_err_opts { ...@@ -265,6 +265,11 @@ enum fsck_err_opts {
OPT_BOOL(), \ OPT_BOOL(), \
BCH2_NO_SB_OPT, true, \ BCH2_NO_SB_OPT, true, \
NULL, "Enable inline data extents") \ NULL, "Enable inline data extents") \
x(promote_whole_extents, u8, \
OPT_FS|OPT_MOUNT|OPT_RUNTIME, \
OPT_BOOL(), \
BCH_SB_PROMOTE_WHOLE_EXTENTS, true, \
NULL, "Promote whole extents, instead of just part being read")\
x(acl, u8, \ x(acl, u8, \
OPT_FS|OPT_FORMAT|OPT_MOUNT, \ OPT_FS|OPT_FORMAT|OPT_MOUNT, \
OPT_BOOL(), \ OPT_BOOL(), \
......
...@@ -418,6 +418,9 @@ static int bch2_sb_validate(struct bch_sb_handle *disk_sb, ...@@ -418,6 +418,9 @@ static int bch2_sb_validate(struct bch_sb_handle *disk_sb,
if (le16_to_cpu(sb->version) <= bcachefs_metadata_version_disk_accounting_v2 && if (le16_to_cpu(sb->version) <= bcachefs_metadata_version_disk_accounting_v2 &&
!BCH_SB_ALLOCATOR_STUCK_TIMEOUT(sb)) !BCH_SB_ALLOCATOR_STUCK_TIMEOUT(sb))
SET_BCH_SB_ALLOCATOR_STUCK_TIMEOUT(sb, 30); SET_BCH_SB_ALLOCATOR_STUCK_TIMEOUT(sb, 30);
if (le16_to_cpu(sb->version) <= bcachefs_metadata_version_disk_accounting_v2)
SET_BCH_SB_PROMOTE_WHOLE_EXTENTS(sb, true);
} }
for (opt_id = 0; opt_id < bch2_opts_nr; opt_id++) { for (opt_id = 0; opt_id < bch2_opts_nr; opt_id++) {
......
...@@ -811,7 +811,6 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts) ...@@ -811,7 +811,6 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts)
c->copy_gc_enabled = 1; c->copy_gc_enabled = 1;
c->rebalance.enabled = 1; c->rebalance.enabled = 1;
c->promote_whole_extents = true;
c->journal.flush_write_time = &c->times[BCH_TIME_journal_flush_write]; c->journal.flush_write_time = &c->times[BCH_TIME_journal_flush_write];
c->journal.noflush_write_time = &c->times[BCH_TIME_journal_noflush_write]; c->journal.noflush_write_time = &c->times[BCH_TIME_journal_noflush_write];
......
...@@ -219,7 +219,6 @@ read_attribute(copy_gc_wait); ...@@ -219,7 +219,6 @@ read_attribute(copy_gc_wait);
rw_attribute(rebalance_enabled); rw_attribute(rebalance_enabled);
sysfs_pd_controller_attribute(rebalance); sysfs_pd_controller_attribute(rebalance);
read_attribute(rebalance_status); read_attribute(rebalance_status);
rw_attribute(promote_whole_extents);
read_attribute(new_stripes); read_attribute(new_stripes);
...@@ -347,8 +346,6 @@ SHOW(bch2_fs) ...@@ -347,8 +346,6 @@ SHOW(bch2_fs)
if (attr == &sysfs_rebalance_status) if (attr == &sysfs_rebalance_status)
bch2_rebalance_status_to_text(out, c); bch2_rebalance_status_to_text(out, c);
sysfs_print(promote_whole_extents, c->promote_whole_extents);
/* Debugging: */ /* Debugging: */
if (attr == &sysfs_journal_debug) if (attr == &sysfs_journal_debug)
...@@ -436,8 +433,6 @@ STORE(bch2_fs) ...@@ -436,8 +433,6 @@ STORE(bch2_fs)
sysfs_pd_controller_store(rebalance, &c->rebalance.pd); sysfs_pd_controller_store(rebalance, &c->rebalance.pd);
sysfs_strtoul(promote_whole_extents, c->promote_whole_extents);
/* Debugging: */ /* Debugging: */
if (!test_bit(BCH_FS_started, &c->flags)) if (!test_bit(BCH_FS_started, &c->flags))
...@@ -514,7 +509,6 @@ struct attribute *bch2_fs_files[] = { ...@@ -514,7 +509,6 @@ struct attribute *bch2_fs_files[] = {
&sysfs_btree_cache_size, &sysfs_btree_cache_size,
&sysfs_btree_write_stats, &sysfs_btree_write_stats,
&sysfs_promote_whole_extents,
&sysfs_rebalance_status, &sysfs_rebalance_status,
&sysfs_compression_stats, &sysfs_compression_stats,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment