Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322224
b: refs/heads/master
c: 647d1e4
h: refs/heads/master
v: v3
  • Loading branch information
Fengguang Wu authored and Jens Axboe committed Aug 9, 2012
1 parent 87ec1ac commit 0e824c7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 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: 8430f9772f9ac305211f177b0fa56a312175da11
refs/heads/master: 647d1e4c5235763b83fbfe74a09d148edc6ca152
5 changes: 5 additions & 0 deletions trunk/fs/direct-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,7 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
unsigned long user_addr;
size_t bytes;
struct buffer_head map_bh = { 0, };
struct blk_plug plug;

if (rw & WRITE)
rw = WRITE_ODIRECT;
Expand Down Expand Up @@ -1177,6 +1178,8 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
PAGE_SIZE - user_addr / PAGE_SIZE);
}

blk_start_plug(&plug);

for (seg = 0; seg < nr_segs; seg++) {
user_addr = (unsigned long)iov[seg].iov_base;
sdio.size += bytes = iov[seg].iov_len;
Expand Down Expand Up @@ -1235,6 +1238,8 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
if (sdio.bio)
dio_bio_submit(dio, &sdio);

blk_finish_plug(&plug);

/*
* It is possible that, we return short IO due to end of file.
* In that case, we need to release all the pages we got hold on.
Expand Down
4 changes: 0 additions & 4 deletions trunk/mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1412,12 +1412,8 @@ generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
retval = filemap_write_and_wait_range(mapping, pos,
pos + iov_length(iov, nr_segs) - 1);
if (!retval) {
struct blk_plug plug;

blk_start_plug(&plug);
retval = mapping->a_ops->direct_IO(READ, iocb,
iov, pos, nr_segs);
blk_finish_plug(&plug);
}
if (retval > 0) {
*ppos = pos + retval;
Expand Down

0 comments on commit 0e824c7

Please sign in to comment.