#include "common.h"
#include "disk.h"
#include "scrub.h"
+#include "repair.h"
/* Phase 1: Find filesystem geometry (and clean up after) */
{
int error;
+ xfs_action_lists_free(&ctx->action_lists);
if (ctx->fshandle)
free_handle(ctx->fshandle, ctx->fshandle_len);
if (ctx->rtdev)
return false;
}
- ctx->nr_io_threads = nproc;
- if (verbose) {
- fprintf(stdout, _("%s: using %d threads to scrub.\n"),
- ctx->mntpoint, scrub_nproc(ctx));
- fflush(stdout);
- }
-
if (!platform_test_xfs_fd(ctx->mnt_fd)) {
str_info(ctx, ctx->mntpoint,
_("Does not appear to be an XFS filesystem!"));
return false;
}
+ if (!xfs_action_lists_alloc(ctx->geo.agcount, &ctx->action_lists)) {
+ str_error(ctx, ctx->mntpoint, _("Not enough memory."));
+ return false;
+ }
+
ctx->agblklog = log2_roundup(ctx->geo.agblocks);
ctx->blocklog = highbit32(ctx->geo.blocksize);
ctx->inodelog = highbit32(ctx->geo.inodesize);
return false;
}
+ ctx->nr_io_threads = disk_heads(ctx->datadev);
+ if (verbose) {
+ fprintf(stdout, _("%s: using %d threads to scrub.\n"),
+ ctx->mntpoint, scrub_nproc(ctx));
+ fflush(stdout);
+ }
+
if (ctx->fsinfo.fs_log) {
ctx->logdev = disk_open(ctx->fsinfo.fs_log);
if (error) {