btrfs-progs: check: use bool for option status variables
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
f742e237e8
commit
ed21179c98
30
check/main.c
30
check/main.c
|
@ -81,10 +81,10 @@ u64 data_bytes_allocated = 0;
|
||||||
u64 data_bytes_referenced = 0;
|
u64 data_bytes_referenced = 0;
|
||||||
LIST_HEAD(duplicate_extents);
|
LIST_HEAD(duplicate_extents);
|
||||||
LIST_HEAD(delete_items);
|
LIST_HEAD(delete_items);
|
||||||
int no_holes = 0;
|
bool no_holes = false;
|
||||||
static int is_free_space_tree = 0;
|
bool is_free_space_tree = false;
|
||||||
int init_extent_tree = 0;
|
bool init_extent_tree = false;
|
||||||
int check_data_csum = 0;
|
bool check_data_csum = false;
|
||||||
struct cache_tree *roots_info_cache = NULL;
|
struct cache_tree *roots_info_cache = NULL;
|
||||||
|
|
||||||
enum btrfs_check_mode {
|
enum btrfs_check_mode {
|
||||||
|
@ -6004,7 +6004,7 @@ static int check_csum_root(struct btrfs_root *root)
|
||||||
int ret;
|
int ret;
|
||||||
u64 data_len;
|
u64 data_len;
|
||||||
unsigned long leaf_offset;
|
unsigned long leaf_offset;
|
||||||
bool verify_csum = !!check_data_csum;
|
bool verify_csum = check_data_csum;
|
||||||
u16 num_entries, max_entries;
|
u16 num_entries, max_entries;
|
||||||
|
|
||||||
max_entries = ((BTRFS_LEAF_DATA_SIZE(gfs_info) -
|
max_entries = ((BTRFS_LEAF_DATA_SIZE(gfs_info) -
|
||||||
|
@ -10110,16 +10110,16 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv)
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
u64 num;
|
u64 num;
|
||||||
int init_csum_tree = 0;
|
bool init_csum_tree = false;
|
||||||
int readonly = 0;
|
bool readonly = false;
|
||||||
|
bool qgroup_report = false;
|
||||||
|
bool force = false;
|
||||||
int clear_space_cache = 0;
|
int clear_space_cache = 0;
|
||||||
int qgroup_report = 0;
|
|
||||||
int qgroups_repaired = 0;
|
int qgroups_repaired = 0;
|
||||||
int qgroup_verify_ret;
|
int qgroup_verify_ret;
|
||||||
unsigned ctree_flags = OPEN_CTREE_EXCLUSIVE |
|
unsigned ctree_flags = OPEN_CTREE_EXCLUSIVE |
|
||||||
OPEN_CTREE_ALLOW_TRANSID_MISMATCH |
|
OPEN_CTREE_ALLOW_TRANSID_MISMATCH |
|
||||||
OPEN_CTREE_SKIP_LEAF_ITEM_CHECKS;
|
OPEN_CTREE_SKIP_LEAF_ITEM_CHECKS;
|
||||||
int force = 0;
|
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
int c;
|
int c;
|
||||||
|
@ -10175,7 +10175,7 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv)
|
||||||
printf("using SB copy %llu, bytenr %llu\n", num, bytenr);
|
printf("using SB copy %llu, bytenr %llu\n", num, bytenr);
|
||||||
break;
|
break;
|
||||||
case 'Q':
|
case 'Q':
|
||||||
qgroup_report = 1;
|
qgroup_report = true;
|
||||||
break;
|
break;
|
||||||
case 'E':
|
case 'E':
|
||||||
subvolid = arg_strtou64(optarg);
|
subvolid = arg_strtou64(optarg);
|
||||||
|
@ -10195,22 +10195,22 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv)
|
||||||
ctree_flags |= OPEN_CTREE_WRITES;
|
ctree_flags |= OPEN_CTREE_WRITES;
|
||||||
break;
|
break;
|
||||||
case GETOPT_VAL_READONLY:
|
case GETOPT_VAL_READONLY:
|
||||||
readonly = 1;
|
readonly = true;
|
||||||
break;
|
break;
|
||||||
case GETOPT_VAL_INIT_CSUM:
|
case GETOPT_VAL_INIT_CSUM:
|
||||||
printf("Creating a new CRC tree\n");
|
printf("Creating a new CRC tree\n");
|
||||||
init_csum_tree = 1;
|
init_csum_tree = true;
|
||||||
opt_check_repair = 1;
|
opt_check_repair = 1;
|
||||||
ctree_flags |= OPEN_CTREE_WRITES;
|
ctree_flags |= OPEN_CTREE_WRITES;
|
||||||
break;
|
break;
|
||||||
case GETOPT_VAL_INIT_EXTENT:
|
case GETOPT_VAL_INIT_EXTENT:
|
||||||
init_extent_tree = 1;
|
init_extent_tree = true;
|
||||||
ctree_flags |= (OPEN_CTREE_WRITES |
|
ctree_flags |= (OPEN_CTREE_WRITES |
|
||||||
OPEN_CTREE_NO_BLOCK_GROUPS);
|
OPEN_CTREE_NO_BLOCK_GROUPS);
|
||||||
opt_check_repair = 1;
|
opt_check_repair = 1;
|
||||||
break;
|
break;
|
||||||
case GETOPT_VAL_CHECK_CSUM:
|
case GETOPT_VAL_CHECK_CSUM:
|
||||||
check_data_csum = 1;
|
check_data_csum = true;
|
||||||
break;
|
break;
|
||||||
case GETOPT_VAL_MODE:
|
case GETOPT_VAL_MODE:
|
||||||
check_mode = parse_check_mode(optarg);
|
check_mode = parse_check_mode(optarg);
|
||||||
|
@ -10237,7 +10237,7 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv)
|
||||||
exit(1);
|
exit(1);
|
||||||
break;
|
break;
|
||||||
case GETOPT_VAL_FORCE:
|
case GETOPT_VAL_FORCE:
|
||||||
force = 1;
|
force = true;
|
||||||
break;
|
break;
|
||||||
case '?':
|
case '?':
|
||||||
case 'h':
|
case 'h':
|
||||||
|
|
|
@ -80,9 +80,9 @@ extern u64 data_bytes_allocated;
|
||||||
extern u64 data_bytes_referenced;
|
extern u64 data_bytes_referenced;
|
||||||
extern struct list_head duplicate_extents;
|
extern struct list_head duplicate_extents;
|
||||||
extern struct list_head delete_items;
|
extern struct list_head delete_items;
|
||||||
extern int no_holes;
|
extern bool no_holes;
|
||||||
extern int init_extent_tree;
|
extern bool init_extent_tree;
|
||||||
extern int check_data_csum;
|
extern bool check_data_csum;
|
||||||
extern struct btrfs_fs_info *gfs_info;
|
extern struct btrfs_fs_info *gfs_info;
|
||||||
extern struct cache_tree *roots_info_cache;
|
extern struct cache_tree *roots_info_cache;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue