summaryrefslogtreecommitdiff
path: root/qgroup-verify.h
diff options
context:
space:
mode:
authorMark Fasheh <mfasheh@suse.de>2014-05-07 13:07:17 -0700
committerDavid Sterba <dsterba@suse.cz>2014-08-22 14:39:33 +0200
commit96ec888aad41969d728ba62c1778d6e8ebe6bd4e (patch)
tree413ea722f864ba14714ad47a57e479e29ce6d848 /qgroup-verify.h
parent2ab405af95d43972b57c7806981220a6949df643 (diff)
btrfs-progs: add quota group verify code
This patch adds functionality (in qgroup-verify.c) to compute bytecounts in subvolume quota groups. The original groups are read in and stored in memory so that after we compute our own bytecounts, we can compare them with those on disk. A print function is provided to do this comparison and show the results on the console. A 'qgroup check' pass is added to btrfsck. If any subvolume quota groups differ from what we compute, the differences for them are printed. We also provide an option '--qgroup-report' which will run only the quota check code and print a report on all quota groups. Other than making it possible to verify that our qgroup changes work correctly, this mode can also be used in xfstests for automated checking after qgroup tests. This patch does not address the following: - compressed counts are identical to non compressed, because kernel doesn't make the distinction yet. Adding the code to verify compressed counts shouldn't be hard at all though once kernel can do this. - It is only concerned with subvolume quota groups (like most of btrfs-progs). Signed-off-by: Mark Fasheh <mfasheh@suse.de> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'qgroup-verify.h')
-rw-r--r--qgroup-verify.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/qgroup-verify.h b/qgroup-verify.h
new file mode 100644
index 00000000..a222c175
--- /dev/null
+++ b/qgroup-verify.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2014 SUSE. 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_VERIFY_H
+#define _BTRFS_QGROUP_VERIFY_H
+
+int qgroup_verify_all(struct btrfs_fs_info *info);
+void print_qgroup_report(int all);
+
+#endif /* _BTRFS_QGROUP_VERIFY_H */