aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/bmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/bmap.c')
-rw-r--r--fs/gfs2/bmap.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index 06e9a8cb45e9..51f6356bdcb5 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -38,8 +38,8 @@ struct metapath {
38}; 38};
39 39
40typedef int (*block_call_t) (struct gfs2_inode *ip, struct buffer_head *dibh, 40typedef int (*block_call_t) (struct gfs2_inode *ip, struct buffer_head *dibh,
41 struct buffer_head *bh, u64 *top, 41 struct buffer_head *bh, __be64 *top,
42 u64 *bottom, unsigned int height, 42 __be64 *bottom, unsigned int height,
43 void *data); 43 void *data);
44 44
45struct strip_mine { 45struct strip_mine {
@@ -230,7 +230,7 @@ static int build_height(struct inode *inode, unsigned height)
230 struct buffer_head *blocks[GFS2_MAX_META_HEIGHT]; 230 struct buffer_head *blocks[GFS2_MAX_META_HEIGHT];
231 struct gfs2_dinode *di; 231 struct gfs2_dinode *di;
232 int error; 232 int error;
233 u64 *bp; 233 __be64 *bp;
234 u64 bn; 234 u64 bn;
235 unsigned n; 235 unsigned n;
236 236
@@ -255,7 +255,7 @@ static int build_height(struct inode *inode, unsigned height)
255 GFS2_FORMAT_IN); 255 GFS2_FORMAT_IN);
256 gfs2_buffer_clear_tail(blocks[n], 256 gfs2_buffer_clear_tail(blocks[n],
257 sizeof(struct gfs2_meta_header)); 257 sizeof(struct gfs2_meta_header));
258 bp = (u64 *)(blocks[n]->b_data + 258 bp = (__be64 *)(blocks[n]->b_data +
259 sizeof(struct gfs2_meta_header)); 259 sizeof(struct gfs2_meta_header));
260 *bp = cpu_to_be64(blocks[n+1]->b_blocknr); 260 *bp = cpu_to_be64(blocks[n+1]->b_blocknr);
261 brelse(blocks[n]); 261 brelse(blocks[n]);
@@ -360,15 +360,15 @@ static void find_metapath(struct gfs2_inode *ip, u64 block,
360 * metadata tree. 360 * metadata tree.
361 */ 361 */
362 362
363static inline u64 *metapointer(struct buffer_head *bh, int *boundary, 363static inline __be64 *metapointer(struct buffer_head *bh, int *boundary,
364 unsigned int height, const struct metapath *mp) 364 unsigned int height, const struct metapath *mp)
365{ 365{
366 unsigned int head_size = (height > 0) ? 366 unsigned int head_size = (height > 0) ?
367 sizeof(struct gfs2_meta_header) : sizeof(struct gfs2_dinode); 367 sizeof(struct gfs2_meta_header) : sizeof(struct gfs2_dinode);
368 u64 *ptr; 368 __be64 *ptr;
369 *boundary = 0; 369 *boundary = 0;
370 ptr = ((u64 *)(bh->b_data + head_size)) + mp->mp_list[height]; 370 ptr = ((__be64 *)(bh->b_data + head_size)) + mp->mp_list[height];
371 if (ptr + 1 == (u64 *)(bh->b_data + bh->b_size)) 371 if (ptr + 1 == (__be64 *)(bh->b_data + bh->b_size))
372 *boundary = 1; 372 *boundary = 1;
373 return ptr; 373 return ptr;
374} 374}
@@ -394,7 +394,7 @@ static int lookup_block(struct gfs2_inode *ip, struct buffer_head *bh,
394 int *new, u64 *block) 394 int *new, u64 *block)
395{ 395{
396 int boundary; 396 int boundary;
397 u64 *ptr = metapointer(bh, &boundary, height, mp); 397 __be64 *ptr = metapointer(bh, &boundary, height, mp);
398 398
399 if (*ptr) { 399 if (*ptr) {
400 *block = be64_to_cpu(*ptr); 400 *block = be64_to_cpu(*ptr);
@@ -600,7 +600,7 @@ static int recursive_scan(struct gfs2_inode *ip, struct buffer_head *dibh,
600{ 600{
601 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 601 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
602 struct buffer_head *bh = NULL; 602 struct buffer_head *bh = NULL;
603 u64 *top, *bottom; 603 __be64 *top, *bottom;
604 u64 bn; 604 u64 bn;
605 int error; 605 int error;
606 int mh_size = sizeof(struct gfs2_meta_header); 606 int mh_size = sizeof(struct gfs2_meta_header);
@@ -611,17 +611,17 @@ static int recursive_scan(struct gfs2_inode *ip, struct buffer_head *dibh,
611 return error; 611 return error;
612 dibh = bh; 612 dibh = bh;
613 613
614 top = (u64 *)(bh->b_data + sizeof(struct gfs2_dinode)) + mp->mp_list[0]; 614 top = (__be64 *)(bh->b_data + sizeof(struct gfs2_dinode)) + mp->mp_list[0];
615 bottom = (u64 *)(bh->b_data + sizeof(struct gfs2_dinode)) + sdp->sd_diptrs; 615 bottom = (__be64 *)(bh->b_data + sizeof(struct gfs2_dinode)) + sdp->sd_diptrs;
616 } else { 616 } else {
617 error = gfs2_meta_indirect_buffer(ip, height, block, 0, &bh); 617 error = gfs2_meta_indirect_buffer(ip, height, block, 0, &bh);
618 if (error) 618 if (error)
619 return error; 619 return error;
620 620
621 top = (u64 *)(bh->b_data + mh_size) + 621 top = (__be64 *)(bh->b_data + mh_size) +
622 (first ? mp->mp_list[height] : 0); 622 (first ? mp->mp_list[height] : 0);
623 623
624 bottom = (u64 *)(bh->b_data + mh_size) + sdp->sd_inptrs; 624 bottom = (__be64 *)(bh->b_data + mh_size) + sdp->sd_inptrs;
625 } 625 }
626 626
627 error = bc(ip, dibh, bh, top, bottom, height, data); 627 error = bc(ip, dibh, bh, top, bottom, height, data);
@@ -660,7 +660,7 @@ out:
660 */ 660 */
661 661
662static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh, 662static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh,
663 struct buffer_head *bh, u64 *top, u64 *bottom, 663 struct buffer_head *bh, __be64 *top, __be64 *bottom,
664 unsigned int height, void *data) 664 unsigned int height, void *data)
665{ 665{
666 struct strip_mine *sm = data; 666 struct strip_mine *sm = data;
@@ -668,7 +668,7 @@ static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh,
668 struct gfs2_rgrp_list rlist; 668 struct gfs2_rgrp_list rlist;
669 u64 bn, bstart; 669 u64 bn, bstart;
670 u32 blen; 670 u32 blen;
671 u64 *p; 671 __be64 *p;
672 unsigned int rg_blocks = 0; 672 unsigned int rg_blocks = 0;
673 int metadata; 673 int metadata;
674 unsigned int revokes = 0; 674 unsigned int revokes = 0;