/* Verify disk blocks with GETFSMAP */
-struct xfs_verify_extent {
+struct media_verify_state {
struct read_verify_pool *rvp_data;
struct read_verify_pool *rvp_log;
struct read_verify_pool *rvp_realtime;
static struct read_verify_pool *
xfs_dev_to_pool(
struct scrub_ctx *ctx,
- struct xfs_verify_extent *ve,
+ struct media_verify_state *vs,
dev_t dev)
{
if (dev == ctx->fsinfo.fs_datadev)
- return ve->rvp_data;
+ return vs->rvp_data;
else if (dev == ctx->fsinfo.fs_logdev)
- return ve->rvp_log;
+ return vs->rvp_log;
else if (dev == ctx->fsinfo.fs_rtdev)
- return ve->rvp_realtime;
+ return vs->rvp_realtime;
abort();
}
{
struct fsmap keys[2];
char descr[DESCR_BUFSZ];
- struct xfs_verify_extent *ve = arg;
+ struct media_verify_state *vs = arg;
struct bitmap *tree;
dev_t dev;
bool moveon;
* later rescanning.
*/
if (dev == ctx->fsinfo.fs_datadev)
- tree = ve->d_bad;
+ tree = vs->d_bad;
else if (dev == ctx->fsinfo.fs_rtdev)
- tree = ve->r_bad;
+ tree = vs->r_bad;
else
tree = NULL;
if (tree) {
struct fsmap *map,
void *arg)
{
- struct xfs_verify_extent *ve = arg;
+ struct media_verify_state *vs = arg;
struct read_verify_pool *rvp;
- rvp = xfs_dev_to_pool(ctx, ve, map->fmr_device);
+ rvp = xfs_dev_to_pool(ctx, vs, map->fmr_device);
dbg_printf("rmap dev %d:%d phys %"PRIu64" owner %"PRId64
" offset %"PRIu64" len %"PRIu64" flags 0x%x\n",
/* XXX: Filter out directory data blocks. */
/* Schedule the read verify command for (eventual) running. */
- read_verify_schedule_io(rvp, map->fmr_physical, map->fmr_length, ve);
+ read_verify_schedule_io(rvp, map->fmr_physical, map->fmr_length, vs);
out:
/* Is this the last extent? Fire off the read. */
xfs_scan_blocks(
struct scrub_ctx *ctx)
{
- struct xfs_verify_extent ve = { NULL };
+ struct media_verify_state vs = { NULL };
bool moveon;
- moveon = bitmap_init(&ve.d_bad);
+ moveon = bitmap_init(&vs.d_bad);
if (!moveon) {
str_errno(ctx, ctx->mntpoint);
goto out;
}
- moveon = bitmap_init(&ve.r_bad);
+ moveon = bitmap_init(&vs.r_bad);
if (!moveon) {
str_errno(ctx, ctx->mntpoint);
goto out_dbad;
}
- ve.rvp_data = read_verify_pool_init(ctx, ctx->datadev,
+ vs.rvp_data = read_verify_pool_init(ctx, ctx->datadev,
ctx->geo.blocksize, xfs_check_rmap_ioerr,
scrub_nproc(ctx));
- if (!ve.rvp_data) {
+ if (!vs.rvp_data) {
moveon = false;
str_info(ctx, ctx->mntpoint,
_("Could not create data device media verifier."));
goto out_rbad;
}
if (ctx->logdev) {
- ve.rvp_log = read_verify_pool_init(ctx, ctx->logdev,
+ vs.rvp_log = read_verify_pool_init(ctx, ctx->logdev,
ctx->geo.blocksize, xfs_check_rmap_ioerr,
scrub_nproc(ctx));
- if (!ve.rvp_log) {
+ if (!vs.rvp_log) {
moveon = false;
str_info(ctx, ctx->mntpoint,
_("Could not create log device media verifier."));
}
}
if (ctx->rtdev) {
- ve.rvp_realtime = read_verify_pool_init(ctx, ctx->rtdev,
+ vs.rvp_realtime = read_verify_pool_init(ctx, ctx->rtdev,
ctx->geo.blocksize, xfs_check_rmap_ioerr,
scrub_nproc(ctx));
- if (!ve.rvp_realtime) {
+ if (!vs.rvp_realtime) {
moveon = false;
str_info(ctx, ctx->mntpoint,
_("Could not create realtime device media verifier."));
goto out_logpool;
}
}
- moveon = xfs_scan_all_spacemaps(ctx, xfs_check_rmap, &ve);
+ moveon = xfs_scan_all_spacemaps(ctx, xfs_check_rmap, &vs);
if (!moveon)
goto out_rtpool;
- ctx->bytes_checked += clean_pool(ve.rvp_data);
- ctx->bytes_checked += clean_pool(ve.rvp_log);
- ctx->bytes_checked += clean_pool(ve.rvp_realtime);
+ ctx->bytes_checked += clean_pool(vs.rvp_data);
+ ctx->bytes_checked += clean_pool(vs.rvp_log);
+ ctx->bytes_checked += clean_pool(vs.rvp_realtime);
/* Scan the whole dir tree to see what matches the bad extents. */
- if (!bitmap_empty(ve.d_bad) || !bitmap_empty(ve.r_bad))
- moveon = xfs_report_verify_errors(ctx, ve.d_bad, ve.r_bad);
+ if (!bitmap_empty(vs.d_bad) || !bitmap_empty(vs.r_bad))
+ moveon = xfs_report_verify_errors(ctx, vs.d_bad, vs.r_bad);
- bitmap_free(&ve.r_bad);
- bitmap_free(&ve.d_bad);
+ bitmap_free(&vs.r_bad);
+ bitmap_free(&vs.d_bad);
return moveon;
out_rtpool:
- if (ve.rvp_realtime)
- read_verify_pool_destroy(ve.rvp_realtime);
+ if (vs.rvp_realtime)
+ read_verify_pool_destroy(vs.rvp_realtime);
out_logpool:
- if (ve.rvp_log)
- read_verify_pool_destroy(ve.rvp_log);
+ if (vs.rvp_log)
+ read_verify_pool_destroy(vs.rvp_log);
out_datapool:
- read_verify_pool_destroy(ve.rvp_data);
+ read_verify_pool_destroy(vs.rvp_data);
out_rbad:
- bitmap_free(&ve.r_bad);
+ bitmap_free(&vs.r_bad);
out_dbad:
- bitmap_free(&ve.d_bad);
+ bitmap_free(&vs.d_bad);
out:
return moveon;
}