+ /* Complain about mutually exclusive rebuilding activities */
+ if (getenv("E2FSCK_FIXES_ONLY"))
+ ctx->options |= E2F_OPT_FIXES_ONLY;
+ if ((ctx->options & E2F_OPT_COMPRESS_DIRS) &&
+ (ctx->options & E2F_OPT_FIXES_ONLY)) {
+ com_err(ctx->program_name, 0, "%s",
+ _("The -D and -E fixes_only options are incompatible."));
+ fatal_error(ctx, 0);
+ }
+ if ((ctx->options & E2F_OPT_CONVERT_BMAP) &&
+ (ctx->options & E2F_OPT_FIXES_ONLY)) {
+ com_err(ctx->program_name, 0, "%s",
+ _("The -E bmap2extent and fixes_only options are incompatible."));
+ fatal_error(ctx, 0);
+ }
+
+ profile_get_boolean(ctx->profile, "options", "report_time", 0, 0,
+ &c);
+ if (c)
+ ctx->options |= E2F_OPT_TIME | E2F_OPT_TIME2;
+ profile_get_boolean(ctx->profile, "options", "report_verbose", 0, 0,
+ &c);
+ if (c)
+ verbose = 1;
+
+ profile_get_boolean(ctx->profile, "options", "no_optimize_extents",
+ 0, 0, &c);
+ if (c)
+ ctx->options |= E2F_OPT_NOOPT_EXTENTS;
+
+ profile_get_boolean(ctx->profile, "options", "inode_count_fullmap",
+ 0, 0, &c);
+ if (c)
+ ctx->options |= E2F_OPT_ICOUNT_FULLMAP;
+
+ if (ctx->readahead_kb == ~0ULL) {
+ profile_get_integer(ctx->profile, "options",
+ "readahead_mem_pct", 0, -1, &c);
+ if (c >= 0 && c <= 100)
+ ctx->readahead_kb = phys_mem_kb * c / 100;
+ profile_get_integer(ctx->profile, "options",
+ "readahead_kb", 0, -1, &c);
+ if (c >= 0)
+ ctx->readahead_kb = c;
+ if (ctx->readahead_kb != ~0ULL &&
+ ctx->readahead_kb > phys_mem_kb)
+ ctx->readahead_kb = phys_mem_kb;
+ }
+
+ /* Turn off discard in read-only mode */
+ if ((ctx->options & E2F_OPT_NO) &&
+ (ctx->options & E2F_OPT_DISCARD))
+ ctx->options &= ~E2F_OPT_DISCARD;