Skip to contentSkip to conversation

convert all !XFS_RT stubs to inline functions

PATCH Applied Christoph Hellwig 3 participants 5 messages Sep 9 – Sep 11 XFS filesystem

lore
Share & tools
lore
#0 lore raw

Hi Carlos,

this is a fix for the ioctl cleanup series, which currently can cause a warning for !XFS_RT builds with some compiler versions.

If you end up rebasing the 7.4 tree, it might make sense to thread it in before that series.

#1 lore raw

PATCH 1/1 xfs: convert all !XFS_RT stubs to inline functions

Avoid random compiler warnings about unused variables when CONFIG_XFS_RT is not set.

---
 fs/xfs/xfs_rtalloc.h | 49 ++++++++++++++++++++++++++++++++++++++------
 1 file changed, 43 insertions(+), 6 deletions(-)
fs/xfs/xfs_rtalloc.h +43 -6
index 78a690b489ed..1d5108861acd 100644
@@ -46,10 +46,34 @@ int xfs_rtalloc_reinit_frextents(struct xfs_mount *mp);
 int xfs_growfs_check_rtgeom(const struct xfs_mount *mp, xfs_rfsblock_t dblocks,
 		xfs_rfsblock_t rblocks, xfs_agblock_t rextsize);
 #else
-# define xfs_growfs_rt(mp,in)				(-ENOSYS)
-# define xfs_rtalloc_reinit_frextents(m)		(0)
-# define xfs_rtmount_readsb(mp)				(0)
-# define xfs_rtmount_freesb(mp)				((void)0)
+static inline int
+xfs_growfs_rt(
+	struct xfs_mount	*mp,
+	struct xfs_growfs_rt	*in)
+{
+	return -ENOSYS;
+}
+
+static inline int
+xfs_rtalloc_reinit_frextents(
+	struct xfs_mount	*mp)
+{
+	return 0;
+}
+
+static inline int
+xfs_rtmount_readsb(
+	struct xfs_mount	*mp)
+{
+	return 0;
+}
+
+static inline void
+xfs_rtmount_freesb(
+	struct xfs_mount	*mp)
+{
+}
+
 static inline int		/* error */
 xfs_rtmount_init(
 	xfs_mount_t	*mp)	/* file system mount structure */
@@ -60,8 +84,21 @@ xfs_rtmount_init(
 	xfs_warn(mp, "Not built with CONFIG_XFS_RT");
 	return -ENOSYS;
 }
-# define xfs_rtmount_inodes(m)  (((mp)->m_sb.sb_rblocks == 0)? 0 : (-ENOSYS))
-# define xfs_rtunmount_inodes(m)
+
+static inline int
+xfs_rtmount_inodes(
+	struct xfs_mount	*mp)
+{
+	if (mp->m_sb.sb_rblocks)
+		return -ENOSYS;
+	return 0;
+}
+
+static inline void
+xfs_rtunmount_inodes(
+	struct xfs_mount	*mp)
+{
+}
 
 static inline int
 xfs_growfs_check_rtgeom(const struct xfs_mount *mp,
Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#2 lore raw

Re: [PATCH] xfs: convert all !XFS_RT stubs to inline functions

Quoted 4 lines · Christoph Hellwig

Avoid random compiler warnings about unused variables when CONFIG_XFS_RT is not set.

Seems fine to me.

--D

Quoted 75 lines
---
 fs/xfs/xfs_rtalloc.h | 49 ++++++++++++++++++++++++++++++++++++++------
 1 file changed, 43 insertions(+), 6 deletions(-)
fs/xfs/xfs_rtalloc.h +43 -6
index 78a690b489ed..1d5108861acd 100644
@@ -46,10 +46,34 @@ int xfs_rtalloc_reinit_frextents(struct xfs_mount *mp);
 int xfs_growfs_check_rtgeom(const struct xfs_mount *mp, xfs_rfsblock_t dblocks,
 		xfs_rfsblock_t rblocks, xfs_agblock_t rextsize);
 #else
-# define xfs_growfs_rt(mp,in)				(-ENOSYS)
-# define xfs_rtalloc_reinit_frextents(m)		(0)
-# define xfs_rtmount_readsb(mp)				(0)
-# define xfs_rtmount_freesb(mp)				((void)0)
+static inline int
+xfs_growfs_rt(
+	struct xfs_mount	*mp,
+	struct xfs_growfs_rt	*in)
+{
+	return -ENOSYS;
+}
+
+static inline int
+xfs_rtalloc_reinit_frextents(
+	struct xfs_mount	*mp)
+{
+	return 0;
+}
+
+static inline int
+xfs_rtmount_readsb(
+	struct xfs_mount	*mp)
+{
+	return 0;
+}
+
+static inline void
+xfs_rtmount_freesb(
+	struct xfs_mount	*mp)
+{
+}
+
 static inline int		/* error */
 xfs_rtmount_init(
 	xfs_mount_t	*mp)	/* file system mount structure */
@@ -60,8 +84,21 @@ xfs_rtmount_init(
 	xfs_warn(mp, "Not built with CONFIG_XFS_RT");
 	return -ENOSYS;
 }
-# define xfs_rtmount_inodes(m)  (((mp)->m_sb.sb_rblocks == 0)? 0 : (-ENOSYS))
-# define xfs_rtunmount_inodes(m)
+
+static inline int
+xfs_rtmount_inodes(
+	struct xfs_mount	*mp)
+{
+	if (mp->m_sb.sb_rblocks)
+		return -ENOSYS;
+	return 0;
+}
+
+static inline void
+xfs_rtunmount_inodes(
+	struct xfs_mount	*mp)
+{
+}
 
 static inline int
 xfs_growfs_check_rtgeom(const struct xfs_mount *mp,
Signature · 1 line
2.53.0
maintainer Reviewed-by on v1 1/1
#3 lore raw

Re: [PATCH] xfs: convert all !XFS_RT stubs to inline functions

In reply to Christoph Hellwig
Quoted 7 lines · Christoph Hellwig

Avoid random compiler warnings about unused variables when CONFIG_XFS_RT is not set.

---
 fs/xfs/xfs_rtalloc.h | 49 ++++++++++++++++++++++++++++++++++++++------
 1 file changed, 43 insertions(+), 6 deletions(-)

This looks good.

Regarding rebasing 7.4, we still have plenty of time to do that, I will do it once Linus pulls in the next fixes so it won't mess up with hashes on for-next. Then I can rebase 7.4 on top of the new -rc once the patches gets in.

Quoted 72 lines
fs/xfs/xfs_rtalloc.h +43 -6
index 78a690b489ed..1d5108861acd 100644
@@ -46,10 +46,34 @@ int xfs_rtalloc_reinit_frextents(struct xfs_mount *mp);
 int xfs_growfs_check_rtgeom(const struct xfs_mount *mp, xfs_rfsblock_t dblocks,
 		xfs_rfsblock_t rblocks, xfs_agblock_t rextsize);
 #else
-# define xfs_growfs_rt(mp,in)				(-ENOSYS)
-# define xfs_rtalloc_reinit_frextents(m)		(0)
-# define xfs_rtmount_readsb(mp)				(0)
-# define xfs_rtmount_freesb(mp)				((void)0)
+static inline int
+xfs_growfs_rt(
+	struct xfs_mount	*mp,
+	struct xfs_growfs_rt	*in)
+{
+	return -ENOSYS;
+}
+
+static inline int
+xfs_rtalloc_reinit_frextents(
+	struct xfs_mount	*mp)
+{
+	return 0;
+}
+
+static inline int
+xfs_rtmount_readsb(
+	struct xfs_mount	*mp)
+{
+	return 0;
+}
+
+static inline void
+xfs_rtmount_freesb(
+	struct xfs_mount	*mp)
+{
+}
+
 static inline int		/* error */
 xfs_rtmount_init(
 	xfs_mount_t	*mp)	/* file system mount structure */
@@ -60,8 +84,21 @@ xfs_rtmount_init(
 	xfs_warn(mp, "Not built with CONFIG_XFS_RT");
 	return -ENOSYS;
 }
-# define xfs_rtmount_inodes(m)  (((mp)->m_sb.sb_rblocks == 0)? 0 : (-ENOSYS))
-# define xfs_rtunmount_inodes(m)
+
+static inline int
+xfs_rtmount_inodes(
+	struct xfs_mount	*mp)
+{
+	if (mp->m_sb.sb_rblocks)
+		return -ENOSYS;
+	return 0;
+}
+
+static inline void
+xfs_rtunmount_inodes(
+	struct xfs_mount	*mp)
+{
+}
 
 static inline int
 xfs_growfs_check_rtgeom(const struct xfs_mount *mp,
Signature · 1 line
2.53.0
maintainer Applied
#4 lore raw

Re: [PATCH] xfs: convert all !XFS_RT stubs to inline functions

In reply to Christoph Hellwig
Quoted 4 lines · Christoph Hellwig

Avoid random compiler warnings about unused variables when CONFIG_XFS_RT is not set.

Applied to for-next, thanks!

[1/1] xfs: convert all !XFS_RT stubs to inline functions

      commit: ea089258eac7c53b593519a917d9f1671c632932

Best regards,

Signature · 1 line
Carlos Maiolino <[email protected]>