aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/rgrp.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-05-05 16:59:11 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-05-05 16:59:11 -0400
commitfd88de569b802c4a04aaa6ee74667775f4aed8c6 (patch)
tree1766c45303798bf289059afc8f117cf8bc784086 /fs/gfs2/rgrp.c
parent5bb76af1e089ac186c15c6aa792340d22b63d4b4 (diff)
[GFS2] Readpages support
This adds readpages support (and also corrects a small bug in the readpage error path at the same time). Hopefully this will improve performance by allowing GFS to submit larger lumps of I/O at a time. In order to simplify the setting of BH_Boundary, it currently gets set when we hit the end of a indirect pointer block. There is always a boundary at this point with the current allocation code. It doesn't get all the boundaries right though, so there is still room for improvement in this. See comments in fs/gfs2/ops_address.c for further information about readpages with GFS2. Signed-off-by: Steven Whitehouse
Diffstat (limited to 'fs/gfs2/rgrp.c')
-rw-r--r--fs/gfs2/rgrp.c15
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;