diff options
-rw-r--r-- | fs/ext4/ext4.h | 1 | ||||
-rw-r--r-- | fs/ext4/inode.c | 10 | ||||
-rw-r--r-- | fs/ext4/page-io.c | 2 |
3 files changed, 8 insertions, 5 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index c2314dcbe4f..4076746d721 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -184,6 +184,7 @@ struct mpage_da_data { | |||
184 | #define EXT4_IO_END_UNWRITTEN 0x0001 | 184 | #define EXT4_IO_END_UNWRITTEN 0x0001 |
185 | #define EXT4_IO_END_ERROR 0x0002 | 185 | #define EXT4_IO_END_ERROR 0x0002 |
186 | #define EXT4_IO_END_QUEUED 0x0004 | 186 | #define EXT4_IO_END_QUEUED 0x0004 |
187 | #define EXT4_IO_END_DIRECT 0x0008 | ||
187 | 188 | ||
188 | struct ext4_io_page { | 189 | struct ext4_io_page { |
189 | struct page *p_page; | 190 | struct page *p_page; |
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index a58812ef5ea..aafc626d64a 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -2796,9 +2796,6 @@ out: | |||
2796 | 2796 | ||
2797 | /* queue the work to convert unwritten extents to written */ | 2797 | /* queue the work to convert unwritten extents to written */ |
2798 | queue_work(wq, &io_end->work); | 2798 | queue_work(wq, &io_end->work); |
2799 | |||
2800 | /* XXX: probably should move into the real I/O completion handler */ | ||
2801 | inode_dio_done(inode); | ||
2802 | } | 2799 | } |
2803 | 2800 | ||
2804 | static void ext4_end_io_buffer_write(struct buffer_head *bh, int uptodate) | 2801 | static void ext4_end_io_buffer_write(struct buffer_head *bh, int uptodate) |
@@ -2922,9 +2919,12 @@ static ssize_t ext4_ext_direct_IO(int rw, struct kiocb *iocb, | |||
2922 | iocb->private = NULL; | 2919 | iocb->private = NULL; |
2923 | EXT4_I(inode)->cur_aio_dio = NULL; | 2920 | EXT4_I(inode)->cur_aio_dio = NULL; |
2924 | if (!is_sync_kiocb(iocb)) { | 2921 | if (!is_sync_kiocb(iocb)) { |
2925 | iocb->private = ext4_init_io_end(inode, GFP_NOFS); | 2922 | ext4_io_end_t *io_end = |
2926 | if (!iocb->private) | 2923 | ext4_init_io_end(inode, GFP_NOFS); |
2924 | if (!io_end) | ||
2927 | return -ENOMEM; | 2925 | return -ENOMEM; |
2926 | io_end->flag |= EXT4_IO_END_DIRECT; | ||
2927 | iocb->private = io_end; | ||
2928 | /* | 2928 | /* |
2929 | * we save the io structure for current async | 2929 | * we save the io structure for current async |
2930 | * direct IO, so that later ext4_map_blocks() | 2930 | * direct IO, so that later ext4_map_blocks() |
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index 47585189651..9e1b8eb1e7a 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c | |||
@@ -110,6 +110,8 @@ int ext4_end_io_nolock(ext4_io_end_t *io) | |||
110 | if (io->iocb) | 110 | if (io->iocb) |
111 | aio_complete(io->iocb, io->result, 0); | 111 | aio_complete(io->iocb, io->result, 0); |
112 | 112 | ||
113 | if (io->flag & EXT4_IO_END_DIRECT) | ||
114 | inode_dio_done(inode); | ||
113 | /* Wake up anyone waiting on unwritten extent conversion */ | 115 | /* Wake up anyone waiting on unwritten extent conversion */ |
114 | if (atomic_dec_and_test(&EXT4_I(inode)->i_aiodio_unwritten)) | 116 | if (atomic_dec_and_test(&EXT4_I(inode)->i_aiodio_unwritten)) |
115 | wake_up_all(ext4_ioend_wq(io->inode)); | 117 | wake_up_all(ext4_ioend_wq(io->inode)); |