]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
e2fsck: clean up unwind_pass1() as it's no longer really needed
authorTheodore Ts'o <tytso@mit.edu>
Fri, 17 Jan 2020 02:58:21 +0000 (21:58 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 17 Jan 2020 02:58:21 +0000 (21:58 -0500)
We now restart the full e2fsck instead of unwinding and restarting
pass1.  So most of what used to be in unwind_pass1() has been moved
elsewhere.  Let's git rid of it entirely, which simplifies and shrinks
pass1.c slightly.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass1.c

index a57c1c0670e61a94a0414367674092d56b9017e1..ed85431daf63bf0d032188ed29acbf80f4094779 100644 (file)
@@ -128,16 +128,6 @@ static int process_inode_count;
 static __u64 ext2_max_sizes[EXT2_MAX_BLOCK_LOG_SIZE -
                            EXT2_MIN_BLOCK_LOG_SIZE + 1];
 
-/*
- * Free all memory allocated by pass1 in preparation for restarting
- * things.
- */
-static void unwind_pass1(ext2_filsys fs EXT2FS_ATTR((unused)))
-{
-       ext2fs_free_mem(&inodes_to_process);
-       inodes_to_process = 0;
-}
-
 /*
  * Check to make sure a device inode is real.  Returns 1 if the device
  * checks out, 0 if not.
@@ -2052,7 +2042,6 @@ void e2fsck_pass1(e2fsck_t ctx)
                 * master superblock.
                 */
                ctx->use_superblock = 0;
-               unwind_pass1(fs);
                goto endit;
        }
 
@@ -2064,9 +2053,10 @@ void e2fsck_pass1(e2fsck_t ctx)
                e2fsck_pass1_dupblocks(ctx, block_buf);
        }
        ctx->flags |= E2F_FLAG_ALLOC_OK;
-       ext2fs_free_mem(&inodes_to_process);
 endit:
        e2fsck_use_inode_shortcuts(ctx, 0);
+       ext2fs_free_mem(&inodes_to_process);
+       inodes_to_process = 0;
 
        if (scan)
                ext2fs_close_inode_scan(scan);