From: Andrew Price Date: Fri, 8 Dec 2017 15:10:54 +0000 Subject: [Cluster-devel] [PATCH v2 6/8] libgfs2: Add support for rg_data0, rg_data and rg_bitbytes In-Reply-To: <20171208151056.18232-1-anprice@redhat.com> References: <20171208151056.18232-1-anprice@redhat.com> Message-ID: <20171208151056.18232-7-anprice@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Signed-off-by: Andrew Price --- gfs2/libgfs2/meta.c | 5 +++++ gfs2/libgfs2/ondisk.c | 21 +++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/gfs2/libgfs2/meta.c b/gfs2/libgfs2/meta.c index be91f0cc..1b771f30 100644 --- a/gfs2/libgfs2/meta.c +++ b/gfs2/libgfs2/meta.c @@ -207,6 +207,11 @@ FP(rg_skip, .points_to = (1 << LGFS2_MT_GFS2_RGRP)) RF(__pad) #endif F(rg_igeneration) +#ifdef GFS2_HAS_RG_RI_FIELDS +FP(rg_data0, .points_to = ANY_GFS2_BLOCK|(1 << LGFS2_MT_FREE)) +F(rg_data, .flags = LGFS2_MFF_FSBLOCKS) +F(rg_bitbytes, .flags = LGFS2_MFF_BYTES) +#endif RF(rg_reserved) }; diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c index b5c62114..fd25a860 100644 --- a/gfs2/libgfs2/ondisk.c +++ b/gfs2/libgfs2/ondisk.c @@ -233,8 +233,14 @@ void gfs2_rgrp_in(struct gfs2_rgrp *rg, struct gfs2_buffer_head *bh) CPIN_32(rg, str, __pad); #endif CPIN_64(rg, str, rg_igeneration); - +#ifdef GFS2_HAS_RG_RI_FIELDS + CPIN_64(rg, str, rg_data0); + CPIN_32(rg, str, rg_data); + CPIN_32(rg, str, rg_bitbytes); + CPIN_08(rg, str, rg_reserved, 64); +#else CPIN_08(rg, str, rg_reserved, 80); +#endif } void gfs2_rgrp_out(const struct gfs2_rgrp *rg, char *buf) @@ -251,8 +257,14 @@ void gfs2_rgrp_out(const struct gfs2_rgrp *rg, char *buf) CPOUT_32(rg, str, __pad); #endif CPOUT_64(rg, str, rg_igeneration); - +#ifdef GFS2_HAS_RG_RI_FIELDS + CPOUT_64(rg, str, rg_data0); + CPOUT_32(rg, str, rg_data); + CPOUT_32(rg, str, rg_bitbytes); + CPOUT_08(rg, str, rg_reserved, 64); +#else CPOUT_08(rg, str, rg_reserved, 80); +#endif } void gfs2_rgrp_out_bh(const struct gfs2_rgrp *rg, struct gfs2_buffer_head *bh) @@ -273,6 +285,11 @@ void gfs2_rgrp_print(const struct gfs2_rgrp *rg) pv(rg, __pad, "%u", "0x%x"); #endif pv(rg, rg_igeneration, "%llu", "0x%llx"); +#ifdef GFS2_HAS_RG_RI_FIELDS + pv(rg, rg_data0, "%llu", "0x%llx"); + pv(rg, rg_data, "%u", "0x%x"); + pv(rg, rg_bitbytes, "%u", "0x%x"); +#endif } void gfs2_quota_in(struct gfs2_quota *qu, char *buf) -- 2.13.6