From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [gfs2-utils PATCH 2/7] fsck.gfs2: Remember the previous rgrp pointer for speed
Date: Wed, 22 Jun 2016 14:26:47 -0500 [thread overview]
Message-ID: <118932592dd6507fb4d7b770ce8f3684a7f1ce51.1466623303.git.rpeterso@redhat.com> (raw)
In-Reply-To: <cover.1466623302.git.rpeterso@redhat.com>
This is a minor speedup: function check_n_fix_bitmap will now
remember the previous rgrp that it used. This should make it
faster.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
gfs2/fsck/metawalk.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index c0cc2ab..cda59ac 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -40,9 +40,14 @@ int check_n_fix_bitmap(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
{"free", "data", "unlinked", "inode", "reserved"},
/* gfs1 descriptions: */
{"free", "data", "free meta", "metadata", "reserved"}};
+ static struct rgrp_tree *prevrgd = NULL;
- if (rgd == NULL || !rgrp_contains_block(rgd, blk))
+ if (prevrgd && rgrp_contains_block(prevrgd, blk)) {
+ rgd = prevrgd;
+ } else if (rgd == NULL || !rgrp_contains_block(rgd, blk)) {
rgd = gfs2_blk2rgrpd(sdp, blk);
+ prevrgd = rgd;
+ }
gfs1rg = (struct gfs_rgrp *)&rgd->rg;
--
2.5.5
next prev parent reply other threads:[~2016-06-22 19:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-22 19:26 [Cluster-devel] [gfs2-utils PATCH 0/7] fsck.gfs2 performance improvements Bob Peterson
2016-06-22 19:26 ` [Cluster-devel] [gfs2-utils PATCH 1/7] fsck.gfs2: Don't bother to pass bl blockmap pointer Bob Peterson
2016-06-23 12:45 ` Andrew Price
2016-06-22 19:26 ` Bob Peterson [this message]
2016-06-22 19:26 ` [Cluster-devel] [gfs2-utils PATCH 3/7] fsck.gfs2: Don't set gfs1rg pointer unless we need to Bob Peterson
2016-06-22 19:26 ` [Cluster-devel] [gfs2-utils PATCH 4/7] fsck.gfs2: Make _fsck_bitmap_set not send a return code Bob Peterson
2016-06-22 19:26 ` [Cluster-devel] [gfs2-utils PATCH 5/7] fsck.gfs2: convert fsck_bitmap_set to a macro Bob Peterson
2016-06-22 19:26 ` [Cluster-devel] [gfs2-utils PATCH 6/7] fsck.gfs2: Speed up function bitmap_type Bob Peterson
2016-06-22 19:26 ` [Cluster-devel] [gfs2-utils PATCH 7/7] fsck.gfs2: Make pass2 go by directory rbtree for performance Bob Peterson
2016-06-27 12:24 ` [Cluster-devel] [gfs2-utils PATCH 0/7] fsck.gfs2 performance improvements Steven Whitehouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=118932592dd6507fb4d7b770ce8f3684a7f1ce51.1466623303.git.rpeterso@redhat.com \
--to=rpeterso@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).