diff options
Diffstat (limited to 'fs/gfs2/rgrp.c')
-rw-r--r-- | fs/gfs2/rgrp.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 4ae559694396..15c326ce13d1 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c | |||
@@ -956,8 +956,7 @@ static uint32_t rgblk_search(struct gfs2_rgrpd *rgd, uint32_t goal, | |||
956 | search in the first part of our first-searched bit block. */ | 956 | search in the first part of our first-searched bit block. */ |
957 | for (x = 0; x <= length; x++) { | 957 | for (x = 0; x <= length; x++) { |
958 | if (bi->bi_clone) | 958 | if (bi->bi_clone) |
959 | blk = gfs2_bitfit(rgd, | 959 | blk = gfs2_bitfit(rgd, bi->bi_clone + bi->bi_offset, |
960 | bi->bi_clone + bi->bi_offset, | ||
961 | bi->bi_len, goal, old_state); | 960 | bi->bi_len, goal, old_state); |
962 | else | 961 | else |
963 | blk = gfs2_bitfit(rgd, | 962 | blk = gfs2_bitfit(rgd, |
@@ -976,12 +975,10 @@ static uint32_t rgblk_search(struct gfs2_rgrpd *rgd, uint32_t goal, | |||
976 | blk = 0; | 975 | blk = 0; |
977 | 976 | ||
978 | gfs2_trans_add_bh(rgd->rd_gl, bi->bi_bh, 1); | 977 | gfs2_trans_add_bh(rgd->rd_gl, bi->bi_bh, 1); |
979 | gfs2_setbit(rgd, | 978 | gfs2_setbit(rgd, bi->bi_bh->b_data + bi->bi_offset, |
980 | bi->bi_bh->b_data + bi->bi_offset, | ||
981 | bi->bi_len, blk, new_state); | 979 | bi->bi_len, blk, new_state); |
982 | if (bi->bi_clone) | 980 | if (bi->bi_clone) |
983 | gfs2_setbit(rgd, | 981 | gfs2_setbit(rgd, bi->bi_clone + bi->bi_offset, |
984 | bi->bi_clone + bi->bi_offset, | ||
985 | bi->bi_len, blk, new_state); | 982 | bi->bi_len, blk, new_state); |
986 | 983 | ||
987 | return bi->bi_start * GFS2_NBBY + blk; | 984 | return bi->bi_start * GFS2_NBBY + blk; |
@@ -1064,8 +1061,7 @@ uint64_t gfs2_alloc_data(struct gfs2_inode *ip) | |||
1064 | else | 1061 | else |
1065 | goal = rgd->rd_last_alloc_data; | 1062 | goal = rgd->rd_last_alloc_data; |
1066 | 1063 | ||
1067 | blk = rgblk_search(rgd, goal, | 1064 | blk = rgblk_search(rgd, goal, GFS2_BLKST_FREE, GFS2_BLKST_USED); |
1068 | GFS2_BLKST_FREE, GFS2_BLKST_USED); | ||
1069 | rgd->rd_last_alloc_data = blk; | 1065 | rgd->rd_last_alloc_data = blk; |
1070 | 1066 | ||
1071 | block = rgd->rd_ri.ri_data0 + blk; | 1067 | block = rgd->rd_ri.ri_data0 + blk; |
@@ -1109,8 +1105,7 @@ uint64_t gfs2_alloc_meta(struct gfs2_inode *ip) | |||
1109 | else | 1105 | else |
1110 | goal = rgd->rd_last_alloc_meta; | 1106 | goal = rgd->rd_last_alloc_meta; |
1111 | 1107 | ||
1112 | blk = rgblk_search(rgd, goal, | 1108 | blk = rgblk_search(rgd, goal, GFS2_BLKST_FREE, GFS2_BLKST_USED); |
1113 | GFS2_BLKST_FREE, GFS2_BLKST_USED); | ||
1114 | rgd->rd_last_alloc_meta = blk; | 1109 | rgd->rd_last_alloc_meta = blk; |
1115 | 1110 | ||
1116 | block = rgd->rd_ri.ri_data0 + blk; | 1111 | block = rgd->rd_ri.ri_data0 + blk; |