Eric Sandeen wrote:
Defining XFS_DM_EVENT* macros to 0 in the absence of
CONFIG_XFS_DMAPI allows gcc to optimize away tests that
should never be true. Also wrap one hunk of xfs_unmount
in #ifdef CONFIG_XFS_DMAPI
Good idea Eric. A few remarks and a question below.
+#ifdef CONFIG_XFS_DMAPI
CONFIG_XFS_DMAPI is only defined when the DMAPI is statically linked
to the kernel. When DMAPI is configured as a module,
CONFIG_XFS_DMAPI_MODULE
is defined. The HAVE_DMAPI is defined for both, static and module DMAPI
configurations.
/* Defines for determining if an event message should be sent. */
#define DM_EVENT_ENABLED(vfsp, ip, event) ( \
unlikely ((vfsp)->vfs_flag & VFS_DMI) && \
@@ -78,6 +79,11 @@ typedef enum {
( ((io)->io_dmevmask & (1 << event)) || \
((io)->io_mount->m_dmevmask & (1 << event)) ) \
)
+#else
+#define DM_EVENT_ENABLED(vfsp, ip, event) (0)
The above should use the new two arguments DM_EVENT_ENABLED macro.
+#define DM_EVENT_ENABLED_IO(vfsp, io, event) (0)
What is this DM_EVENT_ENABLE_IO macro for?
+#ifdef CONFIG_XFS_DMAPI
The same, use HAVE_DMAPI instead of CONFIG_XFS_DMAPI.
Otherwise it is looking good.
Regards,
Vlad
|