diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-04-02 20:28:01 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-05-06 17:38:00 -0400 |
commit | 3644424dc6309439c4c8d97590cdac4100376255 (patch) | |
tree | 31225302c90f0847d1f9a3022748b5b411944c0a /fs | |
parent | 3aa2d199f8eb8149a88005e88736d583cbc39d31 (diff) |
ceph: switch to ->read_iter()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ceph/file.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 5b93cadedfbe..c9a24ba98c9a 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -795,8 +795,7 @@ out: | |||
795 | * | 795 | * |
796 | * Hmm, the sync read case isn't actually async... should it be? | 796 | * Hmm, the sync read case isn't actually async... should it be? |
797 | */ | 797 | */ |
798 | static ssize_t ceph_aio_read(struct kiocb *iocb, const struct iovec *iov, | 798 | static ssize_t ceph_read_iter(struct kiocb *iocb, struct iov_iter *to) |
799 | unsigned long nr_segs, loff_t pos) | ||
800 | { | 799 | { |
801 | struct file *filp = iocb->ki_filp; | 800 | struct file *filp = iocb->ki_filp; |
802 | struct ceph_file_info *fi = filp->private_data; | 801 | struct ceph_file_info *fi = filp->private_data; |
@@ -806,9 +805,6 @@ static ssize_t ceph_aio_read(struct kiocb *iocb, const struct iovec *iov, | |||
806 | ssize_t ret; | 805 | ssize_t ret; |
807 | int want, got = 0; | 806 | int want, got = 0; |
808 | int checkeof = 0, read = 0; | 807 | int checkeof = 0, read = 0; |
809 | struct iov_iter i; | ||
810 | |||
811 | iov_iter_init(&i, READ, iov, nr_segs, len); | ||
812 | 808 | ||
813 | again: | 809 | again: |
814 | dout("aio_read %p %llx.%llx %llu~%u trying to get caps on %p\n", | 810 | dout("aio_read %p %llx.%llx %llu~%u trying to get caps on %p\n", |
@@ -831,13 +827,13 @@ again: | |||
831 | ceph_cap_string(got)); | 827 | ceph_cap_string(got)); |
832 | 828 | ||
833 | /* hmm, this isn't really async... */ | 829 | /* hmm, this isn't really async... */ |
834 | ret = ceph_sync_read(iocb, &i, &checkeof); | 830 | ret = ceph_sync_read(iocb, to, &checkeof); |
835 | } else { | 831 | } else { |
836 | dout("aio_read %p %llx.%llx %llu~%u got cap refs on %s\n", | 832 | dout("aio_read %p %llx.%llx %llu~%u got cap refs on %s\n", |
837 | inode, ceph_vinop(inode), pos, (unsigned)len, | 833 | inode, ceph_vinop(inode), iocb->ki_pos, (unsigned)len, |
838 | ceph_cap_string(got)); | 834 | ceph_cap_string(got)); |
839 | 835 | ||
840 | ret = generic_file_read_iter(iocb, &i); | 836 | ret = generic_file_read_iter(iocb, to); |
841 | } | 837 | } |
842 | dout("aio_read %p %llx.%llx dropping cap refs on %s = %d\n", | 838 | dout("aio_read %p %llx.%llx dropping cap refs on %s = %d\n", |
843 | inode, ceph_vinop(inode), ceph_cap_string(got), (int)ret); | 839 | inode, ceph_vinop(inode), ceph_cap_string(got), (int)ret); |
@@ -854,7 +850,7 @@ again: | |||
854 | ", reading more\n", iocb->ki_pos, | 850 | ", reading more\n", iocb->ki_pos, |
855 | inode->i_size); | 851 | inode->i_size); |
856 | 852 | ||
857 | iov_iter_advance(&i, ret); | 853 | iov_iter_advance(to, ret); |
858 | read += ret; | 854 | read += ret; |
859 | len -= ret; | 855 | len -= ret; |
860 | checkeof = 0; | 856 | checkeof = 0; |
@@ -1257,9 +1253,9 @@ const struct file_operations ceph_file_fops = { | |||
1257 | .open = ceph_open, | 1253 | .open = ceph_open, |
1258 | .release = ceph_release, | 1254 | .release = ceph_release, |
1259 | .llseek = ceph_llseek, | 1255 | .llseek = ceph_llseek, |
1260 | .read = do_sync_read, | 1256 | .read = new_sync_read, |
1261 | .write = do_sync_write, | 1257 | .write = do_sync_write, |
1262 | .aio_read = ceph_aio_read, | 1258 | .read_iter = ceph_read_iter, |
1263 | .aio_write = ceph_aio_write, | 1259 | .aio_write = ceph_aio_write, |
1264 | .mmap = ceph_mmap, | 1260 | .mmap = ceph_mmap, |
1265 | .fsync = ceph_fsync, | 1261 | .fsync = ceph_fsync, |