From b5acdb6ae2a05212b1014a3dee7cbcf385446b3b Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 7 Jul 2001 22:27:40 -0400 Subject: [PATCH] pass1.c (e2fsck_pass1): Defer inodes which have an extended attribute block for later processing to avoid extra seeks across the disk. (process_inode_cmp): If there is no indirect block, sort by the extended attribute (i_file_acl) block. --- e2fsck/pass1.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 1ef44200..11aaaecf 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -588,7 +588,8 @@ void e2fsck_pass1(e2fsck_t ctx) ctx->fs_tind_count++; if (inode.i_block[EXT2_IND_BLOCK] || inode.i_block[EXT2_DIND_BLOCK] || - inode.i_block[EXT2_TIND_BLOCK]) { + inode.i_block[EXT2_TIND_BLOCK] || + inode.i_file_acl) { inodes_to_process[process_inode_count].ino = ino; inodes_to_process[process_inode_count].inode = inode; process_inode_count++; @@ -776,9 +777,13 @@ static EXT2_QSORT_TYPE process_inode_cmp(const void *a, const void *b) (const struct process_inode_block *) a; const struct process_inode_block *ib_b = (const struct process_inode_block *) b; - - return (ib_a->inode.i_block[EXT2_IND_BLOCK] - - ib_b->inode.i_block[EXT2_IND_BLOCK]); + int ret; + + ret = (ib_a->inode.i_block[EXT2_IND_BLOCK] - + ib_b->inode.i_block[EXT2_IND_BLOCK]); + if (ret == 0) + ret = ib_a->inode.i_file_acl - ib_b->inode.i_file_acl; + return ret; } /* @@ -979,6 +984,11 @@ static int check_ext_attr(e2fsck_t ctx, struct problem_context *pctx, } } +#if 0 + /* Debugging text */ + printf("Inode %u has EA block %u\n", ino, blk); +#endif + /* Have we seen this EA block before? */ if (ext2fs_fast_test_block_bitmap(ctx->block_ea_map, blk)) { if (ea_refcount_decrement(ctx->refcount, blk, 0) == 0)