|
@@ -1400,15 +1400,12 @@ generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
|
|
unsigned long seg = 0;
|
|
unsigned long seg = 0;
|
|
size_t count;
|
|
size_t count;
|
|
loff_t *ppos = &iocb->ki_pos;
|
|
loff_t *ppos = &iocb->ki_pos;
|
|
- struct blk_plug plug;
|
|
|
|
|
|
|
|
count = 0;
|
|
count = 0;
|
|
retval = generic_segment_checks(iov, &nr_segs, &count, VERIFY_WRITE);
|
|
retval = generic_segment_checks(iov, &nr_segs, &count, VERIFY_WRITE);
|
|
if (retval)
|
|
if (retval)
|
|
return retval;
|
|
return retval;
|
|
|
|
|
|
- blk_start_plug(&plug);
|
|
|
|
-
|
|
|
|
/* coalesce the iovecs and go direct-to-BIO for O_DIRECT */
|
|
/* coalesce the iovecs and go direct-to-BIO for O_DIRECT */
|
|
if (filp->f_flags & O_DIRECT) {
|
|
if (filp->f_flags & O_DIRECT) {
|
|
loff_t size;
|
|
loff_t size;
|
|
@@ -1424,8 +1421,12 @@ generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
|
|
retval = filemap_write_and_wait_range(mapping, pos,
|
|
retval = filemap_write_and_wait_range(mapping, pos,
|
|
pos + iov_length(iov, nr_segs) - 1);
|
|
pos + iov_length(iov, nr_segs) - 1);
|
|
if (!retval) {
|
|
if (!retval) {
|
|
|
|
+ struct blk_plug plug;
|
|
|
|
+
|
|
|
|
+ blk_start_plug(&plug);
|
|
retval = mapping->a_ops->direct_IO(READ, iocb,
|
|
retval = mapping->a_ops->direct_IO(READ, iocb,
|
|
iov, pos, nr_segs);
|
|
iov, pos, nr_segs);
|
|
|
|
+ blk_finish_plug(&plug);
|
|
}
|
|
}
|
|
if (retval > 0) {
|
|
if (retval > 0) {
|
|
*ppos = pos + retval;
|
|
*ppos = pos + retval;
|
|
@@ -1481,7 +1482,6 @@ generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
out:
|
|
out:
|
|
- blk_finish_plug(&plug);
|
|
|
|
return retval;
|
|
return retval;
|
|
}
|
|
}
|
|
EXPORT_SYMBOL(generic_file_aio_read);
|
|
EXPORT_SYMBOL(generic_file_aio_read);
|