xfs
[Top] [All Lists]

Re: [PATCH] optimize dmapi event tests w/o dmapi config

To: Eric Sandeen <sandeen@xxxxxxxxxxx>
Subject: Re: [PATCH] optimize dmapi event tests w/o dmapi config
From: Vlad Apostolov <vapo@xxxxxxx>
Date: Mon, 20 Aug 2007 09:48:56 +1000
Cc: xfs-oss <xfs@xxxxxxxxxxx>
In-reply-to: <46C7DD96.6030001@xxxxxxxxxxx>
References: <46C7DD96.6030001@xxxxxxxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Thunderbird 2.0.0.6 (X11/20070728)
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


<Prev in Thread] Current Thread [Next in Thread>