[PATCH] xfs: expose no-op xfs_put_perag()

From: Denys Vlasenko
Date: Tue Apr 22 2008 - 09:47:47 EST


Hi David,

Inline function xfs_put_perag() in fs/xfs/xfs_mount.h is a no-op.

This patch converts it to no-op macro.

As a result, gcc will emit warning about unused variables,
parameters and so on not in this function, but in its callers,
which is more useful.

This patch, together with previous ones, has already resulted
in more unused params discovered and warned about by gcc.

There is no object code size difference from this change.

Compile tested only.

Signed-off-by: Denys Vlasenko <vda.linux@xxxxxxxxxxxxxx>
--
vda
diff -urpN linux-2.6-xfs5/fs/xfs/xfs_mount.h linux-2.6-xfs6/fs/xfs/xfs_mount.h
--- linux-2.6-xfs5/fs/xfs/xfs_mount.h 2008-04-22 04:06:44.000000000 +0200
+++ linux-2.6-xfs6/fs/xfs/xfs_mount.h 2008-04-22 12:13:17.000000000 +0200
@@ -471,11 +471,17 @@ xfs_get_perag(struct xfs_mount *mp, xfs_
return &mp->m_perag[XFS_INO_TO_AGNO(mp, ino)];
}

+/* Macro (instead of inline) makes gcc understand that params are not used
+ * and emit "unused" warnings *in callers* if they otherwise are not using
+ * variables passed to xfs_put_perag. We want to know that. */
+#define xfs_put_perag(mp, pag) ((void)0)
+#if 0
static inline void
xfs_put_perag(struct xfs_mount *mp, xfs_perag_t *pag)
{
/* nothing to see here, move along */
}
+#endif

/*
* Per-cpu superblock locking functions