From f8e4f457d30ccff19833ddaf6514632f054a4418 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 16 Jan 2020 21:58:21 -0500 Subject: [PATCH] e2fsck: clean up unwind_pass1() as it's no longer really needed 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 --- e2fsck/pass1.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index a57c1c0..ed85431 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -129,16 +129,6 @@ 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); -- 1.8.3.1