/*
* pass5.c --- check block and inode bitmaps against on-disk bitmaps
- *
+ *
* Copyright (C) 1993, 1994, 1995, 1996, 1997 Theodore Ts'o.
*
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
* %End-Header%
- *
+ *
*/
#include "e2fsck.h"
struct resource_track rtrack;
#endif
struct problem_context pctx;
-
+
#ifdef MTRACE
mtrace_print("Pass 5");
#endif
-#ifdef RESOURCE_TRACK
init_resource_track(&rtrack, ctx->fs->io);
-#endif
-
clear_problem_context(&pctx);
if (!(ctx->options & E2F_OPT_PREEN))
ext2fs_free_block_bitmap(ctx->block_found_map);
ctx->block_found_map = 0;
-#ifdef RESOURCE_TRACK
- if (ctx->options & E2F_OPT_TIME2) {
- e2fsck_clear_progbar(ctx);
- print_resource_track(_("Pass 5"), &rtrack, ctx->fs->io);
- }
-#endif
+ print_resource_track(ctx, _("Pass 5"), &rtrack, ctx->fs->io);
}
#define NO_BLK ((blk_t) -1)
static void check_block_bitmaps(e2fsck_t ctx)
{
ext2_filsys fs = ctx->fs;
- blk_t i, super;
+ blk_t i;
int *free_array;
int group = 0;
blk_t blocks = 0;
if (csum_flag &&
(fs->group_desc[group].bg_flags & EXT2_BG_BLOCK_UNINIT))
skip_group++;
- super = fs->super->s_first_data_block;
for (i = fs->super->s_first_data_block;
i < fs->super->s_blocks_count;
i++) {
blocks = 0;
group_free = 0;
skip_group = 0;
- super += fs->super->s_blocks_per_group;
if (ctx->progress)
if ((ctx->progress)(ctx, 5, group,
fs->group_desc_count*2))
if (save_inodes_count == end)
return;
- /* protect loop from wrap-around if end is maxed */
+ /* protect loop from wrap-around if end is maxed */
for (i = save_inodes_count + 1; i <= end && i > save_inodes_count; i++) {
if (!ext2fs_test_inode_bitmap(fs->inode_map, i)) {
if (fix_problem(ctx, PR_5_INODE_BMAP_PADDING, &pctx)) {
- for (i = save_inodes_count + 1; i <= end; i++)
+ for (; i <= end; i++)
ext2fs_mark_inode_bitmap(fs->inode_map,
i);
ext2fs_mark_ib_dirty(fs);
if (save_blocks_count == end)
return;
- /* Protect loop from wrap-around if end is maxed */
+ /* Protect loop from wrap-around if end is maxed */
for (i = save_blocks_count + 1; i <= end && i > save_blocks_count; i++) {
if (!ext2fs_test_block_bitmap(fs->block_map, i)) {
if (fix_problem(ctx, PR_5_BLOCK_BMAP_PADDING, &pctx)) {
- for (i = save_blocks_count + 1; i <= end; i++)
+ for (; i <= end; i++)
ext2fs_mark_block_bitmap(fs->block_map,
i);
ext2fs_mark_bb_dirty(fs);