diff options
Diffstat (limited to 'fs/gfs2/bmap.c')
-rw-r--r-- | fs/gfs2/bmap.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 913c0e5490e9..b75a2f93dada 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c | |||
@@ -94,7 +94,7 @@ static int gfs2_unstuffer_page(struct gfs2_inode *ip, struct buffer_head *dibh, | |||
94 | map_bh(bh, inode->i_sb, block); | 94 | map_bh(bh, inode->i_sb, block); |
95 | 95 | ||
96 | set_buffer_uptodate(bh); | 96 | set_buffer_uptodate(bh); |
97 | if ((sdp->sd_args.ar_data == GFS2_DATA_ORDERED) || gfs2_is_jdata(ip)) | 97 | if (sdp->sd_args.ar_data == GFS2_DATA_ORDERED || gfs2_is_jdata(ip)) |
98 | gfs2_trans_add_bh(ip->i_gl, bh, 0); | 98 | gfs2_trans_add_bh(ip->i_gl, bh, 0); |
99 | mark_buffer_dirty(bh); | 99 | mark_buffer_dirty(bh); |
100 | 100 | ||
@@ -369,7 +369,7 @@ static inline u64 *metapointer(struct buffer_head *bh, int *boundary, | |||
369 | u64 *ptr; | 369 | u64 *ptr; |
370 | *boundary = 0; | 370 | *boundary = 0; |
371 | ptr = ((u64 *)(bh->b_data + head_size)) + mp->mp_list[height]; | 371 | ptr = ((u64 *)(bh->b_data + head_size)) + mp->mp_list[height]; |
372 | if (ptr + 1 == (u64*)(bh->b_data + bh->b_size)) | 372 | if (ptr + 1 == (u64 *)(bh->b_data + bh->b_size)) |
373 | *boundary = 1; | 373 | *boundary = 1; |
374 | return ptr; | 374 | return ptr; |
375 | } | 375 | } |
@@ -456,7 +456,7 @@ static struct buffer_head *gfs2_block_pointers(struct inode *inode, u64 lblock, | |||
456 | if (gfs2_assert_warn(sdp, !gfs2_is_stuffed(ip))) | 456 | if (gfs2_assert_warn(sdp, !gfs2_is_stuffed(ip))) |
457 | goto out; | 457 | goto out; |
458 | 458 | ||
459 | bsize = (gfs2_is_dir(ip)) ? sdp->sd_jbsize : sdp->sd_sb.sb_bsize; | 459 | bsize = gfs2_is_dir(ip) ? sdp->sd_jbsize : sdp->sd_sb.sb_bsize; |
460 | 460 | ||
461 | height = calc_tree_height(ip, (lblock + 1) * bsize); | 461 | height = calc_tree_height(ip, (lblock + 1) * bsize); |
462 | if (ip->i_di.di_height < height) { | 462 | if (ip->i_di.di_height < height) { |
@@ -554,7 +554,7 @@ int gfs2_extent_map(struct inode *inode, u64 lblock, int *new, u64 *dblock, unsi | |||
554 | bh = gfs2_block_pointers(inode, lblock, new, dblock, &boundary, &mp); | 554 | bh = gfs2_block_pointers(inode, lblock, new, dblock, &boundary, &mp); |
555 | *extlen = 1; | 555 | *extlen = 1; |
556 | 556 | ||
557 | if (bh && !IS_ERR(bh) && *dblock && !*new) { | 557 | if (bh != NULL && !IS_ERR(bh) && *dblock != 0 && *new == 0) { |
558 | u64 tmp_dblock; | 558 | u64 tmp_dblock; |
559 | int tmp_new; | 559 | int tmp_new; |
560 | unsigned int nptrs; | 560 | unsigned int nptrs; |
@@ -565,7 +565,7 @@ int gfs2_extent_map(struct inode *inode, u64 lblock, int *new, u64 *dblock, unsi | |||
565 | lookup_block(ip, bh, end_of_metadata, &mp, 0, &tmp_new, &tmp_dblock); | 565 | lookup_block(ip, bh, end_of_metadata, &mp, 0, &tmp_new, &tmp_dblock); |
566 | if (*dblock + *extlen != tmp_dblock) | 566 | if (*dblock + *extlen != tmp_dblock) |
567 | break; | 567 | break; |
568 | (*extlen)++; | 568 | ++*extlen; |
569 | } | 569 | } |
570 | } | 570 | } |
571 | bmap_unlock(inode, create); | 571 | bmap_unlock(inode, create); |
@@ -612,10 +612,8 @@ static int recursive_scan(struct gfs2_inode *ip, struct buffer_head *dibh, | |||
612 | return error; | 612 | return error; |
613 | dibh = bh; | 613 | dibh = bh; |
614 | 614 | ||
615 | top = (uint64_t *)(bh->b_data + sizeof(struct gfs2_dinode)) + | 615 | top = (u64 *)(bh->b_data + sizeof(struct gfs2_dinode)) + mp->mp_list[0]; |
616 | mp->mp_list[0]; | 616 | bottom = (u64 *)(bh->b_data + sizeof(struct gfs2_dinode)) + sdp->sd_diptrs; |
617 | bottom = (uint64_t *)(bh->b_data + sizeof(struct gfs2_dinode)) + | ||
618 | sdp->sd_diptrs; | ||
619 | } else { | 617 | } else { |
620 | error = gfs2_meta_indirect_buffer(ip, height, block, 0, &bh); | 618 | error = gfs2_meta_indirect_buffer(ip, height, block, 0, &bh); |
621 | if (error) | 619 | if (error) |