|author||Mark Fasheh <email@example.com>||2014-05-07 13:07:17 -0700|
|committer||David Sterba <firstname.lastname@example.org>||2014-08-22 14:39:33 +0200|
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 <email@example.com> Signed-off-by: David Sterba <firstname.lastname@example.org>
Diffstat (limited to 'qgroup-verify.h')
1 files changed, 25 insertions, 0 deletions
diff --git a/qgroup-verify.h b/qgroup-verify.h
new file mode 100644
@@ -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.
+int qgroup_verify_all(struct btrfs_fs_info *info);
+void print_qgroup_report(int all);
+#endif /* _BTRFS_QGROUP_VERIFY_H */