Commit fc9c5966 authored by Pavel Shilovsky's avatar Pavel Shilovsky Committed by Steve French

CIFS: Move async read to ops struct

Signed-off-by: default avatarPavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: default avatarSteve French <smfrench@gmail.com>
parent 3a3bab50
...@@ -172,6 +172,7 @@ struct dfs_info3_param; ...@@ -172,6 +172,7 @@ struct dfs_info3_param;
struct cifs_fattr; struct cifs_fattr;
struct smb_vol; struct smb_vol;
struct cifs_fid; struct cifs_fid;
struct cifs_readdata;
struct smb_version_operations { struct smb_version_operations {
int (*send_cancel)(struct TCP_Server_Info *, void *, int (*send_cancel)(struct TCP_Server_Info *, void *,
...@@ -280,6 +281,8 @@ struct smb_version_operations { ...@@ -280,6 +281,8 @@ struct smb_version_operations {
int (*close)(const unsigned int, struct cifs_tcon *, struct cifs_fid *); int (*close)(const unsigned int, struct cifs_tcon *, struct cifs_fid *);
/* send a flush request to the server */ /* send a flush request to the server */
int (*flush)(const unsigned int, struct cifs_tcon *, struct cifs_fid *); int (*flush)(const unsigned int, struct cifs_tcon *, struct cifs_fid *);
/* async read from the server */
int (*async_readv)(struct cifs_readdata *);
}; };
struct smb_version_values { struct smb_version_values {
......
...@@ -2488,6 +2488,9 @@ static int ...@@ -2488,6 +2488,9 @@ static int
cifs_retry_async_readv(struct cifs_readdata *rdata) cifs_retry_async_readv(struct cifs_readdata *rdata)
{ {
int rc; int rc;
struct TCP_Server_Info *server;
server = tlink_tcon(rdata->cfile->tlink)->ses->server;
do { do {
if (rdata->cfile->invalidHandle) { if (rdata->cfile->invalidHandle) {
...@@ -2495,7 +2498,7 @@ cifs_retry_async_readv(struct cifs_readdata *rdata) ...@@ -2495,7 +2498,7 @@ cifs_retry_async_readv(struct cifs_readdata *rdata)
if (rc != 0) if (rc != 0)
continue; continue;
} }
rc = cifs_async_readv(rdata); rc = server->ops->async_readv(rdata);
} while (rc == -EAGAIN); } while (rc == -EAGAIN);
return rc; return rc;
...@@ -2647,6 +2650,9 @@ cifs_iovec_read(struct file *file, const struct iovec *iov, ...@@ -2647,6 +2650,9 @@ cifs_iovec_read(struct file *file, const struct iovec *iov,
open_file = file->private_data; open_file = file->private_data;
tcon = tlink_tcon(open_file->tlink); tcon = tlink_tcon(open_file->tlink);
if (!tcon->ses->server->ops->async_readv)
return -ENOSYS;
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD) if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD)
pid = open_file->pid; pid = open_file->pid;
else else
......
...@@ -785,6 +785,7 @@ struct smb_version_operations smb1_operations = { ...@@ -785,6 +785,7 @@ struct smb_version_operations smb1_operations = {
.set_fid = cifs_set_fid, .set_fid = cifs_set_fid,
.close = cifs_close_file, .close = cifs_close_file,
.flush = cifs_flush_file, .flush = cifs_flush_file,
.async_readv = cifs_async_readv,
}; };
struct smb_version_values smb1_values = { struct smb_version_values smb1_values = {
......
...@@ -2455,7 +2455,8 @@ map_smb2_to_linux_error(char *buf, bool log_err) ...@@ -2455,7 +2455,8 @@ map_smb2_to_linux_error(char *buf, bool log_err)
return 0; return 0;
/* mask facility */ /* mask facility */
if (log_err && (smb2err != (STATUS_MORE_PROCESSING_REQUIRED))) if (log_err && (smb2err != STATUS_MORE_PROCESSING_REQUIRED) &&
(smb2err != STATUS_END_OF_FILE))
smb2_print_status(smb2err); smb2_print_status(smb2err);
else if (cifsFYI & CIFS_RC) else if (cifsFYI & CIFS_RC)
smb2_print_status(smb2err); smb2_print_status(smb2err);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment