diff options
-rw-r--r-- | fs/btrfs/free-space-tree.c | 7 | ||||
-rw-r--r-- | fs/btrfs/ioctl.c | 4 | ||||
-rw-r--r-- | fs/btrfs/super.c | 4 | ||||
-rw-r--r-- | fs/btrfs/volumes.c | 2 |
4 files changed, 17 insertions, 0 deletions
diff --git a/fs/btrfs/free-space-tree.c b/fs/btrfs/free-space-tree.c index 393e36bd5845..94e887f5ec4e 100644 --- a/fs/btrfs/free-space-tree.c +++ b/fs/btrfs/free-space-tree.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "locking.h" | 23 | #include "locking.h" |
24 | #include "free-space-tree.h" | 24 | #include "free-space-tree.h" |
25 | #include "transaction.h" | 25 | #include "transaction.h" |
26 | #include "sysfs.h" | ||
26 | 27 | ||
27 | static int __add_block_group_free_space(struct btrfs_trans_handle *trans, | 28 | static int __add_block_group_free_space(struct btrfs_trans_handle *trans, |
28 | struct btrfs_fs_info *fs_info, | 29 | struct btrfs_fs_info *fs_info, |
@@ -1169,6 +1170,9 @@ int btrfs_create_free_space_tree(struct btrfs_fs_info *fs_info) | |||
1169 | } | 1170 | } |
1170 | 1171 | ||
1171 | btrfs_set_fs_compat_ro(fs_info, FREE_SPACE_TREE); | 1172 | btrfs_set_fs_compat_ro(fs_info, FREE_SPACE_TREE); |
1173 | btrfs_sysfs_feature_update(fs_info, | ||
1174 | BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE, FEAT_COMPAT_RO); | ||
1175 | |||
1172 | fs_info->creating_free_space_tree = 0; | 1176 | fs_info->creating_free_space_tree = 0; |
1173 | 1177 | ||
1174 | ret = btrfs_commit_transaction(trans, tree_root); | 1178 | ret = btrfs_commit_transaction(trans, tree_root); |
@@ -1237,6 +1241,9 @@ int btrfs_clear_free_space_tree(struct btrfs_fs_info *fs_info) | |||
1237 | return PTR_ERR(trans); | 1241 | return PTR_ERR(trans); |
1238 | 1242 | ||
1239 | btrfs_clear_fs_compat_ro(fs_info, FREE_SPACE_TREE); | 1243 | btrfs_clear_fs_compat_ro(fs_info, FREE_SPACE_TREE); |
1244 | btrfs_sysfs_feature_update(fs_info, | ||
1245 | BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE, FEAT_COMPAT_RO); | ||
1246 | |||
1240 | fs_info->free_space_root = NULL; | 1247 | fs_info->free_space_root = NULL; |
1241 | 1248 | ||
1242 | ret = clear_free_space_tree(trans, free_space_root); | 1249 | ret = clear_free_space_tree(trans, free_space_root); |
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index e392dd67f0ba..209dcfa9ab33 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -1455,6 +1455,8 @@ int btrfs_defrag_file(struct inode *inode, struct file *file, | |||
1455 | 1455 | ||
1456 | if (range->compress_type == BTRFS_COMPRESS_LZO) { | 1456 | if (range->compress_type == BTRFS_COMPRESS_LZO) { |
1457 | btrfs_set_fs_incompat(root->fs_info, COMPRESS_LZO); | 1457 | btrfs_set_fs_incompat(root->fs_info, COMPRESS_LZO); |
1458 | btrfs_sysfs_feature_update(root->fs_info, | ||
1459 | BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO, FEAT_INCOMPAT); | ||
1458 | } | 1460 | } |
1459 | 1461 | ||
1460 | ret = defrag_count; | 1462 | ret = defrag_count; |
@@ -4063,6 +4065,8 @@ static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp) | |||
4063 | btrfs_free_path(path); | 4065 | btrfs_free_path(path); |
4064 | 4066 | ||
4065 | btrfs_set_fs_incompat(root->fs_info, DEFAULT_SUBVOL); | 4067 | btrfs_set_fs_incompat(root->fs_info, DEFAULT_SUBVOL); |
4068 | btrfs_sysfs_feature_update(root->fs_info, | ||
4069 | BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL, FEAT_INCOMPAT); | ||
4066 | btrfs_end_transaction(trans, root); | 4070 | btrfs_end_transaction(trans, root); |
4067 | out: | 4071 | out: |
4068 | mnt_drop_write_file(file); | 4072 | mnt_drop_write_file(file); |
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 86f7fdc05633..5a1bab11984d 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -58,6 +58,7 @@ | |||
58 | #include "dev-replace.h" | 58 | #include "dev-replace.h" |
59 | #include "free-space-cache.h" | 59 | #include "free-space-cache.h" |
60 | #include "backref.h" | 60 | #include "backref.h" |
61 | #include "sysfs.h" | ||
61 | #include "tests/btrfs-tests.h" | 62 | #include "tests/btrfs-tests.h" |
62 | 63 | ||
63 | #include "qgroup.h" | 64 | #include "qgroup.h" |
@@ -477,6 +478,9 @@ int btrfs_parse_options(struct btrfs_root *root, char *options) | |||
477 | btrfs_clear_opt(info->mount_opt, NODATACOW); | 478 | btrfs_clear_opt(info->mount_opt, NODATACOW); |
478 | btrfs_clear_opt(info->mount_opt, NODATASUM); | 479 | btrfs_clear_opt(info->mount_opt, NODATASUM); |
479 | btrfs_set_fs_incompat(info, COMPRESS_LZO); | 480 | btrfs_set_fs_incompat(info, COMPRESS_LZO); |
481 | btrfs_sysfs_feature_update(root->fs_info, | ||
482 | BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO, | ||
483 | FEAT_INCOMPAT); | ||
480 | } else if (strncmp(args[0].from, "no", 2) == 0) { | 484 | } else if (strncmp(args[0].from, "no", 2) == 0) { |
481 | compress_type = "no"; | 485 | compress_type = "no"; |
482 | btrfs_clear_opt(info->mount_opt, COMPRESS); | 486 | btrfs_clear_opt(info->mount_opt, COMPRESS); |
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index c32abbca9d77..73bcd1322c1d 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -4468,6 +4468,8 @@ static void check_raid56_incompat_flag(struct btrfs_fs_info *info, u64 type) | |||
4468 | return; | 4468 | return; |
4469 | 4469 | ||
4470 | btrfs_set_fs_incompat(info, RAID56); | 4470 | btrfs_set_fs_incompat(info, RAID56); |
4471 | btrfs_sysfs_feature_update(info, BTRFS_FEATURE_INCOMPAT_RAID56, | ||
4472 | FEAT_INCOMPAT); | ||
4471 | } | 4473 | } |
4472 | 4474 | ||
4473 | #define BTRFS_MAX_DEVS(r) ((BTRFS_LEAF_DATA_SIZE(r) \ | 4475 | #define BTRFS_MAX_DEVS(r) ((BTRFS_LEAF_DATA_SIZE(r) \ |