+2003-03-15 Theodore Ts'o <tytso@mit.edu>
+
+ * rehash.c (e2fsck_rehash_dir): If user specified the -n option,
+ skip trying to write out directory.
+ (e2fsck_rehash_directories): Fix the percentage
+ calculation in the progress bar.
+
2003-03-14 Theodore Ts'o <tytso@mit.edu>
* problem.c, problem.h (PR_2_REPORT_DUP_DIRENT): Add new problem code.
static void free_out_dir(struct out_dir *outdir)
{
- free(outdir->buf);
- free(outdir->hashes);
+ if (outdir->buf)
+ free(outdir->buf);
+ if (outdir->hashes)
+ free(outdir->hashes);
outdir->max = 0;
outdir->num =0;
}
struct fill_dir_struct fd;
struct out_dir outdir;
+ outdir.max = outdir.num = 0;
+ outdir.buf = 0;
+ outdir.hashes = 0;
e2fsck_read_inode(ctx, ino, &inode, "rehash_dir");
retval = ENOMEM;
if (duplicate_search_and_fix(ctx, fs, ino, &fd))
goto resort;
+ if (ctx->options & E2F_OPT_NO) {
+ retval = 0;
+ goto errout;
+ }
+
/*
* Copy the directory entries. In a htree directory these
* will become the leaf nodes.
}
if (ctx->progress && !ctx->progress_fd)
e2fsck_simple_progress(ctx, "Rebuilding directory",
- (float) (++cur) / (float) max, ino);
+ 100.0 * (float) (++cur) / (float) max, ino);
}
end_problem_latch(ctx, PR_LATCH_OPTIMIZE_DIR);
if (!all_dirs)