[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] [PATCH 1/2] GFS2: struct gfs2_rindex vs char buf[] cleanup



Looks like the following code is needed to just save a cast:

	char buf[sizeof(struct gfs2_rindex)];

Name things by their names. Also, patch will make endian annotations
more complete.

Signed-off-by: Alexey Dobriyan <adobriyan gmail com>
---

 fs/gfs2/rgrp.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -442,7 +442,7 @@ static int gfs2_ri_update(struct gfs2_in
 	struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
 	struct inode *inode = &ip->i_inode;
 	struct gfs2_rgrpd *rgd;
-	char buf[sizeof(struct gfs2_rindex)];
+	struct gfs2_rindex ri_disk;
 	struct file_ra_state ra_state;
 	u64 junk = ip->i_di.di_size;
 	int error;
@@ -457,7 +457,7 @@ static int gfs2_ri_update(struct gfs2_in
 	file_ra_state_init(&ra_state, inode->i_mapping);
 	for (sdp->sd_rgrps = 0;; sdp->sd_rgrps++) {
 		loff_t pos = sdp->sd_rgrps * sizeof(struct gfs2_rindex);
-		error = gfs2_internal_read(ip, &ra_state, buf, &pos,
+		error = gfs2_internal_read(ip, &ra_state, (char *)&ri_disk, &pos,
 					    sizeof(struct gfs2_rindex));
 		if (!error)
 			break;
@@ -479,7 +479,7 @@ static int gfs2_ri_update(struct gfs2_in
 		list_add_tail(&rgd->rd_list, &sdp->sd_rindex_list);
 		list_add_tail(&rgd->rd_list_mru, &sdp->sd_rindex_mru_list);
 
-		gfs2_rindex_in(&rgd->rd_ri, buf);
+		gfs2_rindex_in(&rgd->rd_ri, &ri_disk);
 		error = compute_bitstructs(rgd);
 		if (error)
 			goto fail;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]