Commit 434887a8 authored by Dean Roehrich's avatar Dean Roehrich Committed by Nathan Scott

[XFS] release i_sem before going into dmapi queues

SGI Modid: xfs-linux:xfs-kern:166619a
parent 1dee0d25
......@@ -730,11 +730,12 @@ xfs_write(
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;
......
......@@ -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
......
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