diff options
Diffstat (limited to 'e2fsck/unix.c')
-rw-r--r-- | e2fsck/unix.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/e2fsck/unix.c b/e2fsck/unix.c index cc3c39de..7eb269cc 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -101,9 +101,9 @@ static void show_stats(e2fsck_t ctx) { ext2_filsys fs = ctx->fs; ext2_ino_t inodes, inodes_used; - blk_t blocks, blocks_used; - int dir_links; - int num_files, num_links; + blk64_t blocks, blocks_used; + unsigned int dir_links; + unsigned int num_files, num_links; int frag_percent_file, frag_percent_dir, frag_percent_total; int i, j; @@ -113,9 +113,9 @@ static void show_stats(e2fsck_t ctx) inodes = fs->super->s_inodes_count; inodes_used = (fs->super->s_inodes_count - fs->super->s_free_inodes_count); - blocks = fs->super->s_blocks_count; - blocks_used = (fs->super->s_blocks_count - - fs->super->s_free_blocks_count); + blocks = ext2fs_blocks_count(fs->super); + blocks_used = (ext2fs_blocks_count(fs->super) - + ext2fs_free_blocks_count(fs->super)); frag_percent_file = (10000 * ctx->fs_fragmented) / inodes_used; frag_percent_file = (frag_percent_file + 5) / 10; @@ -129,7 +129,7 @@ static void show_stats(e2fsck_t ctx) frag_percent_total = (frag_percent_total + 5) / 10; if (!verbose) { - printf(_("%s: %u/%u files (%0d.%d%% non-contiguous), %u/%u blocks\n"), + printf(_("%s: %u/%u files (%0d.%d%% non-contiguous), %llu/%llu blocks\n"), ctx->device_name, inodes_used, inodes, frag_percent_total / 10, frag_percent_total % 10, blocks_used, blocks); @@ -163,7 +163,8 @@ static void show_stats(e2fsck_t ctx) fputc('\n', stdout); } - printf (P_("%8u block used (%2.2f%%)\n", "%8u blocks used (%2.2f%%)\n", + printf (P_("%8llu block used (%2.2f%%)\n", + "%8llu blocks used (%2.2f%%)\n", blocks_used), blocks_used, 100.0 * blocks_used / blocks); printf (P_("%8u bad block\n", "%8u bad blocks\n", ctx->fs_badblocks_count), ctx->fs_badblocks_count); @@ -345,11 +346,12 @@ static void check_if_skip(e2fsck_t ctx) fputs(_(", check forced.\n"), stdout); return; } - printf(_("%s: clean, %u/%u files, %u/%u blocks"), ctx->device_name, + printf(_("%s: clean, %u/%u files, %llu/%llu blocks"), ctx->device_name, fs->super->s_inodes_count - fs->super->s_free_inodes_count, fs->super->s_inodes_count, - fs->super->s_blocks_count - fs->super->s_free_blocks_count, - fs->super->s_blocks_count); + ext2fs_blocks_count(fs->super) - + ext2fs_free_blocks_count(fs->super), + ext2fs_blocks_count(fs->super)); next_check = 100000; if (fs->super->s_max_mnt_count > 0) { next_check = fs->super->s_max_mnt_count - fs->super->s_mnt_count; @@ -736,7 +738,7 @@ static errcode_t PRS(int argc, char *argv[], e2fsck_t *ret_ctx) /* What we do by default, anyway! */ break; case 'b': - res = sscanf(optarg, "%u", &ctx->use_superblock); + res = sscanf(optarg, "%llu", &ctx->use_superblock); if (res != 1) goto sscanf_err; ctx->flags |= E2F_FLAG_SB_SPECIFIED; @@ -960,6 +962,7 @@ int main (int argc, char *argv[]) int flags, run_result; int journal_size; int sysval, sys_page_size = 4096; + int old_bitmaps; __u32 features[3]; char *cp; @@ -1022,6 +1025,10 @@ restart: #endif io_ptr = unix_io_manager; flags = EXT2_FLAG_NOFREE_ON_ERROR; + profile_get_boolean(ctx->profile, "options", "old_bitmaps", 0, 0, + &old_bitmaps); + if (!old_bitmaps) + flags |= EXT2_FLAG_64BITS; if ((ctx->options & E2F_OPT_READONLY) == 0) flags |= EXT2_FLAG_RW; if ((ctx->mount_flags & EXT2_MF_MOUNTED) == 0) @@ -1351,7 +1358,7 @@ print_unsupp_features: if (ctx->flags & E2F_FLAG_JOURNAL_INODE) { if (fix_problem(ctx, PR_6_RECREATE_JOURNAL, &pctx)) { if (journal_size < 1024) - journal_size = ext2fs_default_journal_size(fs->super->s_blocks_count); + journal_size = ext2fs_default_journal_size(ext2fs_blocks_count(fs->super)); if (journal_size < 0) { fs->super->s_feature_compat &= ~EXT3_FEATURE_COMPAT_HAS_JOURNAL; |