This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch RHEL7
in repository gfs2-utils.
commit cf34e461edc0458c61b4d6c070161ba824ec3740
Author: Andrew Price <anprice(a)redhat.com>
Date: Fri Feb 12 17:25:38 2016 +0000
gfs2_edit savemeta: Don't read rgrp blocks twice
When savemeta iterates over the rgrps and saves the rgrp header blocks
it calls save_block which does a bread() for each block despite them
already being read in earlier. Instead, call save_bh() on the existing
rgrp buffers. This isn't likely to give a significant performance
improvement as the duplicate reads would be cache hits but it should
have a noticeable effect on very large file systems.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/savemeta.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 3e8dae0..9723dcd 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -855,8 +855,8 @@ void savemeta(char *out_fn, int saveoption, int gziplevel)
}
/* Walk through the resource groups saving everything within */
for (n = osi_first(&sbd.rgtree); n; n = osi_next(n)) {
- uint64_t blk;
struct rgrp_tree *rgd;
+ unsigned i;
rgd = (struct rgrp_tree *)n;
if (gfs2_rgrp_read(&sbd, rgd))
@@ -866,10 +866,9 @@ void savemeta(char *out_fn, int saveoption, int gziplevel)
(unsigned long long)rgd->ri.ri_addr,
rgd->ri.ri_length);
/* Save off the rg and bitmaps */
- for (blk = rgd->ri.ri_addr;
- blk < rgd->ri.ri_data0; blk++) {
- warm_fuzzy_stuff(blk, FALSE);
- save_block(sbd.device_fd, &mfd, blk, blk, NULL);
+ for (i = 0; i < rgd->ri.ri_length; i++) {
+ warm_fuzzy_stuff(rgd->ri.ri_addr + i, FALSE);
+ save_bh(&mfd, rgd->bits[i].bi_bh, 0, NULL);
}
/* Save off the other metadata: inodes, etc. if mode is not 'savergs' */
if (saveoption != 2) {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date