[Cluster-devel] [PATCH v2 6/8] libgfs2: Add support for rg_data0, rg_data and rg_bitbytes

Andrew Price anprice at redhat.com
Fri Dec 8 15:10:54 UTC 2017


Signed-off-by: Andrew Price <anprice at redhat.com>
---
 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




More information about the Cluster-devel mailing list