return retval;
}
-static int e2fsck_pass1_threads_join(struct e2fsck_thread_info *infos,
- e2fsck_t global_ctx)
+static int e2fsck_pass1_threads_join(e2fsck_t global_ctx)
{
errcode_t rc;
errcode_t ret = 0;
+ struct e2fsck_thread_info *infos = global_ctx->infos;
struct e2fsck_thread_info *pinfo;
int num_threads = global_ctx->pfs_num_threads;
int i;
}
}
free(infos);
+ global_ctx->infos = NULL;
return ret;
}
#endif
}
-static int e2fsck_pass1_threads_start(struct e2fsck_thread_info **pinfo,
- e2fsck_t global_ctx)
+static int e2fsck_pass1_threads_start(e2fsck_t global_ctx)
{
struct e2fsck_thread_info *infos;
pthread_attr_t attr;
pthread_attr_destroy(&attr);
return retval;
}
+ global_ctx->infos = infos;
average_group = ext2fs_get_avg_group(global_ctx->fs);
for (i = 0; i < num_threads; i++) {
}
if (retval) {
- e2fsck_pass1_threads_join(infos, global_ctx);
+ e2fsck_pass1_threads_join(global_ctx);
return retval;
}
- *pinfo = infos;
return 0;
}
static void e2fsck_pass1_multithread(e2fsck_t global_ctx)
{
- struct e2fsck_thread_info *infos = NULL;
errcode_t retval;
- retval = e2fsck_pass1_threads_start(&infos, global_ctx);
+ retval = e2fsck_pass1_threads_start(global_ctx);
if (retval) {
com_err(global_ctx->program_name, retval,
_("while starting pass1 threads\n"));
goto out_abort;
}
- retval = e2fsck_pass1_threads_join(infos, global_ctx);
+ retval = e2fsck_pass1_threads_join(global_ctx);
if (retval) {
com_err(global_ctx->program_name, retval,
_("while joining pass1 threads\n"));
{
struct scan_callback_struct *scan_struct;
e2fsck_t ctx;
+ dgrp_t cur = group + 1;
struct e2fsck_thread *tinfo;
+ struct e2fsck_thread_info *pinfo, *infos;
+ int i;
scan_struct = (struct scan_callback_struct *) priv_data;
ctx = scan_struct->ctx;
scan_struct->inodes_to_process,
scan_struct->process_inode_count);
+#ifdef HAVE_PTHREAD
+ if (ctx->global_ctx) {
+ cur = 0;
+ infos = ctx->global_ctx->infos;
+ for (i = 0; i < ctx->global_ctx->pfs_num_threads; i++) {
+ pinfo = &infos[i];
+
+ if (!pinfo->eti_started)
+ continue;
+
+ tinfo = &pinfo->eti_thread_ctx->thread_info;
+ if (ctx == pinfo->eti_thread_ctx)
+ cur += group + 1 - tinfo->et_group_start;
+ else
+ cur += tinfo->et_group_next -
+ tinfo->et_group_start;
+ }
+ }
+#endif
+
if (ctx->progress)
- if ((ctx->progress)(ctx, 1, group+1,
+ if ((ctx->progress)(ctx, 1, cur,
ctx->fs->group_desc_count))
return EXT2_ET_CANCEL_REQUESTED;
_("The -m option should be used together with one of -p/-y/-n options."));
fatal_error(ctx, 0);
}
- if (ctx->progress) {
- com_err(ctx->program_name, 0, "%s",
- _("Only one of the options -C or -m may be specified."));
- fatal_error(ctx, 0);
- }
}
#endif
if (ctx->options & E2F_OPT_NO)
#ifdef SA_RESTART
sa.sa_flags = SA_RESTART;
#endif
- if ((ctx->options & E2F_OPT_MULTITHREAD) == 0) {
- sa.sa_handler = signal_progress_on;
- sigaction(SIGUSR1, &sa, 0);
- sa.sa_handler = signal_progress_off;
- sigaction(SIGUSR2, &sa, 0);
- }
+ sa.sa_handler = signal_progress_on;
+ sigaction(SIGUSR1, &sa, 0);
+ sa.sa_handler = signal_progress_off;
+ sigaction(SIGUSR2, &sa, 0);
#endif
/* Update our PATH to include /sbin if we need to run badblocks */
+++ /dev/null
-ext2fs_open2: Bad magic number in super-block
-../e2fsck/e2fsck: Superblock invalid, trying backup blocks...
-Pass 1: Checking inodes, blocks, and sizes
-Pass 2: Checking directory structure
-Pass 3: Checking directory connectivity
-Pass 4: Checking reference counts
-Pass 5: Checking group summary information
-Free blocks count wrong for group #0 (7987, counted=7982).
-Fix? yes
-
-Free blocks count wrong (11602, counted=11597).
-Fix? yes
-
-Free inodes count wrong for group #0 (1493, counted=1488).
-Fix? yes
-
-Free inodes count wrong (2997, counted=2992).
-Fix? yes
-
-
-test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
-test_filesys: 16/3008 files (0.0% non-contiguous), 403/12000 blocks
-Exit status is 1