pass iov_iter to ->direct_IO()
unmodified, for now Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -1820,8 +1820,7 @@ static int ext3_releasepage(struct page *page, gfp_t wait)
|
||||
* VFS code falls back into buffered path in that case so we are safe.
|
||||
*/
|
||||
static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb,
|
||||
const struct iovec *iov, loff_t offset,
|
||||
unsigned long nr_segs)
|
||||
struct iov_iter *iter, loff_t offset)
|
||||
{
|
||||
struct file *file = iocb->ki_filp;
|
||||
struct inode *inode = file->f_mapping->host;
|
||||
@@ -1829,10 +1828,10 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb,
|
||||
handle_t *handle;
|
||||
ssize_t ret;
|
||||
int orphan = 0;
|
||||
size_t count = iov_length(iov, nr_segs);
|
||||
size_t count = iov_length(iter->iov, iter->nr_segs);
|
||||
int retries = 0;
|
||||
|
||||
trace_ext3_direct_IO_enter(inode, offset, iov_length(iov, nr_segs), rw);
|
||||
trace_ext3_direct_IO_enter(inode, offset, count, rw);
|
||||
|
||||
if (rw == WRITE) {
|
||||
loff_t final_size = offset + count;
|
||||
@@ -1856,15 +1855,15 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb,
|
||||
}
|
||||
|
||||
retry:
|
||||
ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs,
|
||||
ext3_get_block);
|
||||
ret = blockdev_direct_IO(rw, iocb, inode, iter->iov, offset,
|
||||
iter->nr_segs, ext3_get_block);
|
||||
/*
|
||||
* In case of error extending write may have instantiated a few
|
||||
* blocks outside i_size. Trim these off again.
|
||||
*/
|
||||
if (unlikely((rw & WRITE) && ret < 0)) {
|
||||
loff_t isize = i_size_read(inode);
|
||||
loff_t end = offset + iov_length(iov, nr_segs);
|
||||
loff_t end = offset + count;
|
||||
|
||||
if (end > isize)
|
||||
ext3_truncate_failed_direct_write(inode);
|
||||
@@ -1909,8 +1908,7 @@ retry:
|
||||
ret = err;
|
||||
}
|
||||
out:
|
||||
trace_ext3_direct_IO_exit(inode, offset,
|
||||
iov_length(iov, nr_segs), rw, ret);
|
||||
trace_ext3_direct_IO_exit(inode, offset, count, rw, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user