|
@@ -2061,13 +2061,6 @@ out:
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-static void ocfs2_aiodio_wait(struct inode *inode)
|
|
|
-{
|
|
|
- wait_queue_head_t *wq = ocfs2_ioend_wq(inode);
|
|
|
-
|
|
|
- wait_event(*wq, (atomic_read(&OCFS2_I(inode)->ip_unaligned_aio) == 0));
|
|
|
-}
|
|
|
-
|
|
|
static int ocfs2_is_io_unaligned(struct inode *inode, size_t count, loff_t pos)
|
|
|
{
|
|
|
int blockmask = inode->i_sb->s_blocksize - 1;
|
|
@@ -2345,10 +2338,8 @@ relock:
|
|
|
* Wait on previous unaligned aio to complete before
|
|
|
* proceeding.
|
|
|
*/
|
|
|
- ocfs2_aiodio_wait(inode);
|
|
|
-
|
|
|
- /* Mark the iocb as needing a decrement in ocfs2_dio_end_io */
|
|
|
- atomic_inc(&OCFS2_I(inode)->ip_unaligned_aio);
|
|
|
+ mutex_lock(&OCFS2_I(inode)->ip_unaligned_aio);
|
|
|
+ /* Mark the iocb as needing an unlock in ocfs2_dio_end_io */
|
|
|
ocfs2_iocb_set_unaligned_aio(iocb);
|
|
|
}
|
|
|
|
|
@@ -2428,7 +2419,7 @@ out_dio:
|
|
|
|
|
|
if (unaligned_dio) {
|
|
|
ocfs2_iocb_clear_unaligned_aio(iocb);
|
|
|
- atomic_dec(&OCFS2_I(inode)->ip_unaligned_aio);
|
|
|
+ mutex_unlock(&OCFS2_I(inode)->ip_unaligned_aio);
|
|
|
}
|
|
|
|
|
|
out:
|