Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 9383e745e23602bc45f9c92184feea59 > files > 64

gfs2-utils-0.1.62-28.el5.src.rpm

commit efc08c2e2456e59cc5098ec89071343f2d72757c
Author: Bob Peterson <bob@ganesha.peterson>
Date:   Thu Feb 18 08:26:31 2010 -0600

    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

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 */