]> git.hungrycats.org Git - linux/commitdiff
[XFS] release i_sem before going into dmapi queues
authorDean Roehrich <roehrich@sgi.com>
Wed, 3 Mar 2004 03:11:32 +0000 (14:11 +1100)
committerNathan Scott <nathans@sgi.com>
Wed, 3 Mar 2004 03:11:32 +0000 (14:11 +1100)
SGI Modid: xfs-linux:xfs-kern:166619a

fs/xfs/linux/xfs_lrw.c
fs/xfs/xfs_dmapi.h

index 566dd499410ea19ab447ce50499373a8ac71ab82..d04855e7090c484928135fe5f19fc6e7af001e76 100644 (file)
@@ -730,11 +730,12 @@ start:
        if ((DM_EVENT_ENABLED(vp->v_vfsp, xip, DM_EVENT_WRITE) &&
            !(ioflags & IO_INVIS) && !eventsent)) {
                loff_t          savedsize = *offset;
+               int dmflags = FILP_DELAY_FLAG(file) | DM_SEM_FLAG(ioflags);
 
                xfs_iunlock(xip, XFS_ILOCK_EXCL);
                error = XFS_SEND_DATA(xip->i_mount, DM_EVENT_WRITE, vp,
                                      *offset, size,
-                                     FILP_DELAY_FLAG(file), &locktype);
+                                     dmflags, &locktype);
                if (error) {
                        xfs_iunlock(xip, iolock);
                        return -error;
index 344d4b34542ecc8f6d34aadfb73d2898f7d8faa8..43a72d58a9376b3e107ca6557a8ace5a3f6e58ca 100644 (file)
@@ -165,6 +165,24 @@ typedef enum {
 
 #define DM_FLAGS_NDELAY                0x001   /* return EAGAIN after dm_pending() */
 #define DM_FLAGS_UNWANTED      0x002   /* event not in fsys dm_eventset_t */
+#define DM_FLAGS_ISEM          0x004   /* thread holds i_sem */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,21)
+/* i_alloc_sem was added in 2.4.22-pre1 */
+#define DM_FLAGS_IALLOCSEM     0x010   /* thread holds i_alloc_sem */
+#endif
+#endif
+
+/*
+ *     Based on IO_ISDIRECT, decide which i_ flag is set.
+ */
+#ifdef DM_FLAGS_IALLOCSEM
+#define DM_SEM_FLAG(ioflags) (((ioflags) & IO_ISDIRECT) ? \
+                             DM_FLAGS_IALLOCSEM : DM_FLAGS_ISEM)
+#else
+#define DM_SEM_FLAG(ioflags) (((ioflags) & IO_ISDIRECT) ? \
+                             0 : DM_FLAGS_ISEM)
+#endif
 
 /*
  *     Macros to turn caller specified delay/block flags into