Commit 948c6d4f authored by Eric Sandeen's avatar Eric Sandeen Committed by Tim Shimmin

[XFS] optimize dmapi event tests w/o dmapi config

SGI-PV: 969372
SGI-Modid: xfs-linux-melb:xfs-kern:29444a
Signed-off-by: default avatarEric Sandeen <sandeen@sandeen.net>
Signed-off-by: default avatarVlad Apostolov <vapo@sgi.com>
Signed-off-by: default avatarTim Shimmin <tes@sgi.com>
parent eb9df39d
...@@ -67,11 +67,15 @@ typedef enum { ...@@ -67,11 +67,15 @@ typedef enum {
#define HAVE_DM_RIGHT_T #define HAVE_DM_RIGHT_T
/* Defines for determining if an event message should be sent. */ /* Defines for determining if an event message should be sent. */
#ifdef HAVE_DMAPI
#define DM_EVENT_ENABLED(ip, event) ( \ #define DM_EVENT_ENABLED(ip, event) ( \
unlikely (XFS_MTOVFS((ip)->i_mount)->vfs_flag & VFS_DMI) && \ unlikely (XFS_MTOVFS((ip)->i_mount)->vfs_flag & VFS_DMI) && \
( ((ip)->i_d.di_dmevmask & (1 << event)) || \ ( ((ip)->i_d.di_dmevmask & (1 << event)) || \
((ip)->i_mount->m_dmevmask & (1 << event)) ) \ ((ip)->i_mount->m_dmevmask & (1 << event)) ) \
) )
#else
#define DM_EVENT_ENABLED(ip, event) (0)
#endif
#define DM_XFS_VALID_FS_EVENTS ( \ #define DM_XFS_VALID_FS_EVENTS ( \
(1 << DM_EVENT_PREUNMOUNT) | \ (1 << DM_EVENT_PREUNMOUNT) | \
......
...@@ -572,6 +572,7 @@ xfs_unmount( ...@@ -572,6 +572,7 @@ xfs_unmount(
rip = mp->m_rootip; rip = mp->m_rootip;
rvp = XFS_ITOV(rip); rvp = XFS_ITOV(rip);
#ifdef HAVE_DMAPI
if (vfsp->vfs_flag & VFS_DMI) { if (vfsp->vfs_flag & VFS_DMI) {
error = XFS_SEND_PREUNMOUNT(mp, vfsp, error = XFS_SEND_PREUNMOUNT(mp, vfsp,
rvp, DM_RIGHT_NULL, rvp, DM_RIGHT_NULL, rvp, DM_RIGHT_NULL, rvp, DM_RIGHT_NULL,
...@@ -584,7 +585,7 @@ xfs_unmount( ...@@ -584,7 +585,7 @@ xfs_unmount(
unmount_event_flags = (mp->m_dmevmask & (1<<DM_EVENT_UNMOUNT))? unmount_event_flags = (mp->m_dmevmask & (1<<DM_EVENT_UNMOUNT))?
0 : DM_FLAGS_UNWANTED; 0 : DM_FLAGS_UNWANTED;
} }
#endif
/* /*
* First blow any referenced inode from this file system * First blow any referenced inode from this file system
* out of the reference cache, and delete the timer. * out of the reference cache, and delete the timer.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment