Skip to content

Commit f66b33f

Browse files
committed
btrfs-progs: check: use bool for option status variables
Signed-off-by: David Sterba <dsterba@suse.com>
1 parent ff9464a commit f66b33f

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

check/main.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ u64 data_bytes_allocated = 0;
8181
u64 data_bytes_referenced = 0;
8282
LIST_HEAD(duplicate_extents);
8383
LIST_HEAD(delete_items);
84-
int no_holes = 0;
85-
static int is_free_space_tree = 0;
86-
int init_extent_tree = 0;
87-
int check_data_csum = 0;
84+
bool no_holes = false;
85+
bool is_free_space_tree = false;
86+
bool init_extent_tree = false;
87+
bool check_data_csum = false;
8888
struct cache_tree *roots_info_cache = NULL;
8989

9090
enum btrfs_check_mode {
@@ -6004,7 +6004,7 @@ static int check_csum_root(struct btrfs_root *root)
60046004
int ret;
60056005
u64 data_len;
60066006
unsigned long leaf_offset;
6007-
bool verify_csum = !!check_data_csum;
6007+
bool verify_csum = check_data_csum;
60086008
u16 num_entries, max_entries;
60096009

60106010
max_entries = ((BTRFS_LEAF_DATA_SIZE(gfs_info) -
@@ -10109,16 +10109,16 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv)
1010910109
int ret = 0;
1011010110
int err = 0;
1011110111
u64 num;
10112-
int init_csum_tree = 0;
10113-
int readonly = 0;
10112+
bool init_csum_tree = false;
10113+
bool readonly = false;
10114+
bool qgroup_report = false;
10115+
bool force = false;
1011410116
int clear_space_cache = 0;
10115-
int qgroup_report = 0;
1011610117
int qgroups_repaired = 0;
1011710118
int qgroup_verify_ret;
1011810119
unsigned ctree_flags = OPEN_CTREE_EXCLUSIVE |
1011910120
OPEN_CTREE_ALLOW_TRANSID_MISMATCH |
1012010121
OPEN_CTREE_SKIP_LEAF_ITEM_CHECKS;
10121-
int force = 0;
1012210122

1012310123
while(1) {
1012410124
int c;
@@ -10172,7 +10172,7 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv)
1017210172
printf("using SB copy %llu, bytenr %llu\n", num, bytenr);
1017310173
break;
1017410174
case 'Q':
10175-
qgroup_report = 1;
10175+
qgroup_report = true;
1017610176
break;
1017710177
case 'E':
1017810178
subvolid = arg_strtou64(optarg);
@@ -10192,22 +10192,22 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv)
1019210192
ctree_flags |= OPEN_CTREE_WRITES;
1019310193
break;
1019410194
case GETOPT_VAL_READONLY:
10195-
readonly = 1;
10195+
readonly = true;
1019610196
break;
1019710197
case GETOPT_VAL_INIT_CSUM:
1019810198
printf("Creating a new CRC tree\n");
10199-
init_csum_tree = 1;
10199+
init_csum_tree = true;
1020010200
opt_check_repair = 1;
1020110201
ctree_flags |= OPEN_CTREE_WRITES;
1020210202
break;
1020310203
case GETOPT_VAL_INIT_EXTENT:
10204-
init_extent_tree = 1;
10204+
init_extent_tree = true;
1020510205
ctree_flags |= (OPEN_CTREE_WRITES |
1020610206
OPEN_CTREE_NO_BLOCK_GROUPS);
1020710207
opt_check_repair = 1;
1020810208
break;
1020910209
case GETOPT_VAL_CHECK_CSUM:
10210-
check_data_csum = 1;
10210+
check_data_csum = true;
1021110211
break;
1021210212
case GETOPT_VAL_MODE:
1021310213
check_mode = parse_check_mode(optarg);
@@ -10230,7 +10230,7 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv)
1023010230
ctree_flags |= OPEN_CTREE_WRITES;
1023110231
break;
1023210232
case GETOPT_VAL_FORCE:
10233-
force = 1;
10233+
force = true;
1023410234
break;
1023510235
case '?':
1023610236
case 'h':

check/mode-common.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ extern u64 data_bytes_allocated;
8080
extern u64 data_bytes_referenced;
8181
extern struct list_head duplicate_extents;
8282
extern struct list_head delete_items;
83-
extern int no_holes;
84-
extern int init_extent_tree;
85-
extern int check_data_csum;
83+
extern bool no_holes;
84+
extern bool init_extent_tree;
85+
extern bool check_data_csum;
8686
extern struct btrfs_fs_info *gfs_info;
8787
extern struct cache_tree *roots_info_cache;
8888

0 commit comments

Comments
 (0)