From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Price Date: Mon, 19 Apr 2021 20:11:12 +0100 Subject: [Cluster-devel] [PATCH 3/8] Remove GFS2_HAS_LEAF_HINTS conditionals In-Reply-To: <20210419191117.297653-1-anprice@redhat.com> References: <20210419191117.297653-1-anprice@redhat.com> Message-ID: <20210419191117.297653-4-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 Our own gfs2_ondisk.h has leaf hints so there's no need for these conditionals. Signed-off-by: Andrew Price --- 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 ]]) AC_CHECK_MEMBER([struct gfs2_dirent.de_rahead],[AC_DEFINE([GFS2_HAS_DE_RAHEAD],[],[Dirent readahead field])], [], [[#include ]]) 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