aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2009-06-10 09:51:32 -0400
committerChris Mason <chris.mason@oracle.com>2009-06-10 11:29:52 -0400
commitc289811cc096c57ff35550ee8132793a4f9b5b59 (patch)
tree47599d47419911c8365e0350e286dece1d5e48dd /fs/btrfs/super.c
parent451d7585a8bb1b9bec0d676ce3dece1923164e55 (diff)
Btrfs: autodetect SSD devices
During mount, btrfs will check the queue nonrot flag for all the devices found in the FS. If they are all non-rotating, SSD mode is enabled by default. If the FS was mounted with -o nossd, the non-rotating flag is ignored. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 7f5b2889949a..3427db28f6fe 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -184,6 +184,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
184 case Opt_nossd: 184 case Opt_nossd:
185 printk(KERN_INFO "btrfs: not using ssd allocation " 185 printk(KERN_INFO "btrfs: not using ssd allocation "
186 "scheme\n"); 186 "scheme\n");
187 btrfs_set_opt(info->mount_opt, NOSSD);
187 btrfs_clear_opt(info->mount_opt, SSD); 188 btrfs_clear_opt(info->mount_opt, SSD);
188 btrfs_clear_opt(info->mount_opt, SSD_SPREAD); 189 btrfs_clear_opt(info->mount_opt, SSD_SPREAD);
189 break; 190 break;
@@ -438,6 +439,8 @@ static int btrfs_show_options(struct seq_file *seq, struct vfsmount *vfs)
438 seq_printf(seq, ",thread_pool=%d", info->thread_pool_size); 439 seq_printf(seq, ",thread_pool=%d", info->thread_pool_size);
439 if (btrfs_test_opt(root, COMPRESS)) 440 if (btrfs_test_opt(root, COMPRESS))
440 seq_puts(seq, ",compress"); 441 seq_puts(seq, ",compress");
442 if (btrfs_test_opt(root, NOSSD))
443 seq_puts(seq, ",nossd");
441 if (btrfs_test_opt(root, SSD_SPREAD)) 444 if (btrfs_test_opt(root, SSD_SPREAD))
442 seq_puts(seq, ",ssd_spread"); 445 seq_puts(seq, ",ssd_spread");
443 else if (btrfs_test_opt(root, SSD)) 446 else if (btrfs_test_opt(root, SSD))