diff options
Diffstat (limited to 'fs/ext3')
-rw-r--r-- | fs/ext3/file.c | 10 | ||||
-rw-r--r-- | fs/ext3/inode.c | 15 |
2 files changed, 11 insertions, 14 deletions
diff --git a/fs/ext3/file.c b/fs/ext3/file.c index aad05311392a..a062fa1e1b11 100644 --- a/fs/ext3/file.c +++ b/fs/ext3/file.c | |||
@@ -50,10 +50,10 @@ static int ext3_release_file (struct inode * inode, struct file * filp) | |||
50 | 50 | ||
51 | const struct file_operations ext3_file_operations = { | 51 | const struct file_operations ext3_file_operations = { |
52 | .llseek = generic_file_llseek, | 52 | .llseek = generic_file_llseek, |
53 | .read = do_sync_read, | 53 | .read = new_sync_read, |
54 | .write = do_sync_write, | 54 | .write = new_sync_write, |
55 | .aio_read = generic_file_aio_read, | 55 | .read_iter = generic_file_read_iter, |
56 | .aio_write = generic_file_aio_write, | 56 | .write_iter = generic_file_write_iter, |
57 | .unlocked_ioctl = ext3_ioctl, | 57 | .unlocked_ioctl = ext3_ioctl, |
58 | #ifdef CONFIG_COMPAT | 58 | #ifdef CONFIG_COMPAT |
59 | .compat_ioctl = ext3_compat_ioctl, | 59 | .compat_ioctl = ext3_compat_ioctl, |
@@ -63,7 +63,7 @@ const struct file_operations ext3_file_operations = { | |||
63 | .release = ext3_release_file, | 63 | .release = ext3_release_file, |
64 | .fsync = ext3_sync_file, | 64 | .fsync = ext3_sync_file, |
65 | .splice_read = generic_file_splice_read, | 65 | .splice_read = generic_file_splice_read, |
66 | .splice_write = generic_file_splice_write, | 66 | .splice_write = iter_file_splice_write, |
67 | }; | 67 | }; |
68 | 68 | ||
69 | const struct inode_operations ext3_file_inode_operations = { | 69 | const struct inode_operations ext3_file_inode_operations = { |
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index 695abe738a24..2c6ccc49ba27 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c | |||
@@ -1821,8 +1821,7 @@ static int ext3_releasepage(struct page *page, gfp_t wait) | |||
1821 | * VFS code falls back into buffered path in that case so we are safe. | 1821 | * VFS code falls back into buffered path in that case so we are safe. |
1822 | */ | 1822 | */ |
1823 | static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb, | 1823 | static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb, |
1824 | const struct iovec *iov, loff_t offset, | 1824 | struct iov_iter *iter, loff_t offset) |
1825 | unsigned long nr_segs) | ||
1826 | { | 1825 | { |
1827 | struct file *file = iocb->ki_filp; | 1826 | struct file *file = iocb->ki_filp; |
1828 | struct inode *inode = file->f_mapping->host; | 1827 | struct inode *inode = file->f_mapping->host; |
@@ -1830,10 +1829,10 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb, | |||
1830 | handle_t *handle; | 1829 | handle_t *handle; |
1831 | ssize_t ret; | 1830 | ssize_t ret; |
1832 | int orphan = 0; | 1831 | int orphan = 0; |
1833 | size_t count = iov_length(iov, nr_segs); | 1832 | size_t count = iov_iter_count(iter); |
1834 | int retries = 0; | 1833 | int retries = 0; |
1835 | 1834 | ||
1836 | trace_ext3_direct_IO_enter(inode, offset, iov_length(iov, nr_segs), rw); | 1835 | trace_ext3_direct_IO_enter(inode, offset, count, rw); |
1837 | 1836 | ||
1838 | if (rw == WRITE) { | 1837 | if (rw == WRITE) { |
1839 | loff_t final_size = offset + count; | 1838 | loff_t final_size = offset + count; |
@@ -1857,15 +1856,14 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb, | |||
1857 | } | 1856 | } |
1858 | 1857 | ||
1859 | retry: | 1858 | retry: |
1860 | ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, | 1859 | ret = blockdev_direct_IO(rw, iocb, inode, iter, offset, ext3_get_block); |
1861 | ext3_get_block); | ||
1862 | /* | 1860 | /* |
1863 | * In case of error extending write may have instantiated a few | 1861 | * In case of error extending write may have instantiated a few |
1864 | * blocks outside i_size. Trim these off again. | 1862 | * blocks outside i_size. Trim these off again. |
1865 | */ | 1863 | */ |
1866 | if (unlikely((rw & WRITE) && ret < 0)) { | 1864 | if (unlikely((rw & WRITE) && ret < 0)) { |
1867 | loff_t isize = i_size_read(inode); | 1865 | loff_t isize = i_size_read(inode); |
1868 | loff_t end = offset + iov_length(iov, nr_segs); | 1866 | loff_t end = offset + count; |
1869 | 1867 | ||
1870 | if (end > isize) | 1868 | if (end > isize) |
1871 | ext3_truncate_failed_direct_write(inode); | 1869 | ext3_truncate_failed_direct_write(inode); |
@@ -1910,8 +1908,7 @@ retry: | |||
1910 | ret = err; | 1908 | ret = err; |
1911 | } | 1909 | } |
1912 | out: | 1910 | out: |
1913 | trace_ext3_direct_IO_exit(inode, offset, | 1911 | trace_ext3_direct_IO_exit(inode, offset, count, rw, ret); |
1914 | iov_length(iov, nr_segs), rw, ret); | ||
1915 | return ret; | 1912 | return ret; |
1916 | } | 1913 | } |
1917 | 1914 | ||