summaryrefslogtreecommitdiff
path: root/e2fsck/pass2.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2007-09-15 14:10:47 -0400
committerTheodore Ts'o <tytso@mit.edu>2008-02-18 15:27:04 -0500
commite3df15abdb288c3519000c639ed40429a82b63cd (patch)
tree1d06fa7b49ce01a03521d8f752616d88fa2b32fb /e2fsck/pass2.c
parent4ce3b77480496a20cf380bd18a8ae4a414b7d4a0 (diff)
downloade2fsprogs-e3df15abdb288c3519000c639ed40429a82b63cd.tar.gz
e2fsck: factor out code to clear an inode into e2fsck_clear_inode()
Factor out code to clear a bogus inode and update e2fsck's internal data structures accordingly into a common routine, e2fsck_clear_inode(). This saves about 200 bytes in the compiled x86 e2fsck executable, and makes the code more maintainable in the long-term. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'e2fsck/pass2.c')
-rw-r--r--e2fsck/pass2.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/e2fsck/pass2.c b/e2fsck/pass2.c
index 4c80fb65..011dba0e 100644
--- a/e2fsck/pass2.c
+++ b/e2fsck/pass2.c
@@ -1111,11 +1111,8 @@ static void deallocate_inode(e2fsck_t ctx, ext2_ino_t ino, char* block_buf)
struct problem_context pctx;
__u32 count;
- ext2fs_icount_store(ctx->inode_link_info, ino, 0);
e2fsck_read_inode(ctx, ino, &inode, "deallocate_inode");
- inode.i_links_count = 0;
- inode.i_dtime = ctx->now;
- e2fsck_write_inode(ctx, ino, &inode, "deallocate_inode");
+ e2fsck_clear_inode(ctx, ino, &inode, 0, "deallocate_inode");
clear_problem_context(&pctx);
pctx.ino = ino;
@@ -1123,10 +1120,6 @@ static void deallocate_inode(e2fsck_t ctx, ext2_ino_t ino, char* block_buf)
* Fix up the bitmaps...
*/
e2fsck_read_bitmaps(ctx);
- ext2fs_unmark_inode_bitmap(ctx->inode_used_map, ino);
- ext2fs_unmark_inode_bitmap(ctx->inode_dir_map, ino);
- if (ctx->inode_bad_map)
- ext2fs_unmark_inode_bitmap(ctx->inode_bad_map, ino);
ext2fs_inode_alloc_stats2(fs, ino, -1, LINUX_S_ISDIR(inode.i_mode));
if (inode.i_file_acl &&