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.
bitmap-optimize
Theodore Ts'o 2001-07-07 22:27:40 -04:00
parent f41e7e6961
commit b5acdb6ae2
1 changed files with 14 additions and 4 deletions

View File

@ -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)