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 3/8] Remove GFS2_HAS_LEAF_HINTS conditionals
Date: Mon, 19 Apr 2021 20:11:12 +0100	[thread overview]
Message-ID: <20210419191117.297653-4-anprice@redhat.com> (raw)
In-Reply-To: <20210419191117.297653-1-anprice@redhat.com>

Our own gfs2_ondisk.h has leaf hints so there's no need for these
conditionals.

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 configure.ac          |  2 --
 gfs2/edit/extended.c  |  9 ++-------
 gfs2/libgfs2/fs_ops.c |  6 ------
 gfs2/libgfs2/ondisk.c | 10 ----------
 4 files changed, 2 insertions(+), 25 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8c60741d..5cb0770f 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_leaf.lf_inode],[AC_DEFINE([GFS2_HAS_LEAF_HINTS],[],[Leaf block hints])],
-                [], [[#include <linux/gfs2_ondisk.h>]])
 AC_CHECK_MEMBER([struct gfs2_dirent.de_rahead],[AC_DEFINE([GFS2_HAS_DE_RAHEAD],[],[Dirent readahead field])],
                 [], [[#include <linux/gfs2_ondisk.h>]])
 AC_CHECK_MEMBER([struct gfs2_dirent.de_cookie],[AC_DEFINE([GFS2_HAS_DE_COOKIE],[],[Dirent cookie field])],
diff --git a/gfs2/edit/extended.c b/gfs2/edit/extended.c
index 64e4d31f..b8c61ee1 100644
--- a/gfs2/edit/extended.c
+++ b/gfs2/edit/extended.c
@@ -294,14 +294,9 @@ static void print_inode_type(__be16 de_type)
 	}
 }
 
-#ifdef GFS2_HAS_LEAF_HINTS
-#define LEAF_HINT_FMTS "lf_inode: 0x%llx, lf_dist: %u, " \
-                       "lf_nsec: %u, lf_sec: %llu, "
+#define LEAF_HINT_FMTS "lf_inode: 0x%"PRIx64", lf_dist: %"PRIu32", " \
+                       "lf_nsec: %"PRIu32", lf_sec: %"PRIu64", "
 #define LEAF_HINT_FIELDS(lp) lp->lf_inode, lp->lf_dist, lp->lf_nsec, lp->lf_sec,
-#else
-#define LEAF_HINT_FMTS
-#define LEAF_HINT_FIELDS(lp)
-#endif
 
 static int display_leaf(struct iinfo *ind)
 {
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index 1c580081..27fb43cb 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -1001,9 +1001,7 @@ void dir_split_leaf(struct gfs2_inode *dip, uint32_t start, uint64_t leaf_no,
 	oleaf->lf_depth = cpu_to_be16(oleaf->lf_depth);
 	nleaf->lf_depth = oleaf->lf_depth;
 
-#ifdef GFS2_HAS_LEAF_HINTS
 	nleaf->lf_inode = cpu_to_be64(dip->i_di.di_num.no_addr);
-#endif
 	dip->i_di.di_blocks++;
 	bmodified(dip->i_bh);
 
@@ -1203,9 +1201,7 @@ restart:
 				nleaf = (struct gfs2_leaf *)nbh->b_data;
 				nleaf->lf_depth = leaf->lf_depth;
 				nleaf->lf_dirent_format = cpu_to_be32(GFS2_FORMAT_DE);
-#ifdef GFS2_HAS_LEAF_HINTS
 				nleaf->lf_inode = cpu_to_be64(dip->i_di.di_num.no_addr);
-#endif
 				err = dirent_alloc(dip, nbh, len, &dent);
 				if (err)
 					return err;
@@ -1257,9 +1253,7 @@ static void dir_make_exhash(struct gfs2_inode *dip)
 	leaf = (struct gfs2_leaf *)bh->b_data;
 	leaf->lf_dirent_format = cpu_to_be32(GFS2_FORMAT_DE);
 	leaf->lf_entries = cpu_to_be16(dip->i_di.di_entries);
-#ifdef GFS2_HAS_LEAF_HINTS
 	leaf->lf_inode = cpu_to_be64(dip->i_di.di_num.no_addr);
-#endif
 	buffer_copy_tail(sdp, bh, sizeof(struct gfs2_leaf),
 			 dip->i_bh, sizeof(struct gfs2_dinode));
 
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index 2185fd38..dffd2221 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -448,15 +448,11 @@ void gfs2_leaf_in(struct gfs2_leaf *lf, char *buf)
 	CPIN_16(lf, str, lf_entries);
 	CPIN_32(lf, str, lf_dirent_format);
 	CPIN_64(lf, str, lf_next);
-#ifdef GFS2_HAS_LEAF_HINTS
 	CPIN_64(lf, str, lf_inode);
 	CPIN_32(lf, str, lf_dist);
 	CPIN_32(lf, str, lf_nsec);
 	CPIN_64(lf, str, lf_sec);
 	CPIN_08(lf, str, lf_reserved2, 40);
-#else
-	CPIN_08(lf, str, lf_reserved, 32);
-#endif
 }
 
 void gfs2_leaf_out(struct gfs2_leaf *lf, char *buf)
@@ -468,15 +464,11 @@ void gfs2_leaf_out(struct gfs2_leaf *lf, char *buf)
 	CPOUT_16(lf, str, lf_entries);
 	CPOUT_32(lf, str, lf_dirent_format);
 	CPOUT_64(lf, str, lf_next);
-#ifdef GFS2_HAS_LEAF_HINTS
 	CPOUT_64(lf, str, lf_inode);
 	CPOUT_32(lf, str, lf_dist);
 	CPOUT_32(lf, str, lf_nsec);
 	CPOUT_64(lf, str, lf_sec);
 	CPOUT_08(lf, str, lf_reserved2, 40);
-#else
-	CPOUT_08(lf, str, lf_reserved, 64);
-#endif
 }
 
 void gfs2_leaf_print(const struct gfs2_leaf *lf)
@@ -486,12 +478,10 @@ void gfs2_leaf_print(const struct gfs2_leaf *lf)
 	pv(lf, lf_entries, "%u", "0x%x");
 	pv(lf, lf_dirent_format, "%u", "0x%x");
 	pv(lf, lf_next, "%llu", "0x%llx");
-#ifdef GFS2_HAS_LEAF_HINTS
 	pv(lf, lf_inode, "%llu", "0x%llx");
 	pv(lf, lf_dist, "%u", "0x%x");
 	pv(lf, lf_nsec, "%u", "0x%x");
 	pv(lf, lf_sec, "%llu", "0x%llx");
-#endif
 }
 
 void gfs2_ea_header_in(struct gfs2_ea_header *ea, char *buf)
-- 
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 ` Andrew Price [this message]
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 ` [Cluster-devel] [PATCH 6/8] Remove GFS2_HAS_RG_RI_FIELDS conditionals Andrew Price
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-4-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).