cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Andrew Price <anprice@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 6/8] Remove GFS2_HAS_RG_RI_FIELDS conditionals
Date: Mon, 19 Apr 2021 20:11:15 +0100	[thread overview]
Message-ID: <20210419191117.297653-7-anprice@redhat.com> (raw)
In-Reply-To: <20210419191117.297653-1-anprice@redhat.com>

Our own gfs2_ondisk.h has the new rgrp fields so there's no need for
these conditionals.

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 configure.ac          | 2 --
 gfs2/libgfs2/meta.c   | 2 --
 gfs2/libgfs2/ondisk.c | 8 --------
 gfs2/libgfs2/rgrp.c   | 6 ------
 4 files changed, 18 deletions(-)

diff --git a/configure.ac b/configure.ac
index 31cb3e49..e356199c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -126,8 +126,6 @@ AC_SUBST([udevdir], [$with_udevdir])
 AC_CHECK_HEADERS([fcntl.h libintl.h limits.h locale.h mntent.h stddef.h sys/file.h sys/ioctl.h sys/mount.h sys/time.h sys/vfs.h syslog.h termios.h])
 AC_CHECK_HEADER([linux/fs.h], [], [AC_MSG_ERROR([Unable to find linux/fs.h])])
 AC_CHECK_HEADER([linux/limits.h], [], [AC_MSG_ERROR([Unable to find linux/limits.h])])
-AC_CHECK_MEMBER([struct gfs2_rgrp.rg_data0],[AC_DEFINE([GFS2_HAS_RG_RI_FIELDS],[],[Resource group fields duplicated from the rindex])],
-                [], [[#include <linux/gfs2_ondisk.h>]])
 AC_CHECK_MEMBER([struct gfs2_log_header.lh_crc],[AC_DEFINE([GFS2_HAS_LH_V2],[],[v2 log header format])],
                 [], [[#include <linux/gfs2_ondisk.h>]])
 
diff --git a/gfs2/libgfs2/meta.c b/gfs2/libgfs2/meta.c
index c209c70a..771b1f13 100644
--- a/gfs2/libgfs2/meta.c
+++ b/gfs2/libgfs2/meta.c
@@ -227,12 +227,10 @@ F(rg_free, .flags = LGFS2_MFF_FSBLOCKS)
 F(rg_dinodes, .flags = LGFS2_MFF_FSBLOCKS)
 FP(rg_skip, .points_to = (1 << LGFS2_MT_GFS2_RGRP))
 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)
 F(rg_crc, .flags = LGFS2_MFF_CHECK)
-#endif
 RF(rg_reserved)
 };
 
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index cf81005e..157f3358 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -210,12 +210,10 @@ void gfs2_rgrp_in(struct gfs2_rgrp *rg, char *buf)
 	CPIN_32(rg, str, rg_dinodes);
 	CPIN_32(rg, str, rg_skip);
 	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_32(rg, str, rg_crc);
-#endif
 	CPIN_08(rg, str, rg_reserved, sizeof(rg->rg_reserved));
 }
 
@@ -229,15 +227,11 @@ void gfs2_rgrp_out(const struct gfs2_rgrp *rg, char *buf)
 	CPOUT_32(rg, str, rg_dinodes);
 	CPOUT_32(rg, str, rg_skip);
 	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, sizeof(rg->rg_reserved));
 	lgfs2_rgrp_crc_set(buf);
-#else
-	CPOUT_08(rg, str, rg_reserved, sizeof(rg->rg_reserved));
-#endif
 }
 
 void gfs2_rgrp_print(const struct gfs2_rgrp *rg)
@@ -248,12 +242,10 @@ void gfs2_rgrp_print(const struct gfs2_rgrp *rg)
 	pv(rg, rg_dinodes, "%u", "0x%x");
 	pv(rg, rg_skip, "%u", "0x%x");
 	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");
 	pv(rg, rg_crc, "%u", "0x%x");
-#endif
 }
 
 void gfs2_quota_in(struct gfs2_quota *qu, char *buf)
diff --git a/gfs2/libgfs2/rgrp.c b/gfs2/libgfs2/rgrp.c
index f5eb88c9..aa5eadf2 100644
--- a/gfs2/libgfs2/rgrp.c
+++ b/gfs2/libgfs2/rgrp.c
@@ -156,7 +156,6 @@ void lgfs2_rgrp_bitbuf_free(lgfs2_rgrp_t rg)
 int lgfs2_rgrp_crc_check(char *buf)
 {
 	int ret = 0;
-#ifdef GFS2_HAS_RG_RI_FIELDS
 	struct gfs2_rgrp *rg = (struct gfs2_rgrp *)buf;
 	uint32_t crc = rg->rg_crc;
 
@@ -167,7 +166,6 @@ int lgfs2_rgrp_crc_check(char *buf)
 	if (be32_to_cpu(crc) != gfs2_disk_hash(buf, sizeof(struct gfs2_rgrp)))
 		ret = 1;
 	rg->rg_crc = crc;
-#endif
 	return ret;
 }
 
@@ -176,14 +174,12 @@ int lgfs2_rgrp_crc_check(char *buf)
  */
 void lgfs2_rgrp_crc_set(char *buf)
 {
-#ifdef GFS2_HAS_RG_RI_FIELDS
 	struct gfs2_rgrp *rg = (struct gfs2_rgrp *)buf;
 	uint32_t crc;
 
 	rg->rg_crc = 0;
 	crc = gfs2_disk_hash(buf, sizeof(struct gfs2_rgrp));
 	rg->rg_crc = cpu_to_be32(crc);
-#endif
 }
 
 /**
@@ -674,12 +670,10 @@ lgfs2_rgrp_t lgfs2_rgrps_append(lgfs2_rgrps_t rgs, struct gfs2_rindex *entry, ui
 	rg->rg.rg_header.mh_format = GFS2_FORMAT_RG;
 	rg->rg.rg_free = rg->ri.ri_data;
 	rg->rg.rg_skip = rg_skip;
-#ifdef GFS2_HAS_RG_RI_FIELDS
 	rg->rg.rg_data0 = rg->ri.ri_data0;
 	rg->rg.rg_data = rg->ri.ri_data;
 	rg->rg.rg_bitbytes = rg->ri.ri_bitbytes;
 	rg->rg.rg_crc = 0;
-#endif
 	compute_bitmaps(rg, rgs->sdp->bsize);
 	rg->rgrps = rgs;
 	return rg;
-- 
2.30.2



  parent reply	other threads:[~2021-04-19 19:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19 19:11 [Cluster-devel] [PATCH v2 0/8] gfs2-utils: Import linux/gfs2_ondisk.h Andrew Price
2021-04-19 19:11 ` [Cluster-devel] [PATCH 1/8] " Andrew Price
2021-04-19 19:35   ` Andreas Gruenbacher
2021-04-19 20:47     ` Andrew Price
2021-04-20  6:00       ` Andreas Gruenbacher
2021-04-20  8:34         ` Andrew Price
2021-04-20  9:07           ` Andreas Gruenbacher
2021-04-20  9:47             ` Andrew Price
2021-04-19 19:11 ` [Cluster-devel] [PATCH 2/8] Remove HAS_UUID conditionals Andrew Price
2021-04-19 19:11 ` [Cluster-devel] [PATCH 3/8] Remove GFS2_HAS_LEAF_HINTS conditionals Andrew Price
2021-04-19 19:11 ` [Cluster-devel] [PATCH 4/8] Remove GFS2_HAS_DE_RAHEAD/COOKIE conditionals Andrew Price
2021-04-19 19:11 ` [Cluster-devel] [PATCH 5/8] Remove GFS2_HAS_RG_SKIP conditionals Andrew Price
2021-04-19 19:11 ` Andrew Price [this message]
2021-04-19 19:11 ` [Cluster-devel] [PATCH 7/8] Remove GFS2_HAS_LH_V2 conditionals Andrew Price
2021-04-19 19:11 ` [Cluster-devel] [PATCH 8/8] Use PRI* when printing gfs2 structures Andrew Price
2021-04-19 19:31 ` [Cluster-devel] [PATCH v2 0/8] gfs2-utils: Import linux/gfs2_ondisk.h Andreas Gruenbacher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210419191117.297653-7-anprice@redhat.com \
    --to=anprice@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).