summaryrefslogtreecommitdiff
path: root/cmds-check.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-11-02 23:37:03 +0100
committerDavid Sterba <dsterba@suse.com>2016-12-14 15:06:34 +0100
commitdfbdde35fceb8540e03adda861d3e4b0deca226a (patch)
tree0a3c3051c10e43b988f45f328401ee1133b1bc86 /cmds-check.c
parent2f4e20a47a91cafa79b1053c03f9e41d5fb10ccf (diff)
btrfs-progs: make incompat bit wrappers more compact
Use the same macro tricks as in kernel code. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-check.c')
-rw-r--r--cmds-check.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/cmds-check.c b/cmds-check.c
index 905fe53c..fceaec43 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -5144,8 +5144,7 @@ static int check_fs_roots_v2(struct btrfs_fs_info *fs_info)
int ret;
int err = 0;
- ext_ref = btrfs_fs_incompat(fs_info,
- BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF);
+ ext_ref = btrfs_fs_incompat(fs_info, EXTENDED_IREF);
path = btrfs_alloc_path();
if (!path)
@@ -7038,8 +7037,7 @@ static int check_space_cache(struct btrfs_root *root)
btrfs_remove_free_space_cache(cache);
}
- if (btrfs_fs_compat_ro(root->fs_info,
- BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE)) {
+ if (btrfs_fs_compat_ro(root->fs_info, FREE_SPACE_TREE)) {
ret = exclude_super_stripes(root, cache);
if (ret) {
fprintf(stderr, "could not exclude super stripes: %s\n",
@@ -10015,8 +10013,7 @@ static int check_tree_block_ref(struct btrfs_root *root,
btrfs_init_path(&path);
key.objectid = bytenr;
- if (btrfs_fs_incompat(root->fs_info,
- BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA))
+ if (btrfs_fs_incompat(root->fs_info, SKINNY_METADATA))
key.type = BTRFS_METADATA_ITEM_KEY;
else
key.type = BTRFS_EXTENT_ITEM_KEY;
@@ -11788,7 +11785,7 @@ static int reinit_extent_tree(struct btrfs_trans_handle *trans,
* the leaves of any fs roots and pin down the bytes for any file
* extents we find. Not hard but why do it if we don't have to?
*/
- if (btrfs_fs_incompat(fs_info, BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS)) {
+ if (btrfs_fs_incompat(fs_info, MIXED_GROUPS)) {
fprintf(stderr, "We don't support re-initing the extent tree "
"for mixed block groups yet, please notify a btrfs "
"developer you want to do this so they can add this "
@@ -12750,8 +12747,7 @@ int cmd_check(int argc, char **argv)
global_info = info;
root = info->fs_root;
if (clear_space_cache == 1) {
- if (btrfs_fs_compat_ro(info,
- BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE)) {
+ if (btrfs_fs_compat_ro(info, FREE_SPACE_TREE)) {
error(
"free space cache v2 detected, use --clear-space-cache v2");
ret = 1;
@@ -12767,8 +12763,7 @@ int cmd_check(int argc, char **argv)
}
goto close_out;
} else if (clear_space_cache == 2) {
- if (!btrfs_fs_compat_ro(info,
- BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE)) {
+ if (!btrfs_fs_compat_ro(info, FREE_SPACE_TREE)) {
printf("no free space cache v2 to clear\n");
ret = 0;
goto close_out;
@@ -12921,7 +12916,7 @@ int cmd_check(int argc, char **argv)
}
if (!ctx.progress_enabled) {
- if (btrfs_fs_compat_ro(info, BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE))
+ if (btrfs_fs_compat_ro(info, FREE_SPACE_TREE))
fprintf(stderr, "checking free space tree\n");
else
fprintf(stderr, "checking free space cache\n");
@@ -12937,8 +12932,7 @@ int cmd_check(int argc, char **argv)
* are no gaps in the file extents for inodes, otherwise we can just
* ignore it when this happens.
*/
- no_holes = btrfs_fs_incompat(root->fs_info,
- BTRFS_FEATURE_INCOMPAT_NO_HOLES);
+ no_holes = btrfs_fs_incompat(root->fs_info, NO_HOLES);
if (!ctx.progress_enabled)
fprintf(stderr, "checking fs roots\n");
if (check_mode == CHECK_MODE_LOWMEM)