btrfs-progs: remove trivial helpers for filtering functions

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2016-09-06 15:30:31 +02:00
parent 8a167ec579
commit c027c13531
6 changed files with 8 additions and 32 deletions

View File

@ -237,11 +237,6 @@ struct btrfs_list_comparer_set *btrfs_list_alloc_comparer_set(void)
return set;
}
void btrfs_list_free_comparer_set(struct btrfs_list_comparer_set *comp_set)
{
free(comp_set);
}
static int btrfs_list_setup_comparer(struct btrfs_list_comparer_set **comp_set,
enum btrfs_list_comp_enum comparer, int is_descending)
{
@ -1209,11 +1204,6 @@ struct btrfs_list_filter_set *btrfs_list_alloc_filter_set(void)
return set;
}
void btrfs_list_free_filter_set(struct btrfs_list_filter_set *filter_set)
{
free(filter_set);
}
int btrfs_list_setup_filter(struct btrfs_list_filter_set **filter_set,
enum btrfs_list_filter_enum filter, u64 data)
{

View File

@ -160,11 +160,9 @@ int btrfs_list_parse_filter_string(char *optarg,
enum btrfs_list_filter_enum type);
void btrfs_list_setup_print_column(enum btrfs_list_column_enum column);
struct btrfs_list_filter_set *btrfs_list_alloc_filter_set(void);
void btrfs_list_free_filter_set(struct btrfs_list_filter_set *filter_set);
int btrfs_list_setup_filter(struct btrfs_list_filter_set **filter_set,
enum btrfs_list_filter_enum filter, u64 data);
struct btrfs_list_comparer_set *btrfs_list_alloc_comparer_set(void);
void btrfs_list_free_comparer_set(struct btrfs_list_comparer_set *comp_set);
int btrfs_list_subvols_print(int fd, struct btrfs_list_filter_set *filter_set,
struct btrfs_list_comparer_set *comp_set,

View File

@ -360,8 +360,8 @@ static int cmd_qgroup_show(int argc, char **argv)
path = argv[optind];
fd = btrfs_open_dir(path, &dirstream, 1);
if (fd < 0) {
btrfs_qgroup_free_filter_set(filter_set);
btrfs_qgroup_free_comparer_set(comparer_set);
free(filter_set);
free(comparer_set);
return 1;
}

View File

@ -580,9 +580,9 @@ static int cmd_subvol_list(int argc, char **argv)
out:
close_file_or_dir(fd, dirstream);
if (filter_set)
btrfs_list_free_filter_set(filter_set);
free(filter_set);
if (comparer_set)
btrfs_list_free_comparer_set(comparer_set);
free(comparer_set);
if (uerr)
usage(cmd_subvol_list_usage);
return !!ret;
@ -803,7 +803,7 @@ static int cmd_subvol_get_default(int argc, char **argv)
BTRFS_LIST_LAYOUT_DEFAULT, 1, NULL);
if (filter_set)
btrfs_list_free_filter_set(filter_set);
free(filter_set);
out:
close_file_or_dir(fd, dirstream);
return !!ret;
@ -1011,7 +1011,7 @@ out:
free(get_ri.path);
free(get_ri.name);
free(get_ri.full_path);
btrfs_list_free_filter_set(filter_set);
free(filter_set);
close_file_or_dir(fd, dirstream1);
free(fullpath);

View File

@ -448,11 +448,6 @@ struct btrfs_qgroup_comparer_set *btrfs_qgroup_alloc_comparer_set(void)
return set;
}
void btrfs_qgroup_free_comparer_set(struct btrfs_qgroup_comparer_set *comp_set)
{
free(comp_set);
}
int btrfs_qgroup_setup_comparer(struct btrfs_qgroup_comparer_set **comp_set,
enum btrfs_qgroup_comp_enum comparer,
int is_descending)
@ -822,11 +817,6 @@ struct btrfs_qgroup_filter_set *btrfs_qgroup_alloc_filter_set(void)
return set;
}
void btrfs_qgroup_free_filter_set(struct btrfs_qgroup_filter_set *filter_set)
{
free(filter_set);
}
int btrfs_qgroup_setup_filter(struct btrfs_qgroup_filter_set **filter_set,
enum btrfs_qgroup_filter_enum filter, u64 data)
{
@ -1218,8 +1208,8 @@ int btrfs_show_qgroups(int fd,
print_all_qgroups(&sort_tree);
__free_all_qgroups(&qgroup_lookup);
btrfs_qgroup_free_filter_set(filter_set);
btrfs_qgroup_free_comparer_set(comp_set);
free(filter_set);
free(comp_set);
return ret;
}

View File

@ -85,11 +85,9 @@ int btrfs_show_qgroups(int fd, struct btrfs_qgroup_filter_set *,
void btrfs_qgroup_setup_print_column(enum btrfs_qgroup_column_enum column);
void btrfs_qgroup_setup_units(unsigned unit_mode);
struct btrfs_qgroup_filter_set *btrfs_qgroup_alloc_filter_set(void);
void btrfs_qgroup_free_filter_set(struct btrfs_qgroup_filter_set *filter_set);
int btrfs_qgroup_setup_filter(struct btrfs_qgroup_filter_set **filter_set,
enum btrfs_qgroup_filter_enum, u64 data);
struct btrfs_qgroup_comparer_set *btrfs_qgroup_alloc_comparer_set(void);
void btrfs_qgroup_free_comparer_set(struct btrfs_qgroup_comparer_set *comp_set);
int btrfs_qgroup_setup_comparer(struct btrfs_qgroup_comparer_set **comp_set,
enum btrfs_qgroup_comp_enum comparer,
int is_descending);