aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r--fs/gfs2/inode.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index dadd1f35c864..fb969302f181 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -500,21 +500,22 @@ static int pick_formal_ino_2(struct gfs2_sbd *sdp, u64 *formal_ino)
500 if (!ir.ir_length) { 500 if (!ir.ir_length) {
501 struct buffer_head *m_bh; 501 struct buffer_head *m_bh;
502 u64 x, y; 502 u64 x, y;
503 __be64 z;
503 504
504 error = gfs2_meta_inode_buffer(m_ip, &m_bh); 505 error = gfs2_meta_inode_buffer(m_ip, &m_bh);
505 if (error) 506 if (error)
506 goto out_brelse; 507 goto out_brelse;
507 508
508 x = *(u64 *)(m_bh->b_data + sizeof(struct gfs2_dinode)); 509 z = *(__be64 *)(m_bh->b_data + sizeof(struct gfs2_dinode));
509 x = y = be64_to_cpu(x); 510 x = y = be64_to_cpu(z);
510 ir.ir_start = x; 511 ir.ir_start = x;
511 ir.ir_length = GFS2_INUM_QUANTUM; 512 ir.ir_length = GFS2_INUM_QUANTUM;
512 x += GFS2_INUM_QUANTUM; 513 x += GFS2_INUM_QUANTUM;
513 if (x < y) 514 if (x < y)
514 gfs2_consist_inode(m_ip); 515 gfs2_consist_inode(m_ip);
515 x = cpu_to_be64(x); 516 z = cpu_to_be64(x);
516 gfs2_trans_add_bh(m_ip->i_gl, m_bh, 1); 517 gfs2_trans_add_bh(m_ip->i_gl, m_bh, 1);
517 *(u64 *)(m_bh->b_data + sizeof(struct gfs2_dinode)) = x; 518 *(__be64 *)(m_bh->b_data + sizeof(struct gfs2_dinode)) = z;
518 519
519 brelse(m_bh); 520 brelse(m_bh);
520 } 521 }