All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH 1/2] GFS2: struct gfs2_rindex vs char buf[] cleanup
@ 2006-11-13 20:55 ` Alexey Dobriyan
  0 siblings, 0 replies; 6+ messages in thread
From: Alexey Dobriyan @ 2006-11-13 20:55 UTC (permalink / raw)
  To: cluster-devel.redhat.com

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;



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-11-13 21:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-13 20:55 [Cluster-devel] [PATCH 1/2] GFS2: struct gfs2_rindex vs char buf[] cleanup Alexey Dobriyan
2006-11-13 20:55 ` Alexey Dobriyan
2006-11-13 21:32 ` [Cluster-devel] " Al Viro
2006-11-13 21:32   ` Al Viro
2006-11-13 21:42   ` [Cluster-devel] " Alexey Dobriyan
2006-11-13 21:42     ` Alexey Dobriyan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.