uuidbuf);
ret = qgroup_verify_all(info);
if (ret == 0)
- print_qgroup_report(1);
+ ret = report_qgroups(1);
goto close_out;
}
if (subvolid) {
ret = 1;
}
out:
- print_qgroup_report(0);
+ /* Don't override original ret */
+ if (ret)
+ report_qgroups(0);
+ else
+ ret = report_qgroups(0);
if (found_old_backref) { /*
* there was a disk format change when mixed
* backref was in testing tree. The old format
prefix, type, bytes, type, bytes_compressed);
}
-static void print_qgroup_difference(struct qgroup_count *count, int verbose)
+static int report_qgroup_difference(struct qgroup_count *count, int verbose)
{
int is_different;
struct qgroup_info *info = &count->info;
print_fields_signed(excl_diff, excl_diff,
"diff:", "exclusive");
}
+ return (is_different && count->subvol_exists);
}
-void print_qgroup_report(int all)
+int report_qgroups(int all)
{
struct rb_node *node;
struct qgroup_count *c;
+ int ret = 0;
node = rb_first(&counts.root);
while (node) {
c = rb_entry(node, struct qgroup_count, rb_node);
- print_qgroup_difference(c, all);
+ ret |= report_qgroup_difference(c, all);
node = rb_next(node);
}
+ return ret;
}
int qgroup_verify_all(struct btrfs_fs_info *info)
#include "ctree.h"
int qgroup_verify_all(struct btrfs_fs_info *info);
-void print_qgroup_report(int all);
+int report_qgroups(int all);
int print_extent_state(struct btrfs_fs_info *info, u64 subvol);