aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@samba.org>2012-09-18 19:20:28 -0400
committerSteve French <smfrench@gmail.com>2012-09-24 22:46:27 -0400
commitfc9c59662e0cd37577556d0de865268baeb9b293 (patch)
tree3b89e75e749bd1d06a7cbfd3cf4b074aa67eb7ec /fs/cifs
parent3a3bab509f3f0e7295caab24e9102ce303edb50b (diff)
CIFS: Move async read to ops struct
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/cifsglob.h3
-rw-r--r--fs/cifs/file.c8
-rw-r--r--fs/cifs/smb1ops.c1
-rw-r--r--fs/cifs/smb2maperror.c3
4 files changed, 13 insertions, 2 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index e5cb1941e251..fcf81c05635f 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -172,6 +172,7 @@ struct dfs_info3_param;
172struct cifs_fattr; 172struct cifs_fattr;
173struct smb_vol; 173struct smb_vol;
174struct cifs_fid; 174struct cifs_fid;
175struct cifs_readdata;
175 176
176struct smb_version_operations { 177struct smb_version_operations {
177 int (*send_cancel)(struct TCP_Server_Info *, void *, 178 int (*send_cancel)(struct TCP_Server_Info *, void *,
@@ -280,6 +281,8 @@ struct smb_version_operations {
280 int (*close)(const unsigned int, struct cifs_tcon *, struct cifs_fid *); 281 int (*close)(const unsigned int, struct cifs_tcon *, struct cifs_fid *);
281 /* send a flush request to the server */ 282 /* send a flush request to the server */
282 int (*flush)(const unsigned int, struct cifs_tcon *, struct cifs_fid *); 283 int (*flush)(const unsigned int, struct cifs_tcon *, struct cifs_fid *);
284 /* async read from the server */
285 int (*async_readv)(struct cifs_readdata *);
283}; 286};
284 287
285struct smb_version_values { 288struct smb_version_values {
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index aa1dccf0df9e..ec7c2e6bcbdf 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -2488,6 +2488,9 @@ static int
2488cifs_retry_async_readv(struct cifs_readdata *rdata) 2488cifs_retry_async_readv(struct cifs_readdata *rdata)
2489{ 2489{
2490 int rc; 2490 int rc;
2491 struct TCP_Server_Info *server;
2492
2493 server = tlink_tcon(rdata->cfile->tlink)->ses->server;
2491 2494
2492 do { 2495 do {
2493 if (rdata->cfile->invalidHandle) { 2496 if (rdata->cfile->invalidHandle) {
@@ -2495,7 +2498,7 @@ cifs_retry_async_readv(struct cifs_readdata *rdata)
2495 if (rc != 0) 2498 if (rc != 0)
2496 continue; 2499 continue;
2497 } 2500 }
2498 rc = cifs_async_readv(rdata); 2501 rc = server->ops->async_readv(rdata);
2499 } while (rc == -EAGAIN); 2502 } while (rc == -EAGAIN);
2500 2503
2501 return rc; 2504 return rc;
@@ -2647,6 +2650,9 @@ cifs_iovec_read(struct file *file, const struct iovec *iov,
2647 open_file = file->private_data; 2650 open_file = file->private_data;
2648 tcon = tlink_tcon(open_file->tlink); 2651 tcon = tlink_tcon(open_file->tlink);
2649 2652
2653 if (!tcon->ses->server->ops->async_readv)
2654 return -ENOSYS;
2655
2650 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD) 2656 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD)
2651 pid = open_file->pid; 2657 pid = open_file->pid;
2652 else 2658 else
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
index 7e8a2bdd69c8..e2dbd22cb136 100644
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
@@ -785,6 +785,7 @@ struct smb_version_operations smb1_operations = {
785 .set_fid = cifs_set_fid, 785 .set_fid = cifs_set_fid,
786 .close = cifs_close_file, 786 .close = cifs_close_file,
787 .flush = cifs_flush_file, 787 .flush = cifs_flush_file,
788 .async_readv = cifs_async_readv,
788}; 789};
789 790
790struct smb_version_values smb1_values = { 791struct smb_version_values smb1_values = {
diff --git a/fs/cifs/smb2maperror.c b/fs/cifs/smb2maperror.c
index be41478acc05..eaf5466d4041 100644
--- a/fs/cifs/smb2maperror.c
+++ b/fs/cifs/smb2maperror.c
@@ -2455,7 +2455,8 @@ map_smb2_to_linux_error(char *buf, bool log_err)
2455 return 0; 2455 return 0;
2456 2456
2457 /* mask facility */ 2457 /* mask facility */
2458 if (log_err && (smb2err != (STATUS_MORE_PROCESSING_REQUIRED))) 2458 if (log_err && (smb2err != STATUS_MORE_PROCESSING_REQUIRED) &&
2459 (smb2err != STATUS_END_OF_FILE))
2459 smb2_print_status(smb2err); 2460 smb2_print_status(smb2err);
2460 else if (cifsFYI & CIFS_RC) 2461 else if (cifsFYI & CIFS_RC)
2461 smb2_print_status(smb2err); 2462 smb2_print_status(smb2err);