From b235a11ad507e4db2ad7b86d7b50dd4b5d6a85ef Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Thu, 3 Oct 2013 13:05:20 +0100 Subject: [PATCH] ceph: Fix up for iov_iter changes Extend an earlier fixup by Stephen Rothwell. Signed-off-by: Mark Brown --- fs/ceph/file.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/ceph/file.c b/fs/ceph/file.c index c4419e848a4f..37b5b5c4ad5b 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -434,8 +434,8 @@ static ssize_t ceph_sync_read(struct kiocb *iocb, struct iov_iter *i, if (file->f_flags & O_DIRECT) { while (iov_iter_count(i)) { - void __user *data = i->iov[0].iov_base + i->iov_offset; - size_t len = i->iov[0].iov_len - i->iov_offset; + void __user *data = iov_iter_iovec(i)->iov_base + i->iov_offset; + size_t len = iov_iter_iovec(i)->iov_len - i->iov_offset; num_pages = calc_pages_for((unsigned long)data, len); pages = ceph_get_direct_page_vector(data, @@ -467,9 +467,9 @@ static ssize_t ceph_sync_read(struct kiocb *iocb, struct iov_iter *i, size_t left = len = ret; while (left) { - void __user *data = i->iov[0].iov_base + void __user *data = iov_iter_iovec(i)->iov_base + i->iov_offset; - l = min(i->iov[0].iov_len - i->iov_offset, + l = min(iov_iter_iovec(i)->iov_len - i->iov_offset, left); ret = ceph_copy_page_vector_to_user(&pages[k], @@ -583,8 +583,8 @@ ceph_sync_direct_write(struct kiocb *iocb, const struct iovec *iov, iov_iter_init(&i, iov, nr_segs, count, 0); while (iov_iter_count(&i) > 0) { - void __user *data = i.iov->iov_base + i.iov_offset; - u64 len = i.iov->iov_len - i.iov_offset; + void __user *data = iov_iter_iovec(&i)->iov_base + i.iov_offset; + u64 len = iov_iter_iovec(&i)->iov_len - i.iov_offset; page_align = (unsigned long)data & ~PAGE_MASK; -- 2.39.5