diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/9p/vfs_addr.c | 5 | ||||
-rw-r--r-- | fs/block_dev.c | 9 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 12 | ||||
-rw-r--r-- | fs/ceph/addr.c | 4 | ||||
-rw-r--r-- | fs/cifs/file.c | 4 | ||||
-rw-r--r-- | fs/exofs/inode.c | 2 | ||||
-rw-r--r-- | fs/ext2/inode.c | 11 | ||||
-rw-r--r-- | fs/ext3/inode.c | 16 | ||||
-rw-r--r-- | fs/ext4/inode.c | 11 | ||||
-rw-r--r-- | fs/f2fs/data.c | 8 | ||||
-rw-r--r-- | fs/fat/inode.c | 13 | ||||
-rw-r--r-- | fs/fuse/file.c | 10 | ||||
-rw-r--r-- | fs/gfs2/aops.c | 11 | ||||
-rw-r--r-- | fs/hfs/inode.c | 8 | ||||
-rw-r--r-- | fs/hfsplus/inode.c | 6 | ||||
-rw-r--r-- | fs/jfs/inode.c | 8 | ||||
-rw-r--r-- | fs/nfs/direct.c | 8 | ||||
-rw-r--r-- | fs/nilfs2/inode.c | 10 | ||||
-rw-r--r-- | fs/ocfs2/aops.c | 7 | ||||
-rw-r--r-- | fs/reiserfs/inode.c | 9 | ||||
-rw-r--r-- | fs/udf/file.c | 4 | ||||
-rw-r--r-- | fs/udf/inode.c | 8 | ||||
-rw-r--r-- | fs/xfs/xfs_aops.c | 15 |
23 files changed, 97 insertions, 102 deletions
diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c index c71e88602ff4..cc1cfae726b3 100644 --- a/fs/9p/vfs_addr.c +++ b/fs/9p/vfs_addr.c | |||
@@ -259,8 +259,7 @@ static int v9fs_launder_page(struct page *page) | |||
259 | * | 259 | * |
260 | */ | 260 | */ |
261 | static ssize_t | 261 | static ssize_t |
262 | v9fs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, | 262 | v9fs_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter, loff_t pos) |
263 | loff_t pos, unsigned long nr_segs) | ||
264 | { | 263 | { |
265 | /* | 264 | /* |
266 | * FIXME | 265 | * FIXME |
@@ -269,7 +268,7 @@ v9fs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, | |||
269 | */ | 268 | */ |
270 | p9_debug(P9_DEBUG_VFS, "v9fs_direct_IO: v9fs_direct_IO (%s) off/no(%lld/%lu) EINVAL\n", | 269 | p9_debug(P9_DEBUG_VFS, "v9fs_direct_IO: v9fs_direct_IO (%s) off/no(%lld/%lu) EINVAL\n", |
271 | iocb->ki_filp->f_path.dentry->d_name.name, | 270 | iocb->ki_filp->f_path.dentry->d_name.name, |
272 | (long long)pos, nr_segs); | 271 | (long long)pos, iter->nr_segs); |
273 | 272 | ||
274 | return -EINVAL; | 273 | return -EINVAL; |
275 | } | 274 | } |
diff --git a/fs/block_dev.c b/fs/block_dev.c index 552a8d13bc32..938fc707d769 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -165,14 +165,15 @@ blkdev_get_block(struct inode *inode, sector_t iblock, | |||
165 | } | 165 | } |
166 | 166 | ||
167 | static ssize_t | 167 | static ssize_t |
168 | blkdev_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, | 168 | blkdev_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter, |
169 | loff_t offset, unsigned long nr_segs) | 169 | loff_t offset) |
170 | { | 170 | { |
171 | struct file *file = iocb->ki_filp; | 171 | struct file *file = iocb->ki_filp; |
172 | struct inode *inode = file->f_mapping->host; | 172 | struct inode *inode = file->f_mapping->host; |
173 | 173 | ||
174 | return __blockdev_direct_IO(rw, iocb, inode, I_BDEV(inode), iov, offset, | 174 | return __blockdev_direct_IO(rw, iocb, inode, I_BDEV(inode), iter->iov, |
175 | nr_segs, blkdev_get_block, NULL, NULL, 0); | 175 | offset, iter->nr_segs, blkdev_get_block, |
176 | NULL, NULL, 0); | ||
176 | } | 177 | } |
177 | 178 | ||
178 | int __sync_blockdev(struct block_device *bdev, int wait) | 179 | int __sync_blockdev(struct block_device *bdev, int wait) |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 5f805bc944fa..30a6cc51f32c 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -7433,8 +7433,7 @@ out: | |||
7433 | } | 7433 | } |
7434 | 7434 | ||
7435 | static ssize_t btrfs_direct_IO(int rw, struct kiocb *iocb, | 7435 | static ssize_t btrfs_direct_IO(int rw, struct kiocb *iocb, |
7436 | const struct iovec *iov, loff_t offset, | 7436 | struct iov_iter *iter, loff_t offset) |
7437 | unsigned long nr_segs) | ||
7438 | { | 7437 | { |
7439 | struct file *file = iocb->ki_filp; | 7438 | struct file *file = iocb->ki_filp; |
7440 | struct inode *inode = file->f_mapping->host; | 7439 | struct inode *inode = file->f_mapping->host; |
@@ -7444,8 +7443,8 @@ static ssize_t btrfs_direct_IO(int rw, struct kiocb *iocb, | |||
7444 | bool relock = false; | 7443 | bool relock = false; |
7445 | ssize_t ret; | 7444 | ssize_t ret; |
7446 | 7445 | ||
7447 | if (check_direct_IO(BTRFS_I(inode)->root, rw, iocb, iov, | 7446 | if (check_direct_IO(BTRFS_I(inode)->root, rw, iocb, iter->iov, |
7448 | offset, nr_segs)) | 7447 | offset, iter->nr_segs)) |
7449 | return 0; | 7448 | return 0; |
7450 | 7449 | ||
7451 | atomic_inc(&inode->i_dio_count); | 7450 | atomic_inc(&inode->i_dio_count); |
@@ -7457,7 +7456,7 @@ static ssize_t btrfs_direct_IO(int rw, struct kiocb *iocb, | |||
7457 | * we need to flush the dirty pages again to make absolutely sure | 7456 | * we need to flush the dirty pages again to make absolutely sure |
7458 | * that any outstanding dirty pages are on disk. | 7457 | * that any outstanding dirty pages are on disk. |
7459 | */ | 7458 | */ |
7460 | count = iov_length(iov, nr_segs); | 7459 | count = iov_length(iter->iov, iter->nr_segs); |
7461 | if (test_bit(BTRFS_INODE_HAS_ASYNC_EXTENT, | 7460 | if (test_bit(BTRFS_INODE_HAS_ASYNC_EXTENT, |
7462 | &BTRFS_I(inode)->runtime_flags)) | 7461 | &BTRFS_I(inode)->runtime_flags)) |
7463 | filemap_fdatawrite_range(inode->i_mapping, offset, count); | 7462 | filemap_fdatawrite_range(inode->i_mapping, offset, count); |
@@ -7484,7 +7483,8 @@ static ssize_t btrfs_direct_IO(int rw, struct kiocb *iocb, | |||
7484 | 7483 | ||
7485 | ret = __blockdev_direct_IO(rw, iocb, inode, | 7484 | ret = __blockdev_direct_IO(rw, iocb, inode, |
7486 | BTRFS_I(inode)->root->fs_info->fs_devices->latest_bdev, | 7485 | BTRFS_I(inode)->root->fs_info->fs_devices->latest_bdev, |
7487 | iov, offset, nr_segs, btrfs_get_blocks_direct, NULL, | 7486 | iter->iov, offset, iter->nr_segs, |
7487 | btrfs_get_blocks_direct, NULL, | ||
7488 | btrfs_submit_direct, flags); | 7488 | btrfs_submit_direct, flags); |
7489 | if (rw & WRITE) { | 7489 | if (rw & WRITE) { |
7490 | if (ret < 0 && ret != -EIOCBQUEUED) | 7490 | if (ret < 0 && ret != -EIOCBQUEUED) |
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index b53278c9fd97..342ca5e423f9 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c | |||
@@ -1187,8 +1187,8 @@ static int ceph_write_end(struct file *file, struct address_space *mapping, | |||
1187 | * never get called. | 1187 | * never get called. |
1188 | */ | 1188 | */ |
1189 | static ssize_t ceph_direct_io(int rw, struct kiocb *iocb, | 1189 | static ssize_t ceph_direct_io(int rw, struct kiocb *iocb, |
1190 | const struct iovec *iov, | 1190 | struct iov_iter *iter, |
1191 | loff_t pos, unsigned long nr_segs) | 1191 | loff_t pos) |
1192 | { | 1192 | { |
1193 | WARN_ON(1); | 1193 | WARN_ON(1); |
1194 | return -EINVAL; | 1194 | return -EINVAL; |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 2900d150654e..a4ccc39e6c11 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -3702,8 +3702,8 @@ void cifs_oplock_break(struct work_struct *work) | |||
3702 | * Direct IO is not yet supported in the cached mode. | 3702 | * Direct IO is not yet supported in the cached mode. |
3703 | */ | 3703 | */ |
3704 | static ssize_t | 3704 | static ssize_t |
3705 | cifs_direct_io(int rw, struct kiocb *iocb, const struct iovec *iov, | 3705 | cifs_direct_io(int rw, struct kiocb *iocb, struct iov_iter *iter, |
3706 | loff_t pos, unsigned long nr_segs) | 3706 | loff_t pos) |
3707 | { | 3707 | { |
3708 | /* | 3708 | /* |
3709 | * FIXME | 3709 | * FIXME |
diff --git a/fs/exofs/inode.c b/fs/exofs/inode.c index d1c244d67667..3f9cafd73931 100644 --- a/fs/exofs/inode.c +++ b/fs/exofs/inode.c | |||
@@ -964,7 +964,7 @@ static void exofs_invalidatepage(struct page *page, unsigned int offset, | |||
964 | 964 | ||
965 | /* TODO: Should be easy enough to do proprly */ | 965 | /* TODO: Should be easy enough to do proprly */ |
966 | static ssize_t exofs_direct_IO(int rw, struct kiocb *iocb, | 966 | static ssize_t exofs_direct_IO(int rw, struct kiocb *iocb, |
967 | const struct iovec *iov, loff_t offset, unsigned long nr_segs) | 967 | struct iov_iter *iter, loff_t offset) |
968 | { | 968 | { |
969 | return 0; | 969 | return 0; |
970 | } | 970 | } |
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index b1d2a4675d42..47fbe760a7f8 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c | |||
@@ -850,18 +850,19 @@ static sector_t ext2_bmap(struct address_space *mapping, sector_t block) | |||
850 | } | 850 | } |
851 | 851 | ||
852 | static ssize_t | 852 | static ssize_t |
853 | ext2_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, | 853 | ext2_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter, |
854 | loff_t offset, unsigned long nr_segs) | 854 | loff_t offset) |
855 | { | 855 | { |
856 | struct file *file = iocb->ki_filp; | 856 | struct file *file = iocb->ki_filp; |
857 | struct address_space *mapping = file->f_mapping; | 857 | struct address_space *mapping = file->f_mapping; |
858 | struct inode *inode = mapping->host; | 858 | struct inode *inode = mapping->host; |
859 | ssize_t ret; | 859 | ssize_t ret; |
860 | 860 | ||
861 | ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, | 861 | ret = blockdev_direct_IO(rw, iocb, inode, iter->iov, offset, |
862 | ext2_get_block); | 862 | iter->nr_segs, ext2_get_block); |
863 | if (ret < 0 && (rw & WRITE)) | 863 | if (ret < 0 && (rw & WRITE)) |
864 | ext2_write_failed(mapping, offset + iov_length(iov, nr_segs)); | 864 | ext2_write_failed(mapping, offset + |
865 | iov_length(iter->iov, iter->nr_segs)); | ||
865 | return ret; | 866 | return ret; |
866 | } | 867 | } |
867 | 868 | ||
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 | */ |
1822 | static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb, | 1822 | static 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 | ||
1858 | retry: | 1857 | retry: |
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 | } |
1911 | out: | 1910 | out: |
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 | ||
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index d7b7462a0e13..f51db730da39 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -3222,8 +3222,7 @@ retake_lock: | |||
3222 | } | 3222 | } |
3223 | 3223 | ||
3224 | static ssize_t ext4_direct_IO(int rw, struct kiocb *iocb, | 3224 | static ssize_t ext4_direct_IO(int rw, struct kiocb *iocb, |
3225 | const struct iovec *iov, loff_t offset, | 3225 | struct iov_iter *iter, loff_t offset) |
3226 | unsigned long nr_segs) | ||
3227 | { | 3226 | { |
3228 | struct file *file = iocb->ki_filp; | 3227 | struct file *file = iocb->ki_filp; |
3229 | struct inode *inode = file->f_mapping->host; | 3228 | struct inode *inode = file->f_mapping->host; |
@@ -3239,13 +3238,13 @@ static ssize_t ext4_direct_IO(int rw, struct kiocb *iocb, | |||
3239 | if (ext4_has_inline_data(inode)) | 3238 | if (ext4_has_inline_data(inode)) |
3240 | return 0; | 3239 | return 0; |
3241 | 3240 | ||
3242 | trace_ext4_direct_IO_enter(inode, offset, iov_length(iov, nr_segs), rw); | 3241 | trace_ext4_direct_IO_enter(inode, offset, iov_length(iter->iov, iter->nr_segs), rw); |
3243 | if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) | 3242 | if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) |
3244 | ret = ext4_ext_direct_IO(rw, iocb, iov, offset, nr_segs); | 3243 | ret = ext4_ext_direct_IO(rw, iocb, iter->iov, offset, iter->nr_segs); |
3245 | else | 3244 | else |
3246 | ret = ext4_ind_direct_IO(rw, iocb, iov, offset, nr_segs); | 3245 | ret = ext4_ind_direct_IO(rw, iocb, iter->iov, offset, iter->nr_segs); |
3247 | trace_ext4_direct_IO_exit(inode, offset, | 3246 | trace_ext4_direct_IO_exit(inode, offset, |
3248 | iov_length(iov, nr_segs), rw, ret); | 3247 | iov_length(iter->iov, iter->nr_segs), rw, ret); |
3249 | return ret; | 3248 | return ret; |
3250 | } | 3249 | } |
3251 | 3250 | ||
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 45abd60e2bff..3a6ef121c095 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c | |||
@@ -1010,7 +1010,7 @@ static int check_direct_IO(struct inode *inode, int rw, | |||
1010 | } | 1010 | } |
1011 | 1011 | ||
1012 | static ssize_t f2fs_direct_IO(int rw, struct kiocb *iocb, | 1012 | static ssize_t f2fs_direct_IO(int rw, struct kiocb *iocb, |
1013 | const struct iovec *iov, loff_t offset, unsigned long nr_segs) | 1013 | struct iov_iter *iter, loff_t offset) |
1014 | { | 1014 | { |
1015 | struct file *file = iocb->ki_filp; | 1015 | struct file *file = iocb->ki_filp; |
1016 | struct inode *inode = file->f_mapping->host; | 1016 | struct inode *inode = file->f_mapping->host; |
@@ -1019,11 +1019,11 @@ static ssize_t f2fs_direct_IO(int rw, struct kiocb *iocb, | |||
1019 | if (f2fs_has_inline_data(inode)) | 1019 | if (f2fs_has_inline_data(inode)) |
1020 | return 0; | 1020 | return 0; |
1021 | 1021 | ||
1022 | if (check_direct_IO(inode, rw, iov, offset, nr_segs)) | 1022 | if (check_direct_IO(inode, rw, iter->iov, offset, iter->nr_segs)) |
1023 | return 0; | 1023 | return 0; |
1024 | 1024 | ||
1025 | return blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, | 1025 | return blockdev_direct_IO(rw, iocb, inode, iter->iov, offset, |
1026 | get_data_block); | 1026 | iter->nr_segs, get_data_block); |
1027 | } | 1027 | } |
1028 | 1028 | ||
1029 | static void f2fs_invalidate_data_page(struct page *page, unsigned int offset, | 1029 | static void f2fs_invalidate_data_page(struct page *page, unsigned int offset, |
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index b3361fe2bcb5..d5237a199055 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c | |||
@@ -185,8 +185,8 @@ static int fat_write_end(struct file *file, struct address_space *mapping, | |||
185 | } | 185 | } |
186 | 186 | ||
187 | static ssize_t fat_direct_IO(int rw, struct kiocb *iocb, | 187 | static ssize_t fat_direct_IO(int rw, struct kiocb *iocb, |
188 | const struct iovec *iov, | 188 | struct iov_iter *iter, |
189 | loff_t offset, unsigned long nr_segs) | 189 | loff_t offset) |
190 | { | 190 | { |
191 | struct file *file = iocb->ki_filp; | 191 | struct file *file = iocb->ki_filp; |
192 | struct address_space *mapping = file->f_mapping; | 192 | struct address_space *mapping = file->f_mapping; |
@@ -203,7 +203,7 @@ static ssize_t fat_direct_IO(int rw, struct kiocb *iocb, | |||
203 | * | 203 | * |
204 | * Return 0, and fallback to normal buffered write. | 204 | * Return 0, and fallback to normal buffered write. |
205 | */ | 205 | */ |
206 | loff_t size = offset + iov_length(iov, nr_segs); | 206 | loff_t size = offset + iov_length(iter->iov, iter->nr_segs); |
207 | if (MSDOS_I(inode)->mmu_private < size) | 207 | if (MSDOS_I(inode)->mmu_private < size) |
208 | return 0; | 208 | return 0; |
209 | } | 209 | } |
@@ -212,10 +212,11 @@ static ssize_t fat_direct_IO(int rw, struct kiocb *iocb, | |||
212 | * FAT need to use the DIO_LOCKING for avoiding the race | 212 | * FAT need to use the DIO_LOCKING for avoiding the race |
213 | * condition of fat_get_block() and ->truncate(). | 213 | * condition of fat_get_block() and ->truncate(). |
214 | */ | 214 | */ |
215 | ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, | 215 | ret = blockdev_direct_IO(rw, iocb, inode, iter->iov, offset, |
216 | fat_get_block); | 216 | iter->nr_segs, fat_get_block); |
217 | if (ret < 0 && (rw & WRITE)) | 217 | if (ret < 0 && (rw & WRITE)) |
218 | fat_write_failed(mapping, offset + iov_length(iov, nr_segs)); | 218 | fat_write_failed(mapping, offset + |
219 | iov_length(iter->iov, iter->nr_segs)); | ||
219 | 220 | ||
220 | return ret; | 221 | return ret; |
221 | } | 222 | } |
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 9c7f346879e7..17d96f36df15 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c | |||
@@ -2890,8 +2890,8 @@ static inline loff_t fuse_round_up(loff_t off) | |||
2890 | } | 2890 | } |
2891 | 2891 | ||
2892 | static ssize_t | 2892 | static ssize_t |
2893 | fuse_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, | 2893 | fuse_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter, |
2894 | loff_t offset, unsigned long nr_segs) | 2894 | loff_t offset) |
2895 | { | 2895 | { |
2896 | ssize_t ret = 0; | 2896 | ssize_t ret = 0; |
2897 | struct file *file = iocb->ki_filp; | 2897 | struct file *file = iocb->ki_filp; |
@@ -2900,7 +2900,7 @@ fuse_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, | |||
2900 | loff_t pos = 0; | 2900 | loff_t pos = 0; |
2901 | struct inode *inode; | 2901 | struct inode *inode; |
2902 | loff_t i_size; | 2902 | loff_t i_size; |
2903 | size_t count = iov_length(iov, nr_segs); | 2903 | size_t count = iov_length(iter->iov, iter->nr_segs); |
2904 | struct fuse_io_priv *io; | 2904 | struct fuse_io_priv *io; |
2905 | 2905 | ||
2906 | pos = offset; | 2906 | pos = offset; |
@@ -2944,9 +2944,9 @@ fuse_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, | |||
2944 | io->async = false; | 2944 | io->async = false; |
2945 | 2945 | ||
2946 | if (rw == WRITE) | 2946 | if (rw == WRITE) |
2947 | ret = __fuse_direct_write(io, iov, nr_segs, &pos); | 2947 | ret = __fuse_direct_write(io, iter->iov, iter->nr_segs, &pos); |
2948 | else | 2948 | else |
2949 | ret = __fuse_direct_read(io, iov, nr_segs, &pos, count); | 2949 | ret = __fuse_direct_read(io, iter->iov, iter->nr_segs, &pos, count); |
2950 | 2950 | ||
2951 | if (io->async) { | 2951 | if (io->async) { |
2952 | fuse_aio_complete(io, ret < 0 ? ret : 0, -1); | 2952 | fuse_aio_complete(io, ret < 0 ? ret : 0, -1); |
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index ce62dcac90b6..e84ddaa42104 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c | |||
@@ -1041,8 +1041,7 @@ static int gfs2_ok_for_dio(struct gfs2_inode *ip, int rw, loff_t offset) | |||
1041 | 1041 | ||
1042 | 1042 | ||
1043 | static ssize_t gfs2_direct_IO(int rw, struct kiocb *iocb, | 1043 | static ssize_t gfs2_direct_IO(int rw, struct kiocb *iocb, |
1044 | const struct iovec *iov, loff_t offset, | 1044 | struct iov_iter *iter, loff_t offset) |
1045 | unsigned long nr_segs) | ||
1046 | { | 1045 | { |
1047 | struct file *file = iocb->ki_filp; | 1046 | struct file *file = iocb->ki_filp; |
1048 | struct inode *inode = file->f_mapping->host; | 1047 | struct inode *inode = file->f_mapping->host; |
@@ -1082,7 +1081,7 @@ static ssize_t gfs2_direct_IO(int rw, struct kiocb *iocb, | |||
1082 | */ | 1081 | */ |
1083 | if (mapping->nrpages) { | 1082 | if (mapping->nrpages) { |
1084 | loff_t lstart = offset & (PAGE_CACHE_SIZE - 1); | 1083 | loff_t lstart = offset & (PAGE_CACHE_SIZE - 1); |
1085 | loff_t len = iov_length(iov, nr_segs); | 1084 | loff_t len = iov_length(iter->iov, iter->nr_segs); |
1086 | loff_t end = PAGE_ALIGN(offset + len) - 1; | 1085 | loff_t end = PAGE_ALIGN(offset + len) - 1; |
1087 | 1086 | ||
1088 | rv = 0; | 1087 | rv = 0; |
@@ -1097,9 +1096,9 @@ static ssize_t gfs2_direct_IO(int rw, struct kiocb *iocb, | |||
1097 | truncate_inode_pages_range(mapping, lstart, end); | 1096 | truncate_inode_pages_range(mapping, lstart, end); |
1098 | } | 1097 | } |
1099 | 1098 | ||
1100 | rv = __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov, | 1099 | rv = __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, |
1101 | offset, nr_segs, gfs2_get_block_direct, | 1100 | iter->iov, offset, iter->nr_segs, |
1102 | NULL, NULL, 0); | 1101 | gfs2_get_block_direct, NULL, NULL, 0); |
1103 | out: | 1102 | out: |
1104 | gfs2_glock_dq(&gh); | 1103 | gfs2_glock_dq(&gh); |
1105 | gfs2_holder_uninit(&gh); | 1104 | gfs2_holder_uninit(&gh); |
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index 9e2fecd62f62..09cff13528c5 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c | |||
@@ -125,15 +125,15 @@ static int hfs_releasepage(struct page *page, gfp_t mask) | |||
125 | } | 125 | } |
126 | 126 | ||
127 | static ssize_t hfs_direct_IO(int rw, struct kiocb *iocb, | 127 | static ssize_t hfs_direct_IO(int rw, struct kiocb *iocb, |
128 | const struct iovec *iov, loff_t offset, unsigned long nr_segs) | 128 | struct iov_iter *iter, loff_t offset) |
129 | { | 129 | { |
130 | struct file *file = iocb->ki_filp; | 130 | struct file *file = iocb->ki_filp; |
131 | struct address_space *mapping = file->f_mapping; | 131 | struct address_space *mapping = file->f_mapping; |
132 | struct inode *inode = file_inode(file)->i_mapping->host; | 132 | struct inode *inode = file_inode(file)->i_mapping->host; |
133 | ssize_t ret; | 133 | ssize_t ret; |
134 | 134 | ||
135 | ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, | 135 | ret = blockdev_direct_IO(rw, iocb, inode, iter->iov, offset, |
136 | hfs_get_block); | 136 | iter->nr_segs, hfs_get_block); |
137 | 137 | ||
138 | /* | 138 | /* |
139 | * In case of error extending write may have instantiated a few | 139 | * In case of error extending write may have instantiated a few |
@@ -141,7 +141,7 @@ static ssize_t hfs_direct_IO(int rw, struct kiocb *iocb, | |||
141 | */ | 141 | */ |
142 | if (unlikely((rw & WRITE) && ret < 0)) { | 142 | if (unlikely((rw & WRITE) && ret < 0)) { |
143 | loff_t isize = i_size_read(inode); | 143 | loff_t isize = i_size_read(inode); |
144 | loff_t end = offset + iov_length(iov, nr_segs); | 144 | loff_t end = offset + iov_length(iter->iov, iter->nr_segs); |
145 | 145 | ||
146 | if (end > isize) | 146 | if (end > isize) |
147 | hfs_write_failed(mapping, end); | 147 | hfs_write_failed(mapping, end); |
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index a4f45bd88a63..7f894a5b5eaf 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c | |||
@@ -123,14 +123,14 @@ static int hfsplus_releasepage(struct page *page, gfp_t mask) | |||
123 | } | 123 | } |
124 | 124 | ||
125 | static ssize_t hfsplus_direct_IO(int rw, struct kiocb *iocb, | 125 | static ssize_t hfsplus_direct_IO(int rw, struct kiocb *iocb, |
126 | const struct iovec *iov, loff_t offset, unsigned long nr_segs) | 126 | struct iov_iter *iter, loff_t offset) |
127 | { | 127 | { |
128 | struct file *file = iocb->ki_filp; | 128 | struct file *file = iocb->ki_filp; |
129 | struct address_space *mapping = file->f_mapping; | 129 | struct address_space *mapping = file->f_mapping; |
130 | struct inode *inode = file_inode(file)->i_mapping->host; | 130 | struct inode *inode = file_inode(file)->i_mapping->host; |
131 | ssize_t ret; | 131 | ssize_t ret; |
132 | 132 | ||
133 | ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, | 133 | ret = blockdev_direct_IO(rw, iocb, inode, iter->iov, offset, iter->nr_segs, |
134 | hfsplus_get_block); | 134 | hfsplus_get_block); |
135 | 135 | ||
136 | /* | 136 | /* |
@@ -139,7 +139,7 @@ static ssize_t hfsplus_direct_IO(int rw, struct kiocb *iocb, | |||
139 | */ | 139 | */ |
140 | if (unlikely((rw & WRITE) && ret < 0)) { | 140 | if (unlikely((rw & WRITE) && ret < 0)) { |
141 | loff_t isize = i_size_read(inode); | 141 | loff_t isize = i_size_read(inode); |
142 | loff_t end = offset + iov_length(iov, nr_segs); | 142 | loff_t end = offset + iov_length(iter->iov, iter->nr_segs); |
143 | 143 | ||
144 | if (end > isize) | 144 | if (end > isize) |
145 | hfsplus_write_failed(mapping, end); | 145 | hfsplus_write_failed(mapping, end); |
diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c index 6f8fe72c2a7a..7052744d5107 100644 --- a/fs/jfs/inode.c +++ b/fs/jfs/inode.c | |||
@@ -331,15 +331,15 @@ static sector_t jfs_bmap(struct address_space *mapping, sector_t block) | |||
331 | } | 331 | } |
332 | 332 | ||
333 | static ssize_t jfs_direct_IO(int rw, struct kiocb *iocb, | 333 | static ssize_t jfs_direct_IO(int rw, struct kiocb *iocb, |
334 | const struct iovec *iov, loff_t offset, unsigned long nr_segs) | 334 | struct iov_iter *iter, loff_t offset) |
335 | { | 335 | { |
336 | struct file *file = iocb->ki_filp; | 336 | struct file *file = iocb->ki_filp; |
337 | struct address_space *mapping = file->f_mapping; | 337 | struct address_space *mapping = file->f_mapping; |
338 | struct inode *inode = file->f_mapping->host; | 338 | struct inode *inode = file->f_mapping->host; |
339 | ssize_t ret; | 339 | ssize_t ret; |
340 | 340 | ||
341 | ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, | 341 | ret = blockdev_direct_IO(rw, iocb, inode, iter->iov, offset, |
342 | jfs_get_block); | 342 | iter->nr_segs, jfs_get_block); |
343 | 343 | ||
344 | /* | 344 | /* |
345 | * In case of error extending write may have instantiated a few | 345 | * In case of error extending write may have instantiated a few |
@@ -347,7 +347,7 @@ static ssize_t jfs_direct_IO(int rw, struct kiocb *iocb, | |||
347 | */ | 347 | */ |
348 | if (unlikely((rw & WRITE) && ret < 0)) { | 348 | if (unlikely((rw & WRITE) && ret < 0)) { |
349 | loff_t isize = i_size_read(inode); | 349 | loff_t isize = i_size_read(inode); |
350 | loff_t end = offset + iov_length(iov, nr_segs); | 350 | loff_t end = offset + iov_length(iter->iov, iter->nr_segs); |
351 | 351 | ||
352 | if (end > isize) | 352 | if (end > isize) |
353 | jfs_write_failed(mapping, end); | 353 | jfs_write_failed(mapping, end); |
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index b8797ae6831f..e9cde3935001 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -121,20 +121,20 @@ static inline int put_dreq(struct nfs_direct_req *dreq) | |||
121 | * shunt off direct read and write requests before the VFS gets them, | 121 | * shunt off direct read and write requests before the VFS gets them, |
122 | * so this method is only ever called for swap. | 122 | * so this method is only ever called for swap. |
123 | */ | 123 | */ |
124 | ssize_t nfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, loff_t pos, unsigned long nr_segs) | 124 | ssize_t nfs_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter, loff_t pos) |
125 | { | 125 | { |
126 | #ifndef CONFIG_NFS_SWAP | 126 | #ifndef CONFIG_NFS_SWAP |
127 | dprintk("NFS: nfs_direct_IO (%pD) off/no(%Ld/%lu) EINVAL\n", | 127 | dprintk("NFS: nfs_direct_IO (%pD) off/no(%Ld/%lu) EINVAL\n", |
128 | iocb->ki_filp, (long long) pos, nr_segs); | 128 | iocb->ki_filp, (long long) pos, iter->nr_segs); |
129 | 129 | ||
130 | return -EINVAL; | 130 | return -EINVAL; |
131 | #else | 131 | #else |
132 | VM_BUG_ON(iocb->ki_nbytes != PAGE_SIZE); | 132 | VM_BUG_ON(iocb->ki_nbytes != PAGE_SIZE); |
133 | 133 | ||
134 | if (rw == READ || rw == KERNEL_READ) | 134 | if (rw == READ || rw == KERNEL_READ) |
135 | return nfs_file_direct_read(iocb, iov, nr_segs, pos, | 135 | return nfs_file_direct_read(iocb, iter->iov, iter->nr_segs, pos, |
136 | rw == READ ? true : false); | 136 | rw == READ ? true : false); |
137 | return nfs_file_direct_write(iocb, iov, nr_segs, pos, | 137 | return nfs_file_direct_write(iocb, iter->iov, iter->nr_segs, pos, |
138 | rw == WRITE ? true : false); | 138 | rw == WRITE ? true : false); |
139 | #endif /* CONFIG_NFS_SWAP */ | 139 | #endif /* CONFIG_NFS_SWAP */ |
140 | } | 140 | } |
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c index b9c5726120e3..1c0e8fedc095 100644 --- a/fs/nilfs2/inode.c +++ b/fs/nilfs2/inode.c | |||
@@ -298,8 +298,8 @@ static int nilfs_write_end(struct file *file, struct address_space *mapping, | |||
298 | } | 298 | } |
299 | 299 | ||
300 | static ssize_t | 300 | static ssize_t |
301 | nilfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, | 301 | nilfs_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter, |
302 | loff_t offset, unsigned long nr_segs) | 302 | loff_t offset) |
303 | { | 303 | { |
304 | struct file *file = iocb->ki_filp; | 304 | struct file *file = iocb->ki_filp; |
305 | struct address_space *mapping = file->f_mapping; | 305 | struct address_space *mapping = file->f_mapping; |
@@ -310,8 +310,8 @@ nilfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, | |||
310 | return 0; | 310 | return 0; |
311 | 311 | ||
312 | /* Needs synchronization with the cleaner */ | 312 | /* Needs synchronization with the cleaner */ |
313 | size = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, | 313 | size = blockdev_direct_IO(rw, iocb, inode, iter->iov, offset, |
314 | nilfs_get_block); | 314 | iter->nr_segs, nilfs_get_block); |
315 | 315 | ||
316 | /* | 316 | /* |
317 | * In case of error extending write may have instantiated a few | 317 | * In case of error extending write may have instantiated a few |
@@ -319,7 +319,7 @@ nilfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, | |||
319 | */ | 319 | */ |
320 | if (unlikely((rw & WRITE) && size < 0)) { | 320 | if (unlikely((rw & WRITE) && size < 0)) { |
321 | loff_t isize = i_size_read(inode); | 321 | loff_t isize = i_size_read(inode); |
322 | loff_t end = offset + iov_length(iov, nr_segs); | 322 | loff_t end = offset + iov_length(iter->iov, iter->nr_segs); |
323 | 323 | ||
324 | if (end > isize) | 324 | if (end > isize) |
325 | nilfs_write_failed(mapping, end); | 325 | nilfs_write_failed(mapping, end); |
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index d310d12a9adc..799fd0afcb35 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c | |||
@@ -599,9 +599,8 @@ static int ocfs2_releasepage(struct page *page, gfp_t wait) | |||
599 | 599 | ||
600 | static ssize_t ocfs2_direct_IO(int rw, | 600 | static ssize_t ocfs2_direct_IO(int rw, |
601 | struct kiocb *iocb, | 601 | struct kiocb *iocb, |
602 | const struct iovec *iov, | 602 | struct iov_iter *iter, |
603 | loff_t offset, | 603 | loff_t offset) |
604 | unsigned long nr_segs) | ||
605 | { | 604 | { |
606 | struct file *file = iocb->ki_filp; | 605 | struct file *file = iocb->ki_filp; |
607 | struct inode *inode = file_inode(file)->i_mapping->host; | 606 | struct inode *inode = file_inode(file)->i_mapping->host; |
@@ -618,7 +617,7 @@ static ssize_t ocfs2_direct_IO(int rw, | |||
618 | return 0; | 617 | return 0; |
619 | 618 | ||
620 | return __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, | 619 | return __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, |
621 | iov, offset, nr_segs, | 620 | iter->iov, offset, iter->nr_segs, |
622 | ocfs2_direct_IO_get_blocks, | 621 | ocfs2_direct_IO_get_blocks, |
623 | ocfs2_dio_end_io, NULL, 0); | 622 | ocfs2_dio_end_io, NULL, 0); |
624 | } | 623 | } |
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index bc8b8009897d..17bf4c41a509 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c | |||
@@ -3083,15 +3083,14 @@ static int reiserfs_releasepage(struct page *page, gfp_t unused_gfp_flags) | |||
3083 | /* We thank Mingming Cao for helping us understand in great detail what | 3083 | /* We thank Mingming Cao for helping us understand in great detail what |
3084 | to do in this section of the code. */ | 3084 | to do in this section of the code. */ |
3085 | static ssize_t reiserfs_direct_IO(int rw, struct kiocb *iocb, | 3085 | static ssize_t reiserfs_direct_IO(int rw, struct kiocb *iocb, |
3086 | const struct iovec *iov, loff_t offset, | 3086 | struct iov_iter *iter, loff_t offset) |
3087 | unsigned long nr_segs) | ||
3088 | { | 3087 | { |
3089 | struct file *file = iocb->ki_filp; | 3088 | struct file *file = iocb->ki_filp; |
3090 | struct inode *inode = file->f_mapping->host; | 3089 | struct inode *inode = file->f_mapping->host; |
3091 | ssize_t ret; | 3090 | ssize_t ret; |
3092 | 3091 | ||
3093 | ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, | 3092 | ret = blockdev_direct_IO(rw, iocb, inode, iter->iov, offset, |
3094 | reiserfs_get_blocks_direct_io); | 3093 | iter->nr_segs, reiserfs_get_blocks_direct_io); |
3095 | 3094 | ||
3096 | /* | 3095 | /* |
3097 | * In case of error extending write may have instantiated a few | 3096 | * In case of error extending write may have instantiated a few |
@@ -3099,7 +3098,7 @@ static ssize_t reiserfs_direct_IO(int rw, struct kiocb *iocb, | |||
3099 | */ | 3098 | */ |
3100 | if (unlikely((rw & WRITE) && ret < 0)) { | 3099 | if (unlikely((rw & WRITE) && ret < 0)) { |
3101 | loff_t isize = i_size_read(inode); | 3100 | loff_t isize = i_size_read(inode); |
3102 | loff_t end = offset + iov_length(iov, nr_segs); | 3101 | loff_t end = offset + iov_length(iter->iov, iter->nr_segs); |
3103 | 3102 | ||
3104 | if ((end > isize) && inode_newsize_ok(inode, isize) == 0) { | 3103 | if ((end > isize) && inode_newsize_ok(inode, isize) == 0) { |
3105 | truncate_setsize(inode, isize); | 3104 | truncate_setsize(inode, isize); |
diff --git a/fs/udf/file.c b/fs/udf/file.c index d2c170f8b035..ade886401658 100644 --- a/fs/udf/file.c +++ b/fs/udf/file.c | |||
@@ -119,8 +119,8 @@ static int udf_adinicb_write_end(struct file *file, | |||
119 | } | 119 | } |
120 | 120 | ||
121 | static ssize_t udf_adinicb_direct_IO(int rw, struct kiocb *iocb, | 121 | static ssize_t udf_adinicb_direct_IO(int rw, struct kiocb *iocb, |
122 | const struct iovec *iov, | 122 | struct iov_iter *iter, |
123 | loff_t offset, unsigned long nr_segs) | 123 | loff_t offset) |
124 | { | 124 | { |
125 | /* Fallback to buffered I/O. */ | 125 | /* Fallback to buffered I/O. */ |
126 | return 0; | 126 | return 0; |
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 5d643706212f..5b184c7f7dcb 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c | |||
@@ -217,18 +217,18 @@ static int udf_write_begin(struct file *file, struct address_space *mapping, | |||
217 | } | 217 | } |
218 | 218 | ||
219 | static ssize_t udf_direct_IO(int rw, struct kiocb *iocb, | 219 | static ssize_t udf_direct_IO(int rw, struct kiocb *iocb, |
220 | const struct iovec *iov, | 220 | struct iov_iter *iter, |
221 | loff_t offset, unsigned long nr_segs) | 221 | loff_t offset) |
222 | { | 222 | { |
223 | struct file *file = iocb->ki_filp; | 223 | struct file *file = iocb->ki_filp; |
224 | struct address_space *mapping = file->f_mapping; | 224 | struct address_space *mapping = file->f_mapping; |
225 | struct inode *inode = mapping->host; | 225 | struct inode *inode = mapping->host; |
226 | ssize_t ret; | 226 | ssize_t ret; |
227 | 227 | ||
228 | ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, | 228 | ret = blockdev_direct_IO(rw, iocb, inode, iter->iov, offset, iter->nr_segs, |
229 | udf_get_block); | 229 | udf_get_block); |
230 | if (unlikely(ret < 0 && (rw & WRITE))) | 230 | if (unlikely(ret < 0 && (rw & WRITE))) |
231 | udf_write_failed(mapping, offset + iov_length(iov, nr_segs)); | 231 | udf_write_failed(mapping, offset + iov_length(iter->iov, iter->nr_segs)); |
232 | return ret; | 232 | return ret; |
233 | } | 233 | } |
234 | 234 | ||
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 0479c32c5eb1..330d7b1c4be3 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c | |||
@@ -1449,9 +1449,8 @@ STATIC ssize_t | |||
1449 | xfs_vm_direct_IO( | 1449 | xfs_vm_direct_IO( |
1450 | int rw, | 1450 | int rw, |
1451 | struct kiocb *iocb, | 1451 | struct kiocb *iocb, |
1452 | const struct iovec *iov, | 1452 | struct iov_iter *iter, |
1453 | loff_t offset, | 1453 | loff_t offset) |
1454 | unsigned long nr_segs) | ||
1455 | { | 1454 | { |
1456 | struct inode *inode = iocb->ki_filp->f_mapping->host; | 1455 | struct inode *inode = iocb->ki_filp->f_mapping->host; |
1457 | struct block_device *bdev = xfs_find_bdev_for_inode(inode); | 1456 | struct block_device *bdev = xfs_find_bdev_for_inode(inode); |
@@ -1459,7 +1458,7 @@ xfs_vm_direct_IO( | |||
1459 | ssize_t ret; | 1458 | ssize_t ret; |
1460 | 1459 | ||
1461 | if (rw & WRITE) { | 1460 | if (rw & WRITE) { |
1462 | size_t size = iov_length(iov, nr_segs); | 1461 | size_t size = iov_length(iter->iov, iter->nr_segs); |
1463 | 1462 | ||
1464 | /* | 1463 | /* |
1465 | * We cannot preallocate a size update transaction here as we | 1464 | * We cannot preallocate a size update transaction here as we |
@@ -1471,16 +1470,16 @@ xfs_vm_direct_IO( | |||
1471 | if (offset + size > XFS_I(inode)->i_d.di_size) | 1470 | if (offset + size > XFS_I(inode)->i_d.di_size) |
1472 | ioend->io_isdirect = 1; | 1471 | ioend->io_isdirect = 1; |
1473 | 1472 | ||
1474 | ret = __blockdev_direct_IO(rw, iocb, inode, bdev, iov, | 1473 | ret = __blockdev_direct_IO(rw, iocb, inode, bdev, iter->iov, |
1475 | offset, nr_segs, | 1474 | offset, iter->nr_segs, |
1476 | xfs_get_blocks_direct, | 1475 | xfs_get_blocks_direct, |
1477 | xfs_end_io_direct_write, NULL, | 1476 | xfs_end_io_direct_write, NULL, |
1478 | DIO_ASYNC_EXTEND); | 1477 | DIO_ASYNC_EXTEND); |
1479 | if (ret != -EIOCBQUEUED && iocb->private) | 1478 | if (ret != -EIOCBQUEUED && iocb->private) |
1480 | goto out_destroy_ioend; | 1479 | goto out_destroy_ioend; |
1481 | } else { | 1480 | } else { |
1482 | ret = __blockdev_direct_IO(rw, iocb, inode, bdev, iov, | 1481 | ret = __blockdev_direct_IO(rw, iocb, inode, bdev, iter->iov, |
1483 | offset, nr_segs, | 1482 | offset, iter->nr_segs, |
1484 | xfs_get_blocks_direct, | 1483 | xfs_get_blocks_direct, |
1485 | NULL, NULL, 0); | 1484 | NULL, NULL, 0); |
1486 | } | 1485 | } |