diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-02-04 14:19:48 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-04-01 23:19:24 -0400 |
commit | 0165e8100be3b2b81f747ebc25418656404c61b8 (patch) | |
tree | ded80e25ecffa6228fcc3ce7b16c036916c10457 /fs/cifs | |
parent | 7f25bba819a38ab7310024a9350655f374707e20 (diff) |
fold cifs_iovec_read() into its (only) caller
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/file.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index ad63e4740aff..3443b8f8e1c0 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -2808,14 +2808,14 @@ cifs_uncached_read_into_pages(struct TCP_Server_Info *server, | |||
2808 | return total_read > 0 ? total_read : result; | 2808 | return total_read > 0 ? total_read : result; |
2809 | } | 2809 | } |
2810 | 2810 | ||
2811 | static ssize_t | 2811 | ssize_t cifs_user_readv(struct kiocb *iocb, const struct iovec *iov, |
2812 | cifs_iovec_read(struct file *file, const struct iovec *iov, | 2812 | unsigned long nr_segs, loff_t pos) |
2813 | unsigned long nr_segs, loff_t *poffset) | ||
2814 | { | 2813 | { |
2814 | struct file *file = iocb->ki_filp; | ||
2815 | ssize_t rc; | 2815 | ssize_t rc; |
2816 | size_t len, cur_len; | 2816 | size_t len, cur_len; |
2817 | ssize_t total_read = 0; | 2817 | ssize_t total_read = 0; |
2818 | loff_t offset = *poffset; | 2818 | loff_t offset = pos; |
2819 | unsigned int npages; | 2819 | unsigned int npages; |
2820 | struct cifs_sb_info *cifs_sb; | 2820 | struct cifs_sb_info *cifs_sb; |
2821 | struct cifs_tcon *tcon; | 2821 | struct cifs_tcon *tcon; |
@@ -2919,25 +2919,16 @@ error: | |||
2919 | total_read = len - iov_iter_count(&to); | 2919 | total_read = len - iov_iter_count(&to); |
2920 | 2920 | ||
2921 | cifs_stats_bytes_read(tcon, total_read); | 2921 | cifs_stats_bytes_read(tcon, total_read); |
2922 | *poffset += total_read; | ||
2923 | 2922 | ||
2924 | /* mask nodata case */ | 2923 | /* mask nodata case */ |
2925 | if (rc == -ENODATA) | 2924 | if (rc == -ENODATA) |
2926 | rc = 0; | 2925 | rc = 0; |
2927 | 2926 | ||
2928 | return total_read ? total_read : rc; | 2927 | if (total_read) { |
2929 | } | 2928 | iocb->ki_pos = pos + total_read; |
2930 | 2929 | return total_read; | |
2931 | ssize_t cifs_user_readv(struct kiocb *iocb, const struct iovec *iov, | 2930 | } |
2932 | unsigned long nr_segs, loff_t pos) | 2931 | return rc; |
2933 | { | ||
2934 | ssize_t read; | ||
2935 | |||
2936 | read = cifs_iovec_read(iocb->ki_filp, iov, nr_segs, &pos); | ||
2937 | if (read > 0) | ||
2938 | iocb->ki_pos = pos; | ||
2939 | |||
2940 | return read; | ||
2941 | } | 2932 | } |
2942 | 2933 | ||
2943 | ssize_t | 2934 | ssize_t |