summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-02-04 14:19:48 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2014-04-01 23:19:24 -0400
commit0165e8100be3b2b81f747ebc25418656404c61b8 (patch)
treeded80e25ecffa6228fcc3ce7b16c036916c10457 /fs
parent7f25bba819a38ab7310024a9350655f374707e20 (diff)
downloadop-kernel-dev-0165e8100be3b2b81f747ebc25418656404c61b8.zip
op-kernel-dev-0165e8100be3b2b81f747ebc25418656404c61b8.tar.gz
fold cifs_iovec_read() into its (only) caller
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/file.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index ad63e47..3443b8f 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,
return total_read > 0 ? total_read : result;
}
-static ssize_t
-cifs_iovec_read(struct file *file, const struct iovec *iov,
- unsigned long nr_segs, loff_t *poffset)
+ssize_t cifs_user_readv(struct kiocb *iocb, const struct iovec *iov,
+ unsigned long nr_segs, loff_t pos)
{
+ struct file *file = iocb->ki_filp;
ssize_t rc;
size_t len, cur_len;
ssize_t total_read = 0;
- loff_t offset = *poffset;
+ loff_t offset = pos;
unsigned int npages;
struct cifs_sb_info *cifs_sb;
struct cifs_tcon *tcon;
@@ -2919,25 +2919,16 @@ error:
total_read = len - iov_iter_count(&to);
cifs_stats_bytes_read(tcon, total_read);
- *poffset += total_read;
/* mask nodata case */
if (rc == -ENODATA)
rc = 0;
- return total_read ? total_read : rc;
-}
-
-ssize_t cifs_user_readv(struct kiocb *iocb, const struct iovec *iov,
- unsigned long nr_segs, loff_t pos)
-{
- ssize_t read;
-
- read = cifs_iovec_read(iocb->ki_filp, iov, nr_segs, &pos);
- if (read > 0)
- iocb->ki_pos = pos;
-
- return read;
+ if (total_read) {
+ iocb->ki_pos = pos + total_read;
+ return total_read;
+ }
+ return rc;
}
ssize_t
OpenPOWER on IntegriCloud