Skip to contentSkip to conversation

gfs2: use aligned-endian get/put helpers

PATCH In review Harvey Harrison 1 participant 1 message May 20, 2008 GFS2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 16/21 gfs2: use aligned-endian get/put helpers

---
 fs/gfs2/bmap.c |    2 +-
 fs/gfs2/lops.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
fs/gfs2/bmap.c +1 -1
index c19184f..42473ee 100644
@@ -160,7 +160,7 @@ int gfs2_unstuff_dinode(struct gfs2_inode *ip, struct page *page)
 	gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode));
 
 	if (ip->i_di.di_size) {
-		*(__be64 *)(di + 1) = cpu_to_be64(block);
+		put_be64(block, di + 1);;
 		gfs2_add_inode_blocks(&ip->i_inode, 1);
 		di->di_blocks = cpu_to_be64(gfs2_get_inode_blocks(&ip->i_inode));
 	}
fs/gfs2/lops.c +2 -2
index 4390f6f..3e7cac3 100644
@@ -352,7 +352,7 @@ static void revoke_lo_before_commit(struct gfs2_sbd *sdp)
 			offset = sizeof(struct gfs2_meta_header);
 		}
 
-		*(__be64 *)(bh->b_data + offset) = cpu_to_be64(bd->bd_blkno);
+		put_be64(bd->bd_blkno, bh->b_data + offset);
 		kmem_cache_free(gfs2_bufdata_cachep, bd);
 
 		offset += sizeof(u64);
@@ -401,7 +401,7 @@ static int revoke_lo_scan_elements(struct gfs2_jdesc *jd, unsigned int start,
 			gfs2_metatype_check(sdp, bh, GFS2_METATYPE_LB);
 
 		while (offset + sizeof(u64) <= sdp->sd_sb.sb_bsize) {
-			blkno = be64_to_cpu(*(__be64 *)(bh->b_data + offset));
+			blkno = get_be64(bh->b_data + offset);
 
 			error = gfs2_revoke_add(sdp, blkno, start);
 			if (error < 0) {
Signature · 1 line
1.5.5.1.570.g26b5e