diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2008-02-01 05:34:15 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2008-03-31 05:40:39 -0400 |
commit | ac576cc5bed0dd7759e2b196468c7df93d6aeeee (patch) | |
tree | dc3a36d5a3d8042f041ffe1381accb8af7dc5725 /fs/gfs2/rgrp.c | |
parent | ce276b06e8b81845926387e93f77bf81e14b5cc2 (diff) |
[GFS2] Merge the rd_last_alloc_meta and rd_last_alloc_data fields
We don't need to keep track of when we last allocated data
and metadata separately since the only thing thats important
when searching for a free block is whether its free or not,
which is independent from what type of block it is.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/rgrp.c')
-rw-r--r-- | fs/gfs2/rgrp.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 66193b45e50b..cc28845ba6fd 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c | |||
@@ -1422,11 +1422,11 @@ u64 gfs2_alloc_data(struct gfs2_inode *ip) | |||
1422 | if (rgrp_contains_block(rgd, ip->i_goal)) | 1422 | if (rgrp_contains_block(rgd, ip->i_goal)) |
1423 | goal = ip->i_goal - rgd->rd_data0; | 1423 | goal = ip->i_goal - rgd->rd_data0; |
1424 | else | 1424 | else |
1425 | goal = rgd->rd_last_alloc_data; | 1425 | goal = rgd->rd_last_alloc; |
1426 | 1426 | ||
1427 | blk = rgblk_search(rgd, goal, GFS2_BLKST_FREE, GFS2_BLKST_USED); | 1427 | blk = rgblk_search(rgd, goal, GFS2_BLKST_FREE, GFS2_BLKST_USED); |
1428 | BUG_ON(blk == BFITNOENT); | 1428 | BUG_ON(blk == BFITNOENT); |
1429 | rgd->rd_last_alloc_data = blk; | 1429 | rgd->rd_last_alloc = blk; |
1430 | 1430 | ||
1431 | block = rgd->rd_data0 + blk; | 1431 | block = rgd->rd_data0 + blk; |
1432 | ip->i_goal = block; | 1432 | ip->i_goal = block; |
@@ -1467,11 +1467,11 @@ u64 gfs2_alloc_meta(struct gfs2_inode *ip) | |||
1467 | if (rgrp_contains_block(rgd, ip->i_goal)) | 1467 | if (rgrp_contains_block(rgd, ip->i_goal)) |
1468 | goal = ip->i_goal - rgd->rd_data0; | 1468 | goal = ip->i_goal - rgd->rd_data0; |
1469 | else | 1469 | else |
1470 | goal = rgd->rd_last_alloc_meta; | 1470 | goal = rgd->rd_last_alloc; |
1471 | 1471 | ||
1472 | blk = rgblk_search(rgd, goal, GFS2_BLKST_FREE, GFS2_BLKST_USED); | 1472 | blk = rgblk_search(rgd, goal, GFS2_BLKST_FREE, GFS2_BLKST_USED); |
1473 | BUG_ON(blk == BFITNOENT); | 1473 | BUG_ON(blk == BFITNOENT); |
1474 | rgd->rd_last_alloc_meta = blk; | 1474 | rgd->rd_last_alloc = blk; |
1475 | 1475 | ||
1476 | block = rgd->rd_data0 + blk; | 1476 | block = rgd->rd_data0 + blk; |
1477 | ip->i_goal = block; | 1477 | ip->i_goal = block; |
@@ -1510,11 +1510,11 @@ u64 gfs2_alloc_di(struct gfs2_inode *dip, u64 *generation) | |||
1510 | u32 blk; | 1510 | u32 blk; |
1511 | u64 block; | 1511 | u64 block; |
1512 | 1512 | ||
1513 | blk = rgblk_search(rgd, rgd->rd_last_alloc_meta, | 1513 | blk = rgblk_search(rgd, rgd->rd_last_alloc, |
1514 | GFS2_BLKST_FREE, GFS2_BLKST_DINODE); | 1514 | GFS2_BLKST_FREE, GFS2_BLKST_DINODE); |
1515 | BUG_ON(blk == BFITNOENT); | 1515 | BUG_ON(blk == BFITNOENT); |
1516 | 1516 | ||
1517 | rgd->rd_last_alloc_meta = blk; | 1517 | rgd->rd_last_alloc = blk; |
1518 | 1518 | ||
1519 | block = rgd->rd_data0 + blk; | 1519 | block = rgd->rd_data0 + blk; |
1520 | 1520 | ||