@@ -1181,6 +1181,17 @@ void btrfs_list_free_filter_set(struct btrfs_list_filter_set *filter_set)
free(filter_set);
}
+int btrfs_list_is_filter_set(struct btrfs_list_filter_set *fset,
+ enum btrfs_list_filter_enum filter)
+{
+ int i;
+ for (i=0; i < fset->nfilters; i++) {
+ if (fset->filters[i].filter_func == all_filter_funcs[filter])
+ return i;
+ }
+ return -1;
+}
+
int btrfs_list_setup_filter(struct btrfs_list_filter_set **filter_set,
enum btrfs_list_filter_enum filter, u64 data)
{
@@ -153,3 +153,5 @@ int btrfs_list_get_default_subvolume(int fd, u64 *default_id);
char *btrfs_list_path_for_root(int fd, u64 root);
u64 btrfs_list_get_path_rootid(int fd);
int btrfs_get_a_subvol(int fd, struct root_info *the_ri);
+int btrfs_list_is_filter_set(struct btrfs_list_filter_set *fset,
+ enum btrfs_list_filter_enum filter);