diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-04-02 14:37:59 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-05-06 17:37:56 -0400 |
commit | b4f5d2c6d1f88c79e48f1296076b3a6a22f58c0f (patch) | |
tree | 0c3b07aa36c1513a8d0fdb777af7cdcae8e3a009 /fs/xfs/xfs_file.c | |
parent | aad4f8bb42af06371aa0e85bf0cd9d52c0494985 (diff) |
xfs: switch to ->read_iter()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/xfs/xfs_file.c')
-rw-r--r-- | fs/xfs/xfs_file.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 96799eb31c80..a1acd2fa57e8 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c | |||
@@ -229,32 +229,27 @@ xfs_file_fsync( | |||
229 | } | 229 | } |
230 | 230 | ||
231 | STATIC ssize_t | 231 | STATIC ssize_t |
232 | xfs_file_aio_read( | 232 | xfs_file_read_iter( |
233 | struct kiocb *iocb, | 233 | struct kiocb *iocb, |
234 | const struct iovec *iovp, | 234 | struct iov_iter *to) |
235 | unsigned long nr_segs, | ||
236 | loff_t pos) | ||
237 | { | 235 | { |
238 | struct file *file = iocb->ki_filp; | 236 | struct file *file = iocb->ki_filp; |
239 | struct inode *inode = file->f_mapping->host; | 237 | struct inode *inode = file->f_mapping->host; |
240 | struct xfs_inode *ip = XFS_I(inode); | 238 | struct xfs_inode *ip = XFS_I(inode); |
241 | struct xfs_mount *mp = ip->i_mount; | 239 | struct xfs_mount *mp = ip->i_mount; |
242 | size_t size = 0; | 240 | size_t size = iov_iter_count(to); |
243 | ssize_t ret = 0; | 241 | ssize_t ret = 0; |
244 | int ioflags = 0; | 242 | int ioflags = 0; |
245 | xfs_fsize_t n; | 243 | xfs_fsize_t n; |
244 | loff_t pos = iocb->ki_pos; | ||
246 | 245 | ||
247 | XFS_STATS_INC(xs_read_calls); | 246 | XFS_STATS_INC(xs_read_calls); |
248 | 247 | ||
249 | BUG_ON(iocb->ki_pos != pos); | ||
250 | |||
251 | if (unlikely(file->f_flags & O_DIRECT)) | 248 | if (unlikely(file->f_flags & O_DIRECT)) |
252 | ioflags |= IO_ISDIRECT; | 249 | ioflags |= IO_ISDIRECT; |
253 | if (file->f_mode & FMODE_NOCMTIME) | 250 | if (file->f_mode & FMODE_NOCMTIME) |
254 | ioflags |= IO_INVIS; | 251 | ioflags |= IO_INVIS; |
255 | 252 | ||
256 | size = iov_length(iovp, nr_segs); | ||
257 | |||
258 | if (unlikely(ioflags & IO_ISDIRECT)) { | 253 | if (unlikely(ioflags & IO_ISDIRECT)) { |
259 | xfs_buftarg_t *target = | 254 | xfs_buftarg_t *target = |
260 | XFS_IS_REALTIME_INODE(ip) ? | 255 | XFS_IS_REALTIME_INODE(ip) ? |
@@ -307,7 +302,7 @@ xfs_file_aio_read( | |||
307 | 302 | ||
308 | trace_xfs_file_read(ip, size, pos, ioflags); | 303 | trace_xfs_file_read(ip, size, pos, ioflags); |
309 | 304 | ||
310 | ret = generic_file_aio_read(iocb, iovp, nr_segs, pos); | 305 | ret = generic_file_read_iter(iocb, to); |
311 | if (ret > 0) | 306 | if (ret > 0) |
312 | XFS_STATS_ADD(xs_read_bytes, ret); | 307 | XFS_STATS_ADD(xs_read_bytes, ret); |
313 | 308 | ||
@@ -1453,9 +1448,9 @@ xfs_file_llseek( | |||
1453 | 1448 | ||
1454 | const struct file_operations xfs_file_operations = { | 1449 | const struct file_operations xfs_file_operations = { |
1455 | .llseek = xfs_file_llseek, | 1450 | .llseek = xfs_file_llseek, |
1456 | .read = do_sync_read, | 1451 | .read = new_sync_read, |
1457 | .write = do_sync_write, | 1452 | .write = do_sync_write, |
1458 | .aio_read = xfs_file_aio_read, | 1453 | .read_iter = xfs_file_read_iter, |
1459 | .aio_write = xfs_file_aio_write, | 1454 | .aio_write = xfs_file_aio_write, |
1460 | .splice_read = xfs_file_splice_read, | 1455 | .splice_read = xfs_file_splice_read, |
1461 | .splice_write = xfs_file_splice_write, | 1456 | .splice_write = xfs_file_splice_write, |