Gitweb:
http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: efc08c2e2456e59cc5098ec89071343f2d72757c
Parent: 27ddb92542bfa62d94e7e2496e717f84aaef53f6
Author: Bob Peterson <bob(a)ganesha.peterson>
AuthorDate: Thu Feb 18 08:26:31 2010 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Fri Apr 9 23:45:34 2010 -0500
Convert check_statfs function to the new rgrp method
The performance patches for bug #455300 attached buffer_head
structures to the rgrps, so the relatively new check_statfs
function needs to be adjusted to use this method.
rhbz#455300
---
gfs2/fsck/main.c | 18 +-----------------
1 files changed, 1 insertions(+), 17 deletions(-)
diff --git a/gfs2/fsck/main.c b/gfs2/fsck/main.c
index 1a06f53..ae8d6c0 100644
--- a/gfs2/fsck/main.c
+++ b/gfs2/fsck/main.c
@@ -268,7 +268,7 @@ static int check_system_inodes(struct gfs2_sbd *sdp)
return 0;
}
-void check_statfs(struct gfs2_sbd *sdp)
+static void check_statfs(struct gfs2_sbd *sdp)
{
osi_list_t *tmp;
struct rgrp_list *rgd;
@@ -276,7 +276,6 @@ void check_statfs(struct gfs2_sbd *sdp)
struct gfs2_statfs_change sc;
char buf[sizeof(struct gfs2_statfs_change)];
int count;
- struct gfs2_buffer_head **rgbh;
/* Read the current statfs values */
count = gfs2_readi(sdp->md.statfs, buf, 0,
@@ -292,24 +291,9 @@ void check_statfs(struct gfs2_sbd *sdp)
for (tmp = sdp->rglist.next; tmp != &sdp->rglist; tmp = tmp->next) {
rgd = osi_list_entry(tmp, struct rgrp_list, list);
ri = &rgd->ri;
- if(!(rgbh = (struct gfs2_buffer_head **)
- malloc(rgd->ri.ri_length *
- sizeof(struct gfs2_buffer_head *)))) {
- log_err( _("Error: can't allocate memory to check statfs.\n"));
- return;
- }
- if(!memset(rgbh, 0, rgd->ri.ri_length *
- sizeof(struct gfs2_buffer_head *))) {
- free(rgbh);
- log_err( _("Error: can't allocate memory to check statfs.\n"));
- return;
- }
- gfs2_rgrp_read(sdp, rgd);
sdp->blks_total += ri->ri_data;
sdp->blks_alloced += (ri->ri_data - rgd->rg.rg_free);
sdp->dinodes_alloced += rgd->rg.rg_dinodes;
- gfs2_rgrp_relse(rgd);
- free(rgbh);
}
/* See if they match */