From c027c1353145f521999963c218682c42475cd97a Mon Sep 17 00:00:00 2001 From: David Sterba Date: Tue, 6 Sep 2016 15:30:31 +0200 Subject: [PATCH] btrfs-progs: remove trivial helpers for filtering functions Signed-off-by: David Sterba --- btrfs-list.c | 10 ---------- btrfs-list.h | 2 -- cmds-qgroup.c | 4 ++-- cmds-subvolume.c | 8 ++++---- qgroup.c | 14 ++------------ qgroup.h | 2 -- 6 files changed, 8 insertions(+), 32 deletions(-) diff --git a/btrfs-list.c b/btrfs-list.c index b9d82e42..563845dc 100644 --- a/btrfs-list.c +++ b/btrfs-list.c @@ -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) { diff --git a/btrfs-list.h b/btrfs-list.h index 13f44c3a..d8ad7328 100644 --- a/btrfs-list.h +++ b/btrfs-list.h @@ -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, diff --git a/cmds-qgroup.c b/cmds-qgroup.c index a3bc939a..98149410 100644 --- a/cmds-qgroup.c +++ b/cmds-qgroup.c @@ -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; } diff --git a/cmds-subvolume.c b/cmds-subvolume.c index b3f7cbcb..bcfe5edc 100644 --- a/cmds-subvolume.c +++ b/cmds-subvolume.c @@ -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); diff --git a/qgroup.c b/qgroup.c index 6a6cdd9e..20cf1ea6 100644 --- a/qgroup.c +++ b/qgroup.c @@ -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; } diff --git a/qgroup.h b/qgroup.h index 5886fc33..7b42d833 100644 --- a/qgroup.h +++ b/qgroup.h @@ -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);