btrfs-progs: move all private definitions to cmds/qgroup.c

Move everything related to the output formatting and filtering out of
qgroup.h and leave only the structures used by the public API.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2021-09-07 19:21:14 +02:00
parent f67e5da2fa
commit c1953c36dd
2 changed files with 52 additions and 55 deletions

View File

@ -77,6 +77,58 @@ struct btrfs_qgroup {
struct list_head members;
};
typedef int (*btrfs_qgroup_filter_func)(struct btrfs_qgroup *, u64);
typedef int (*btrfs_qgroup_comp_func)(struct btrfs_qgroup *,
struct btrfs_qgroup *, int);
struct btrfs_qgroup_filter {
btrfs_qgroup_filter_func filter_func;
u64 data;
};
struct btrfs_qgroup_comparer {
btrfs_qgroup_comp_func comp_func;
int is_descending;
};
struct btrfs_qgroup_filter_set {
int total;
int nfilters;
struct btrfs_qgroup_filter filters[0];
};
struct btrfs_qgroup_comparer_set {
int total;
int ncomps;
struct btrfs_qgroup_comparer comps[0];
};
enum btrfs_qgroup_column_enum {
BTRFS_QGROUP_QGROUPID,
BTRFS_QGROUP_RFER,
BTRFS_QGROUP_EXCL,
BTRFS_QGROUP_MAX_RFER,
BTRFS_QGROUP_MAX_EXCL,
BTRFS_QGROUP_PARENT,
BTRFS_QGROUP_CHILD,
BTRFS_QGROUP_ALL,
};
enum btrfs_qgroup_comp_enum {
BTRFS_QGROUP_COMP_QGROUPID,
BTRFS_QGROUP_COMP_RFER,
BTRFS_QGROUP_COMP_EXCL,
BTRFS_QGROUP_COMP_MAX_RFER,
BTRFS_QGROUP_COMP_MAX_EXCL,
BTRFS_QGROUP_COMP_MAX
};
enum btrfs_qgroup_filter_enum {
BTRFS_QGROUP_FILTER_PARENT,
BTRFS_QGROUP_FILTER_ALL_PARENT,
BTRFS_QGROUP_FILTER_MAX,
};
/*
* qgroupid,rfer,excl default to set
*/

View File

@ -22,61 +22,6 @@
#include "kerncompat.h"
#include "ioctl.h"
struct btrfs_qgroup;
typedef int (*btrfs_qgroup_filter_func)(struct btrfs_qgroup *, u64);
typedef int (*btrfs_qgroup_comp_func)(struct btrfs_qgroup *,
struct btrfs_qgroup *, int);
struct btrfs_qgroup_filter {
btrfs_qgroup_filter_func filter_func;
u64 data;
};
struct btrfs_qgroup_comparer {
btrfs_qgroup_comp_func comp_func;
int is_descending;
};
struct btrfs_qgroup_filter_set {
int total;
int nfilters;
struct btrfs_qgroup_filter filters[0];
};
struct btrfs_qgroup_comparer_set {
int total;
int ncomps;
struct btrfs_qgroup_comparer comps[0];
};
enum btrfs_qgroup_column_enum {
BTRFS_QGROUP_QGROUPID,
BTRFS_QGROUP_RFER,
BTRFS_QGROUP_EXCL,
BTRFS_QGROUP_MAX_RFER,
BTRFS_QGROUP_MAX_EXCL,
BTRFS_QGROUP_PARENT,
BTRFS_QGROUP_CHILD,
BTRFS_QGROUP_ALL,
};
enum btrfs_qgroup_comp_enum {
BTRFS_QGROUP_COMP_QGROUPID,
BTRFS_QGROUP_COMP_RFER,
BTRFS_QGROUP_COMP_EXCL,
BTRFS_QGROUP_COMP_MAX_RFER,
BTRFS_QGROUP_COMP_MAX_EXCL,
BTRFS_QGROUP_COMP_MAX
};
enum btrfs_qgroup_filter_enum {
BTRFS_QGROUP_FILTER_PARENT,
BTRFS_QGROUP_FILTER_ALL_PARENT,
BTRFS_QGROUP_FILTER_MAX,
};
struct btrfs_qgroup_info {
u64 generation;
u64 referenced;