Commit ac576cc5 authored by Steven Whitehouse's avatar Steven Whitehouse

[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: default avatarSteven Whitehouse <swhiteho@redhat.com>
parent ce276b06
...@@ -90,8 +90,7 @@ struct gfs2_rgrpd { ...@@ -90,8 +90,7 @@ struct gfs2_rgrpd {
struct mutex rd_mutex; struct mutex rd_mutex;
u32 rd_free_clone; u32 rd_free_clone;
struct gfs2_log_element rd_le; struct gfs2_log_element rd_le;
u32 rd_last_alloc_data; u32 rd_last_alloc;
u32 rd_last_alloc_meta;
struct gfs2_sbd *rd_sbd; struct gfs2_sbd *rd_sbd;
unsigned char rd_flags; unsigned char rd_flags;
#define GFS2_RDF_CHECK 0x01 /* Need to check for unlinked inodes */ #define GFS2_RDF_CHECK 0x01 /* Need to check for unlinked inodes */
......
...@@ -1422,11 +1422,11 @@ u64 gfs2_alloc_data(struct gfs2_inode *ip) ...@@ -1422,11 +1422,11 @@ u64 gfs2_alloc_data(struct gfs2_inode *ip)
if (rgrp_contains_block(rgd, ip->i_goal)) if (rgrp_contains_block(rgd, ip->i_goal))
goal = ip->i_goal - rgd->rd_data0; goal = ip->i_goal - rgd->rd_data0;
else else
goal = rgd->rd_last_alloc_data; goal = rgd->rd_last_alloc;
blk = rgblk_search(rgd, goal, GFS2_BLKST_FREE, GFS2_BLKST_USED); blk = rgblk_search(rgd, goal, GFS2_BLKST_FREE, GFS2_BLKST_USED);
BUG_ON(blk == BFITNOENT); BUG_ON(blk == BFITNOENT);
rgd->rd_last_alloc_data = blk; rgd->rd_last_alloc = blk;
block = rgd->rd_data0 + blk; block = rgd->rd_data0 + blk;
ip->i_goal = block; ip->i_goal = block;
...@@ -1467,11 +1467,11 @@ u64 gfs2_alloc_meta(struct gfs2_inode *ip) ...@@ -1467,11 +1467,11 @@ u64 gfs2_alloc_meta(struct gfs2_inode *ip)
if (rgrp_contains_block(rgd, ip->i_goal)) if (rgrp_contains_block(rgd, ip->i_goal))
goal = ip->i_goal - rgd->rd_data0; goal = ip->i_goal - rgd->rd_data0;
else else
goal = rgd->rd_last_alloc_meta; goal = rgd->rd_last_alloc;
blk = rgblk_search(rgd, goal, GFS2_BLKST_FREE, GFS2_BLKST_USED); blk = rgblk_search(rgd, goal, GFS2_BLKST_FREE, GFS2_BLKST_USED);
BUG_ON(blk == BFITNOENT); BUG_ON(blk == BFITNOENT);
rgd->rd_last_alloc_meta = blk; rgd->rd_last_alloc = blk;
block = rgd->rd_data0 + blk; block = rgd->rd_data0 + blk;
ip->i_goal = block; ip->i_goal = block;
...@@ -1510,11 +1510,11 @@ u64 gfs2_alloc_di(struct gfs2_inode *dip, u64 *generation) ...@@ -1510,11 +1510,11 @@ u64 gfs2_alloc_di(struct gfs2_inode *dip, u64 *generation)
u32 blk; u32 blk;
u64 block; u64 block;
blk = rgblk_search(rgd, rgd->rd_last_alloc_meta, blk = rgblk_search(rgd, rgd->rd_last_alloc,
GFS2_BLKST_FREE, GFS2_BLKST_DINODE); GFS2_BLKST_FREE, GFS2_BLKST_DINODE);
BUG_ON(blk == BFITNOENT); BUG_ON(blk == BFITNOENT);
rgd->rd_last_alloc_meta = blk; rgd->rd_last_alloc = blk;
block = rgd->rd_data0 + blk; block = rgd->rd_data0 + blk;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment