Btrfs: add a flags field to btrfs_fs_info
We have a lot of random ints in btrfs_fs_info that can be put into flags. This is mostly equivalent with the exception of how we deal with quota going on or off, now instead we set a flag when we are turning it on or off and deal with that appropriately, rather than just having a pending state that the current quota_enabled gets set to. Thanks, Signed-off-by: Josef Bacik <jbacik@fb.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:

committed by
David Sterba

parent
ba8b04c1d4
commit
afcdd129e0
@@ -1163,7 +1163,7 @@ int btrfs_create_free_space_tree(struct btrfs_fs_info *fs_info)
|
||||
if (IS_ERR(trans))
|
||||
return PTR_ERR(trans);
|
||||
|
||||
fs_info->creating_free_space_tree = 1;
|
||||
set_bit(BTRFS_FS_CREATING_FREE_SPACE_TREE, &fs_info->flags);
|
||||
free_space_root = btrfs_create_tree(trans, fs_info,
|
||||
BTRFS_FREE_SPACE_TREE_OBJECTID);
|
||||
if (IS_ERR(free_space_root)) {
|
||||
@@ -1183,7 +1183,7 @@ int btrfs_create_free_space_tree(struct btrfs_fs_info *fs_info)
|
||||
}
|
||||
|
||||
btrfs_set_fs_compat_ro(fs_info, FREE_SPACE_TREE);
|
||||
fs_info->creating_free_space_tree = 0;
|
||||
clear_bit(BTRFS_FS_CREATING_FREE_SPACE_TREE, &fs_info->flags);
|
||||
|
||||
ret = btrfs_commit_transaction(trans, tree_root);
|
||||
if (ret)
|
||||
@@ -1192,7 +1192,7 @@ int btrfs_create_free_space_tree(struct btrfs_fs_info *fs_info)
|
||||
return 0;
|
||||
|
||||
abort:
|
||||
fs_info->creating_free_space_tree = 0;
|
||||
clear_bit(BTRFS_FS_CREATING_FREE_SPACE_TREE, &fs_info->flags);
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
btrfs_end_transaction(trans, tree_root);
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user