This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit 99aac792fbe7ef6fcbebc2208268836367bb34d2
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Tue Jun 4 15:03:11 2019 +0100
fsck.gfs2: Remove some unnecessary and slow gettext calls
Many of the gettext calls are in functions which are called often enough
that there is a significant performance hit. Others are unnecessary or
in debug logging where i18n is unimportant.
This gives well over a 5% speed up in my tests on a full 300TB fs.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/fsck/metawalk.c | 5 ++---
gfs2/fsck/pass1.c | 29 ++++++++++++++---------------
gfs2/fsck/pass1b.c | 14 +++++++-------
3 files changed, 23 insertions(+), 25 deletions(-)
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index a7780d7..03dd2d6 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -1404,8 +1404,7 @@ static int check_data(struct gfs2_inode *ip, struct metawalk_fxns
*pass,
uint64_t metablock = bh->b_blocknr;
/* If there isn't much pointer corruption check the pointers */
- log_debug(_("\nProcessing data blocks for inode 0x%llx, metadata "
- "block 0x%llx.\n"),
+ log_debug("Processing data blocks for inode 0x%llx, metadata block
0x%llx.\n",
(unsigned long long)ip->i_di.di_num.no_addr,
(unsigned long long)bh->b_blocknr);
for (ptr = ptr_start ; (char *)ptr < ptr_end && !fsck_abort; ptr++) {
@@ -1673,7 +1672,7 @@ undo_metalist:
to undo. */
delete_all_dups(ip);
/* Set the dinode as "bad" so it gets deleted */
- fsck_bitmap_set(ip, ip->i_di.di_num.no_addr, _("corrupt"),
+ fsck_bitmap_set(ip, ip->i_di.di_num.no_addr, "corrupt",
GFS2_BLKST_FREE);
log_err(_("The corrupt inode was invalidated.\n"));
out:
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index 3c2f74f..faff884 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -511,7 +511,7 @@ static int blockmap_set_as_data(struct gfs2_inode *ip, uint64_t
block)
struct gfs2_buffer_head *bh;
struct gfs2_dinode *di;
- error = fsck_blkmap_set_noino(ip, block, _("data"), GFS2_BLKST_USED);
+ error = fsck_blkmap_set_noino(ip, block, "data", GFS2_BLKST_USED);
if (!error)
return 0;
@@ -537,7 +537,7 @@ static int blockmap_set_as_data(struct gfs2_inode *ip, uint64_t
block)
error = -1;
out:
if (!error)
- fsck_blockmap_set(ip, block, _("data"), GFS2_BLKST_USED);
+ fsck_blockmap_set(ip, block, "data", GFS2_BLKST_USED);
brelse(bh);
return error;
}
@@ -642,13 +642,13 @@ static int check_data(struct gfs2_inode *ip, uint64_t metablock,
log_info(_("Block %lld (0x%llx) is a GFS1 rindex block\n"),
(unsigned long long)block, (unsigned long long)block);
gfs2_special_set(&gfs1_rindex_blks, block);
- fsck_blockmap_set(ip, block, _("rgrp"), GFS2_BLKST_DINODE);
+ fsck_blockmap_set(ip, block, "rgrp", GFS2_BLKST_DINODE);
/*gfs2_meta_rgrp);*/
} else if (ip->i_sbd->gfs1 && ip->i_di.di_flags & GFS2_DIF_JDATA)
{
log_info(_("Block %lld (0x%llx) is a GFS1 journaled data "
"block\n"),
(unsigned long long)block, (unsigned long long)block);
- fsck_blockmap_set(ip, block, _("jdata"), GFS2_BLKST_DINODE);
+ fsck_blockmap_set(ip, block, "jdata", GFS2_BLKST_DINODE);
} else
return blockmap_set_as_data(ip, block);
return 0;
@@ -1286,25 +1286,25 @@ static int set_ip_blockmap(struct gfs2_inode *ip)
switch (mode) {
case S_IFDIR:
- ty = _("directory");
+ ty = "directory";
break;
case S_IFREG:
- ty = _("file");
+ ty = "file";
break;
case S_IFLNK:
- ty = _("symlink");
+ ty = "symlink";
break;
case S_IFBLK:
- ty = _("block device");
+ ty = "block device";
break;
case S_IFCHR:
- ty = _("character device");
+ ty = "character device";
break;
case S_IFIFO:
- ty = _("fifo");
+ ty = "fifo";
break;
case S_IFSOCK:
- ty = _("socket");
+ ty = "socket";
break;
default:
return -EINVAL;
@@ -1372,7 +1372,7 @@ static int alloc_leaf(struct gfs2_inode *ip, uint64_t block, void
*private)
after the bitmap has been set but before the blockmap has. */
q = bitmap_type(ip->i_sbd, block);
if (q == GFS2_BLKST_FREE)
- fsck_blockmap_set(ip, block, _("newly allocated leaf"),
+ fsck_blockmap_set(ip, block, "newly allocated leaf",
ip->i_sbd->gfs1 ? GFS2_BLKST_DINODE :
GFS2_BLKST_USED);
return 0;
@@ -2193,12 +2193,11 @@ int pass1(struct gfs2_sbd *sdp)
goto out;
}
next = osi_next(n);
- log_debug( _("Checking metadata in Resource Group #%llu\n"),
+ log_debug("Checking metadata in resource group #%llu\n",
(unsigned long long)rg_count);
rgd = (struct rgrp_tree *)n;
for (i = 0; i < rgd->ri.ri_length; i++) {
- log_debug( _("rgrp block %lld (0x%llx) "
- "is now marked as 'rgrp data'\n"),
+ log_debug("rgrp block %lld (0x%llx) is now marked as 'rgrp
data'\n",
rgd->ri.ri_addr + i, rgd->ri.ri_addr + i);
if (gfs2_blockmap_set(bl, rgd->ri.ri_addr + i,
GFS2_BLKST_USED)) {
diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
index 62686fe..574622b 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -521,25 +521,25 @@ static int set_ip_bitmap(struct gfs2_inode *ip)
switch (mode) {
case S_IFDIR:
- ty = _("directory");
+ ty = "directory";
break;
case S_IFREG:
- ty = _("file");
+ ty = "file";
break;
case S_IFLNK:
- ty = _("symlink");
+ ty = "symlink";
break;
case S_IFBLK:
- ty = _("block device");
+ ty = "block device";
break;
case S_IFCHR:
- ty = _("character device");
+ ty = "character device";
break;
case S_IFIFO:
- ty = _("fifo");
+ ty = "fifo";
break;
case S_IFSOCK:
- ty = _("socket");
+ ty = "socket";
break;
default:
return -EINVAL;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.