aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2017-07-21 19:15:57 +0200
committerDavid Sterba <dsterba@suse.com>2017-07-21 19:15:57 +0200
commite166dd52dfa5101e0dad7c828c2cc0c9bd2c36b9 (patch)
tree1b0105fa78445e92aabaa1b37d8d5e48d7a7b167 /fs
parent93058e69596db4a3458a9e5e197c9373d5f57bf1 (diff)
parentaedd492dbcdcc5c91738e964566efb904aecddc0 (diff)
Merge branch 'ext/hans/ssd-no-spread' into for-next-next-v4.14-20170721
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/ctree.h4
-rw-r--r--fs/btrfs/disk-io.c6
-rw-r--r--fs/btrfs/extent-tree.c11
-rw-r--r--fs/btrfs/free-space-cache.c11
-rw-r--r--fs/btrfs/super.c16
5 files changed, 23 insertions, 25 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 5ee9f10adcc9..1e3efe8c536c 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -471,7 +471,7 @@ struct btrfs_block_rsv {
/*
* free clusters are used to claim free space in relatively large chunks,
* allowing us to do less seeky writes. They are used for all metadata
- * allocations and data allocations in ssd mode.
+ * allocations and data allocations in ssd_spread mode.
*/
struct btrfs_free_cluster {
spinlock_t lock;
@@ -967,7 +967,7 @@ struct btrfs_fs_info {
struct reloc_control *reloc_ctl;
- /* data_alloc_cluster is only used in ssd mode */
+ /* data_alloc_cluster is only used in ssd_spread mode */
struct btrfs_free_cluster data_alloc_cluster;
/* all metadata allocations go through this cluster */
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index f1ed7e490fca..3672441fe51b 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3053,11 +3053,9 @@ retry_root_backup:
if (IS_ERR(fs_info->transaction_kthread))
goto fail_cleaner;
- if (!btrfs_test_opt(fs_info, SSD) &&
- !btrfs_test_opt(fs_info, NOSSD) &&
+ if (!btrfs_test_opt(fs_info, NOSSD) &&
!fs_info->fs_devices->rotating) {
- btrfs_info(fs_info, "detected SSD devices, enabling SSD mode");
- btrfs_set_opt(fs_info->mount_opt, SSD);
+ btrfs_set_and_info(fs_info, SSD, "enabling ssd optimizations");
}
/*
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 075015d12992..358ed30e02bc 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -6654,19 +6654,20 @@ fetch_cluster_info(struct btrfs_fs_info *fs_info,
struct btrfs_space_info *space_info, u64 *empty_cluster)
{
struct btrfs_free_cluster *ret = NULL;
- bool ssd = btrfs_test_opt(fs_info, SSD);
*empty_cluster = 0;
if (btrfs_mixed_space_info(space_info))
return ret;
- if (ssd)
- *empty_cluster = SZ_2M;
if (space_info->flags & BTRFS_BLOCK_GROUP_METADATA) {
ret = &fs_info->meta_alloc_cluster;
- if (!ssd)
+ if (btrfs_test_opt(fs_info, SSD))
+ *empty_cluster = SZ_2M;
+ else
*empty_cluster = SZ_64K;
- } else if ((space_info->flags & BTRFS_BLOCK_GROUP_DATA) && ssd) {
+ } else if ((space_info->flags & BTRFS_BLOCK_GROUP_DATA) &&
+ btrfs_test_opt(fs_info, SSD_SPREAD)) {
+ *empty_cluster = SZ_2M;
ret = &fs_info->data_alloc_cluster;
}
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index cdc9f4015ec3..8f9721f0b316 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -3034,14 +3034,11 @@ int btrfs_find_space_cluster(struct btrfs_fs_info *fs_info,
int ret;
/*
- * Choose the minimum extent size we'll require for this
- * cluster. For SSD_SPREAD, don't allow any fragmentation.
- * For metadata, allow allocates with smaller extents. For
- * data, keep it dense.
+ * Choose the minimum extent size we'll require for this cluster. For
+ * metadata, allow allocates with smaller extents. For data, keep it
+ * dense.
*/
- if (btrfs_test_opt(fs_info, SSD_SPREAD)) {
- cont1_bytes = min_bytes = bytes + empty_size;
- } else if (block_group->flags & BTRFS_BLOCK_GROUP_METADATA) {
+ if (block_group->flags & BTRFS_BLOCK_GROUP_METADATA) {
cont1_bytes = bytes;
min_bytes = fs_info->sectorsize;
} else {
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 1f36c3e3de57..9e64e403443b 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -549,20 +549,22 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
break;
case Opt_ssd:
btrfs_set_and_info(info, SSD,
- "use ssd allocation scheme");
+ "enabling ssd optimizations");
btrfs_clear_opt(info->mount_opt, NOSSD);
break;
case Opt_ssd_spread:
+ btrfs_set_and_info(info, SSD,
+ "enabling ssd optimizations");
btrfs_set_and_info(info, SSD_SPREAD,
- "use spread ssd allocation scheme");
- btrfs_set_opt(info->mount_opt, SSD);
+ "using legacy ssd allocation scheme");
btrfs_clear_opt(info->mount_opt, NOSSD);
break;
case Opt_nossd:
- btrfs_set_and_info(info, NOSSD,
- "not using ssd allocation scheme");
- btrfs_clear_opt(info->mount_opt, SSD);
- btrfs_clear_opt(info->mount_opt, SSD_SPREAD);
+ btrfs_set_opt(info->mount_opt, NOSSD);
+ btrfs_clear_and_info(info, SSD,
+ "not using ssd optimizations");
+ btrfs_clear_and_info(info, SSD_SPREAD,
+ "not using legacy ssd allocation scheme");
break;
case Opt_barrier:
btrfs_clear_and_info(info, NOBARRIER,