/* * Copyright (C) 2012 STRATO. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 021110-1307, USA. */#ifndef __BTRFS_QGROUP_H__#define __BTRFS_QGROUP_H__#include"kerncompat.h"#include"ioctl.h"structbtrfs_qgroup;typedefint(*btrfs_qgroup_filter_func)(structbtrfs_qgroup*,u64);typedefint(*btrfs_qgroup_comp_func)(structbtrfs_qgroup*,structbtrfs_qgroup*,int);structbtrfs_qgroup_filter{btrfs_qgroup_filter_funcfilter_func;u64data;};structbtrfs_qgroup_comparer{btrfs_qgroup_comp_funccomp_func;intis_descending;};structbtrfs_qgroup_filter_set{inttotal;intnfilters;structbtrfs_qgroup_filterfilters[0];};structbtrfs_qgroup_comparer_set{inttotal;intncomps;structbtrfs_qgroup_comparercomps[0];};enumbtrfs_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,};enumbtrfs_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};enumbtrfs_qgroup_filter_enum{BTRFS_QGROUP_FILTER_PARENT,BTRFS_QGROUP_FILTER_ALL_PARENT,BTRFS_QGROUP_FILTER_MAX,};intbtrfs_qgroup_parse_sort_string(constchar*opt_arg,structbtrfs_qgroup_comparer_set**comps);intbtrfs_show_qgroups(intfd,structbtrfs_qgroup_filter_set*,structbtrfs_qgroup_comparer_set*);voidbtrfs_qgroup_setup_print_column(enumbtrfs_qgroup_column_enumcolumn);voidbtrfs_qgroup_setup_units(unsignedunit_mode);structbtrfs_qgroup_filter_set*btrfs_qgroup_alloc_filter_set(void);intbtrfs_qgroup_setup_filter(structbtrfs_qgroup_filter_set**filter_set,enumbtrfs_qgroup_filter_enum,u64data);structbtrfs_qgroup_comparer_set*btrfs_qgroup_alloc_comparer_set(void);intbtrfs_qgroup_setup_comparer(structbtrfs_qgroup_comparer_set**comp_set,enumbtrfs_qgroup_comp_enumcomparer,intis_descending);intqgroup_inherit_size(structbtrfs_qgroup_inherit*p);intqgroup_inherit_add_group(structbtrfs_qgroup_inherit**inherit,char*arg);intqgroup_inherit_add_copy(structbtrfs_qgroup_inherit**inherit,char*arg,inttype);#endif