GFS2: Move rg_igeneration into struct gfs2_rgrpd

This moves one of the fields of struct gfs2_rgrpd_host into
the struct gfs2_rgrpd with the eventual aim of removing
the struct rgrpd_host completely.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
This commit is contained in:
Steven Whitehouse 2008-11-04 10:19:03 +00:00
parent 383f01fbf4
commit d8b71f7381
2 changed files with 4 additions and 4 deletions

View File

@ -71,7 +71,6 @@ struct gfs2_bitmap {
struct gfs2_rgrp_host { struct gfs2_rgrp_host {
u32 rg_free; u32 rg_free;
u32 rg_dinodes; u32 rg_dinodes;
u64 rg_igeneration;
}; };
struct gfs2_rgrpd { struct gfs2_rgrpd {
@ -84,6 +83,7 @@ struct gfs2_rgrpd {
u32 rd_data; /* num of data blocks in rgrp */ u32 rd_data; /* num of data blocks in rgrp */
u32 rd_bitbytes; /* number of bytes in data bitmaps */ u32 rd_bitbytes; /* number of bytes in data bitmaps */
struct gfs2_rgrp_host rd_rg; struct gfs2_rgrp_host rd_rg;
u64 rd_igeneration;
struct gfs2_bitmap *rd_bits; struct gfs2_bitmap *rd_bits;
unsigned int rd_bh_count; unsigned int rd_bh_count;
struct mutex rd_mutex; struct mutex rd_mutex;

View File

@ -702,7 +702,7 @@ static void gfs2_rgrp_in(struct gfs2_rgrpd *rgd, const void *buf)
rgd->rd_flags &= ~GFS2_RDF_NOALLOC; rgd->rd_flags &= ~GFS2_RDF_NOALLOC;
rg->rg_free = be32_to_cpu(str->rg_free); rg->rg_free = be32_to_cpu(str->rg_free);
rg->rg_dinodes = be32_to_cpu(str->rg_dinodes); rg->rg_dinodes = be32_to_cpu(str->rg_dinodes);
rg->rg_igeneration = be64_to_cpu(str->rg_igeneration); rgd->rd_igeneration = be64_to_cpu(str->rg_igeneration);
} }
static void gfs2_rgrp_out(struct gfs2_rgrpd *rgd, void *buf) static void gfs2_rgrp_out(struct gfs2_rgrpd *rgd, void *buf)
@ -717,7 +717,7 @@ static void gfs2_rgrp_out(struct gfs2_rgrpd *rgd, void *buf)
str->rg_free = cpu_to_be32(rg->rg_free); str->rg_free = cpu_to_be32(rg->rg_free);
str->rg_dinodes = cpu_to_be32(rg->rg_dinodes); str->rg_dinodes = cpu_to_be32(rg->rg_dinodes);
str->__pad = cpu_to_be32(0); str->__pad = cpu_to_be32(0);
str->rg_igeneration = cpu_to_be64(rg->rg_igeneration); str->rg_igeneration = cpu_to_be64(rgd->rd_igeneration);
memset(&str->rg_reserved, 0, sizeof(str->rg_reserved)); memset(&str->rg_reserved, 0, sizeof(str->rg_reserved));
} }
@ -1448,7 +1448,7 @@ u64 gfs2_alloc_di(struct gfs2_inode *dip, u64 *generation)
gfs2_assert_withdraw(sdp, rgd->rd_rg.rg_free); gfs2_assert_withdraw(sdp, rgd->rd_rg.rg_free);
rgd->rd_rg.rg_free--; rgd->rd_rg.rg_free--;
rgd->rd_rg.rg_dinodes++; rgd->rd_rg.rg_dinodes++;
*generation = rgd->rd_rg.rg_igeneration++; *generation = rgd->rd_igeneration++;
gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1); gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1);
gfs2_rgrp_out(rgd, rgd->rd_bits[0].bi_bh->b_data); gfs2_rgrp_out(rgd, rgd->rd_bits[0].bi_bh->b_data);