Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296549
b: refs/heads/master
c: 266991b
h: refs/heads/master
i:
  296547: 49de319
v: v3
  • Loading branch information
Jeff Moyer authored and Theodore Ts'o committed Feb 20, 2012
1 parent e30fb6c commit 6d3ac0f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d4dc462f556afe510d58d3b12b3d66c2cabff539
refs/heads/master: 266991b13890049ee1a6bb95b9817f06339ee3d7
1 change: 1 addition & 0 deletions trunk/fs/ext4/ext4.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ struct mpage_da_data {
#define EXT4_IO_END_UNWRITTEN 0x0001
#define EXT4_IO_END_ERROR 0x0002
#define EXT4_IO_END_QUEUED 0x0004
#define EXT4_IO_END_DIRECT 0x0008

struct ext4_io_page {
struct page *p_page;
Expand Down
10 changes: 5 additions & 5 deletions trunk/fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2796,9 +2796,6 @@ static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset,

/* queue the work to convert unwritten extents to written */
queue_work(wq, &io_end->work);

/* XXX: probably should move into the real I/O completion handler */
inode_dio_done(inode);
}

static void ext4_end_io_buffer_write(struct buffer_head *bh, int uptodate)
Expand Down Expand Up @@ -2922,9 +2919,12 @@ static ssize_t ext4_ext_direct_IO(int rw, struct kiocb *iocb,
iocb->private = NULL;
EXT4_I(inode)->cur_aio_dio = NULL;
if (!is_sync_kiocb(iocb)) {
iocb->private = ext4_init_io_end(inode, GFP_NOFS);
if (!iocb->private)
ext4_io_end_t *io_end =
ext4_init_io_end(inode, GFP_NOFS);
if (!io_end)
return -ENOMEM;
io_end->flag |= EXT4_IO_END_DIRECT;
iocb->private = io_end;
/*
* we save the io structure for current async
* direct IO, so that later ext4_map_blocks()
Expand Down
2 changes: 2 additions & 0 deletions trunk/fs/ext4/page-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ int ext4_end_io_nolock(ext4_io_end_t *io)
if (io->iocb)
aio_complete(io->iocb, io->result, 0);

if (io->flag & EXT4_IO_END_DIRECT)
inode_dio_done(inode);
/* Wake up anyone waiting on unwritten extent conversion */
if (atomic_dec_and_test(&EXT4_I(inode)->i_aiodio_unwritten))
wake_up_all(ext4_ioend_wq(io->inode));
Expand Down

0 comments on commit 6d3ac0f

Please sign in to comment.