aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext3/inode.c')
-rw-r--r--fs/ext3/inode.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index f5157d0d1b43..7a5c501dc31b 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -1820,8 +1820,7 @@ static int ext3_releasepage(struct page *page, gfp_t wait)
1820 * VFS code falls back into buffered path in that case so we are safe. 1820 * VFS code falls back into buffered path in that case so we are safe.
1821 */ 1821 */
1822static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb, 1822static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb,
1823 const struct iovec *iov, loff_t offset, 1823 struct iov_iter *iter, loff_t offset)
1824 unsigned long nr_segs)
1825{ 1824{
1826 struct file *file = iocb->ki_filp; 1825 struct file *file = iocb->ki_filp;
1827 struct inode *inode = file->f_mapping->host; 1826 struct inode *inode = file->f_mapping->host;
@@ -1829,10 +1828,10 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb,
1829 handle_t *handle; 1828 handle_t *handle;
1830 ssize_t ret; 1829 ssize_t ret;
1831 int orphan = 0; 1830 int orphan = 0;
1832 size_t count = iov_length(iov, nr_segs); 1831 size_t count = iov_length(iter->iov, iter->nr_segs);
1833 int retries = 0; 1832 int retries = 0;
1834 1833
1835 trace_ext3_direct_IO_enter(inode, offset, iov_length(iov, nr_segs), rw); 1834 trace_ext3_direct_IO_enter(inode, offset, count, rw);
1836 1835
1837 if (rw == WRITE) { 1836 if (rw == WRITE) {
1838 loff_t final_size = offset + count; 1837 loff_t final_size = offset + count;
@@ -1856,15 +1855,15 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb,
1856 } 1855 }
1857 1856
1858retry: 1857retry:
1859 ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, 1858 ret = blockdev_direct_IO(rw, iocb, inode, iter->iov, offset,
1860 ext3_get_block); 1859 iter->nr_segs, ext3_get_block);
1861 /* 1860 /*
1862 * In case of error extending write may have instantiated a few 1861 * In case of error extending write may have instantiated a few
1863 * blocks outside i_size. Trim these off again. 1862 * blocks outside i_size. Trim these off again.
1864 */ 1863 */
1865 if (unlikely((rw & WRITE) && ret < 0)) { 1864 if (unlikely((rw & WRITE) && ret < 0)) {
1866 loff_t isize = i_size_read(inode); 1865 loff_t isize = i_size_read(inode);
1867 loff_t end = offset + iov_length(iov, nr_segs); 1866 loff_t end = offset + count;
1868 1867
1869 if (end > isize) 1868 if (end > isize)
1870 ext3_truncate_failed_direct_write(inode); 1869 ext3_truncate_failed_direct_write(inode);
@@ -1909,8 +1908,7 @@ retry:
1909 ret = err; 1908 ret = err;
1910 } 1909 }
1911out: 1910out:
1912 trace_ext3_direct_IO_exit(inode, offset, 1911 trace_ext3_direct_IO_exit(inode, offset, count, rw, ret);
1913 iov_length(iov, nr_segs), rw, ret);
1914 return ret; 1912 return ret;
1915} 1913}
1916 1914