unsigned int *nr_threads,
int *rshift)
{
- *items = scrub_estimate_ag_work(ctx);
+ *items = scrub_estimate_group_work(ctx);
*nr_threads = scrub_nproc(ctx);
*rshift = 0;
return 0;
return 0;
}
-/* How many items do we have to check? */
+/* How many items do we have to check for per-AG and per-rtgroup work? */
unsigned int
-scrub_estimate_ag_work(
+scrub_estimate_group_work(
struct scrub_ctx *ctx)
{
const struct xfrog_scrub_descr *sc;
case XFROG_SCRUB_GROUP_FS:
estimate++;
break;
+ case XFROG_SCRUB_GROUP_RTGROUP:
+ /*
+ * rtbitmap and rtsummary exist on non-rt/non-rtgroup
+ * filesystems, but we schedule the other rtgroup
+ * metadata for scanning (even if it won't do
+ * anything), so we must include those in the
+ * estimation as well.
+ */
+ estimate += max(1, ctx->mnt.fsgeom.rgcount);
+ break;
default:
break;
}
}
+
return estimate;
}
int phase8_func(struct scrub_ctx *ctx);
/* Progress estimator functions */
-unsigned int scrub_estimate_ag_work(struct scrub_ctx *ctx);
+unsigned int scrub_estimate_group_work(struct scrub_ctx *ctx);
unsigned int scrub_estimate_iscan_work(struct scrub_ctx *ctx);
int phase2_estimate(struct scrub_ctx *ctx, uint64_t *items,
unsigned int *nr_threads, int *rshift);