From 5363c39d58697be0d8d6cc5bf80f3b2627f64bb4 Mon Sep 17 00:00:00 2001 From: Allison Henderson Date: Wed, 22 Jun 2022 14:28:52 -0500 Subject: [PATCH] xfs: Add larp debug option Source kernel commit: 535e2f75c4e377e6ccc9d4396695b516d118f8f0 This patch adds a debug option to enable log attribute replay. Eventually this can be removed when delayed attrs becomes permanent. Signed-off-by: Allison Henderson Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner Signed-off-by: Eric Sandeen --- include/xfs_mount.h | 8 ++++++++ libxfs/util.c | 6 ++++++ libxfs/xfs_attr.h | 4 ++++ 3 files changed, 18 insertions(+) diff --git a/include/xfs_mount.h b/include/xfs_mount.h index bc99a4eac..7935e7ea1 100644 --- a/include/xfs_mount.h +++ b/include/xfs_mount.h @@ -269,4 +269,12 @@ extern void libxfs_rtmount_destroy (xfs_mount_t *); struct xfs_dquot { int q_type; }; + +struct xfs_globals { +#ifdef DEBUG + bool larp; /* log attribute replay */ +#endif +}; +extern struct xfs_globals xfs_globals; + #endif /* __XFS_MOUNT_H__ */ diff --git a/libxfs/util.c b/libxfs/util.c index ef01fcf85..e5e494772 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -720,4 +720,10 @@ xfs_fs_mark_healthy( spin_unlock(&mp->m_sb_lock); } +struct xfs_globals xfs_globals = { +#ifdef DEBUG + .larp = false, /* log attribute replay */ +#endif +}; + void xfs_ag_geom_health(struct xfs_perag *pag, struct xfs_ag_geometry *ageo) { } diff --git a/libxfs/xfs_attr.h b/libxfs/xfs_attr.h index 5331551d5..78884e826 100644 --- a/libxfs/xfs_attr.h +++ b/libxfs/xfs_attr.h @@ -30,7 +30,11 @@ struct xfs_attr_list_context; static inline bool xfs_has_larp(struct xfs_mount *mp) { +#ifdef DEBUG + return xfs_globals.larp; +#else return false; +#endif } /* -- 2.47.2