mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-11-23 18:14:25 +08:00
e2fsck: optimize away repeated calls to gettext()
Optimize _("getting next inode from scan") so it is not called for each initialized inode in the file system, and make a similar optimization in pass 2 for each directory block. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
parent
1f0f27059a
commit
c4e7324243
@ -1171,6 +1171,7 @@ void e2fsck_pass1(e2fsck_t ctx)
|
||||
struct scan_callback_struct scan_struct;
|
||||
struct ext2_super_block *sb = ctx->fs->super;
|
||||
const char *old_op;
|
||||
const char *eop_next_inode = _("getting next inode from scan");
|
||||
int imagic_fs, extent_fs, inlinedata_fs, casefold_fs;
|
||||
int low_dtime_check = 1;
|
||||
unsigned int inode_size = EXT2_INODE_SIZE(fs->super);
|
||||
@ -1363,7 +1364,7 @@ void e2fsck_pass1(e2fsck_t ctx)
|
||||
if (e2fsck_mmp_update(fs))
|
||||
fatal_error(ctx, 0);
|
||||
}
|
||||
old_op = ehandler_operation(_("getting next inode from scan"));
|
||||
old_op = ehandler_operation(eop_next_inode);
|
||||
pctx.errcode = ext2fs_get_next_inode_full(scan, &ino,
|
||||
inode, inode_size);
|
||||
if (ino > ino_threshold)
|
||||
|
@ -934,6 +934,7 @@ static int check_dir_block(ext2_filsys fs,
|
||||
int encrypted = 0;
|
||||
size_t max_block_size;
|
||||
int hash_flags = 0;
|
||||
static char *eop_read_dirblock = NULL;
|
||||
|
||||
cd = (struct check_dir_struct *) priv_data;
|
||||
ibuf = buf = cd->buf;
|
||||
@ -1004,7 +1005,9 @@ static int check_dir_block(ext2_filsys fs,
|
||||
db->blockcnt, ino);
|
||||
#endif
|
||||
|
||||
ehandler_operation(_("reading directory block"));
|
||||
if (!eop_read_dirblock)
|
||||
eop_read_dirblock = (char *) _("reading directory block");
|
||||
ehandler_operation(eop_read_dirblock);
|
||||
if (inline_data_size) {
|
||||
memset(buf, 0, fs->blocksize - inline_data_size);
|
||||
cd->pctx.errcode = ext2fs_inline_data_get(fs, ino, 0, buf, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user