diff options
author | Tsutomu Itoh <t-itoh@jp.fujitsu.com> | 2011-03-30 20:44:29 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-04-05 01:19:41 -0400 |
commit | 200da64e0b039f873f0f20481e6a7d056e7cc6c9 (patch) | |
tree | 11cd911aa441efdde26260b72a642daef0fd61f0 /fs/btrfs/super.c | |
parent | c9149235a42ab93914434fff45c44b45023363f3 (diff) |
Btrfs: fix /proc/mounts info.
Some mount options are not displayed by /proc/mounts.
This patch displays the option such as compress_type by /proc/mounts.
Ex.
[before]
$ mount | grep sdc2
/dev/sdc2 on /test12 type btrfs (rw,space_cache,compress=lzo)
$ cat /proc/mounts | grep sdc2
/dev/sdc2 /test12 btrfs rw,relatime,compress 0 0
[after]
$ mount | grep sdc2
/dev/sdc2 on /test12 type btrfs (rw,space_cache,compress=lzo)
$ cat /proc/mounts | grep sdc2
/dev/sdc2 /test12 btrfs rw,relatime,compress=lzo,space_cache 0 0
Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r-- | fs/btrfs/super.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 2edfc039f098..58e7de9cc90c 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -644,6 +644,7 @@ static int btrfs_show_options(struct seq_file *seq, struct vfsmount *vfs) | |||
644 | { | 644 | { |
645 | struct btrfs_root *root = btrfs_sb(vfs->mnt_sb); | 645 | struct btrfs_root *root = btrfs_sb(vfs->mnt_sb); |
646 | struct btrfs_fs_info *info = root->fs_info; | 646 | struct btrfs_fs_info *info = root->fs_info; |
647 | char *compress_type; | ||
647 | 648 | ||
648 | if (btrfs_test_opt(root, DEGRADED)) | 649 | if (btrfs_test_opt(root, DEGRADED)) |
649 | seq_puts(seq, ",degraded"); | 650 | seq_puts(seq, ",degraded"); |
@@ -662,8 +663,16 @@ static int btrfs_show_options(struct seq_file *seq, struct vfsmount *vfs) | |||
662 | if (info->thread_pool_size != min_t(unsigned long, | 663 | if (info->thread_pool_size != min_t(unsigned long, |
663 | num_online_cpus() + 2, 8)) | 664 | num_online_cpus() + 2, 8)) |
664 | seq_printf(seq, ",thread_pool=%d", info->thread_pool_size); | 665 | seq_printf(seq, ",thread_pool=%d", info->thread_pool_size); |
665 | if (btrfs_test_opt(root, COMPRESS)) | 666 | if (btrfs_test_opt(root, COMPRESS)) { |
666 | seq_puts(seq, ",compress"); | 667 | if (info->compress_type == BTRFS_COMPRESS_ZLIB) |
668 | compress_type = "zlib"; | ||
669 | else | ||
670 | compress_type = "lzo"; | ||
671 | if (btrfs_test_opt(root, FORCE_COMPRESS)) | ||
672 | seq_printf(seq, ",compress-force=%s", compress_type); | ||
673 | else | ||
674 | seq_printf(seq, ",compress=%s", compress_type); | ||
675 | } | ||
667 | if (btrfs_test_opt(root, NOSSD)) | 676 | if (btrfs_test_opt(root, NOSSD)) |
668 | seq_puts(seq, ",nossd"); | 677 | seq_puts(seq, ",nossd"); |
669 | if (btrfs_test_opt(root, SSD_SPREAD)) | 678 | if (btrfs_test_opt(root, SSD_SPREAD)) |
@@ -678,6 +687,12 @@ static int btrfs_show_options(struct seq_file *seq, struct vfsmount *vfs) | |||
678 | seq_puts(seq, ",discard"); | 687 | seq_puts(seq, ",discard"); |
679 | if (!(root->fs_info->sb->s_flags & MS_POSIXACL)) | 688 | if (!(root->fs_info->sb->s_flags & MS_POSIXACL)) |
680 | seq_puts(seq, ",noacl"); | 689 | seq_puts(seq, ",noacl"); |
690 | if (btrfs_test_opt(root, SPACE_CACHE)) | ||
691 | seq_puts(seq, ",space_cache"); | ||
692 | if (btrfs_test_opt(root, CLEAR_CACHE)) | ||
693 | seq_puts(seq, ",clear_cache"); | ||
694 | if (btrfs_test_opt(root, USER_SUBVOL_RM_ALLOWED)) | ||
695 | seq_puts(seq, ",user_subvol_rm_allowed"); | ||
681 | return 0; | 696 | return 0; |
682 | } | 697 | } |
683 | 698 | ||