summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-04-07 08:51:58 -0700
committerAl Viro <viro@zeniv.linux.org.uk>2016-05-01 19:58:39 -0400
commitc8b8e32d700fe943a935e435ae251364d016c497 (patch)
tree956e582a123c6b2761e80901bdaaedc5ba4137e3 /fs/ocfs2
parent13712713caba0c1b8c2c0070a4c1f4487def8dee (diff)
downloadop-kernel-dev-c8b8e32d700fe943a935e435ae251364d016c497.zip
op-kernel-dev-c8b8e32d700fe943a935e435ae251364d016c497.tar.gz
direct-io: eliminate the offset argument to ->direct_IO
Including blkdev_direct_IO and dax_do_io. It has to be ki_pos to actually work, so eliminate the superflous argument. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/aops.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index ad15773..6c66c62 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -2423,13 +2423,11 @@ static int ocfs2_dio_end_io(struct kiocb *iocb,
return 0;
}
-static ssize_t ocfs2_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
- loff_t offset)
+static ssize_t ocfs2_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
{
struct file *file = iocb->ki_filp;
struct inode *inode = file_inode(file)->i_mapping->host;
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
- loff_t end = offset + iter->count;
get_block_t *get_block;
/*
@@ -2440,7 +2438,8 @@ static ssize_t ocfs2_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
return 0;
/* Fallback to buffered I/O if we do not support append dio. */
- if (end > i_size_read(inode) && !ocfs2_supports_append_dio(osb))
+ if (iocb->ki_pos + iter->count > i_size_read(inode) &&
+ !ocfs2_supports_append_dio(osb))
return 0;
if (iov_iter_rw(iter) == READ)
@@ -2449,7 +2448,7 @@ static ssize_t ocfs2_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
get_block = ocfs2_dio_get_block;
return __blockdev_direct_IO(iocb, inode, inode->i_sb->s_bdev,
- iter, offset, get_block,
+ iter, get_block,
ocfs2_dio_end_io, NULL, 0);
}
OpenPOWER on IntegriCloud