]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
CIFS: Move async read to ops struct
authorPavel Shilovsky <pshilovsky@samba.org>
Fri, 1 Jun 2012 10:55:00 +0000 (14:55 +0400)
committerSteve French <sfrench@us.ibm.com>
Fri, 14 Sep 2012 12:47:10 +0000 (07:47 -0500)
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
fs/cifs/cifsglob.h
fs/cifs/file.c
fs/cifs/smb1ops.c
fs/cifs/smb2maperror.c

index e5cb1941e251cb69130fd527cb5bb68ec0db455f..fcf81c05635f81ccc51ad3bb2a8ba769aa578de8 100644 (file)
@@ -172,6 +172,7 @@ struct dfs_info3_param;
 struct cifs_fattr;
 struct smb_vol;
 struct cifs_fid;
+struct cifs_readdata;
 
 struct smb_version_operations {
        int (*send_cancel)(struct TCP_Server_Info *, void *,
@@ -280,6 +281,8 @@ struct smb_version_operations {
        int (*close)(const unsigned int, struct cifs_tcon *, struct cifs_fid *);
        /* send a flush request to the server */
        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 {
index aa1dccf0df9eabb3c682578a8cced77898ed4c9e..ec7c2e6bcbdfdbf9bbccf13423328f8be482c4e3 100644 (file)
@@ -2488,6 +2488,9 @@ static int
 cifs_retry_async_readv(struct cifs_readdata *rdata)
 {
        int rc;
+       struct TCP_Server_Info *server;
+
+       server = tlink_tcon(rdata->cfile->tlink)->ses->server;
 
        do {
                if (rdata->cfile->invalidHandle) {
@@ -2495,7 +2498,7 @@ cifs_retry_async_readv(struct cifs_readdata *rdata)
                        if (rc != 0)
                                continue;
                }
-               rc = cifs_async_readv(rdata);
+               rc = server->ops->async_readv(rdata);
        } while (rc == -EAGAIN);
 
        return rc;
@@ -2647,6 +2650,9 @@ cifs_iovec_read(struct file *file, const struct iovec *iov,
        open_file = file->private_data;
        tcon = tlink_tcon(open_file->tlink);
 
+       if (!tcon->ses->server->ops->async_readv)
+               return -ENOSYS;
+
        if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD)
                pid = open_file->pid;
        else
index 7e8a2bdd69c87acd8f6ab83081576ca7a4c8c25d..e2dbd22cb136dcf680320b462c2e8b9ff00a1b0c 100644 (file)
@@ -785,6 +785,7 @@ struct smb_version_operations smb1_operations = {
        .set_fid = cifs_set_fid,
        .close = cifs_close_file,
        .flush = cifs_flush_file,
+       .async_readv = cifs_async_readv,
 };
 
 struct smb_version_values smb1_values = {
index be41478acc05ef5395bc40b2ea9f101f38eb62f5..eaf5466d4041f79601fadcd146e5e9a220293386 100644 (file)
@@ -2455,7 +2455,8 @@ map_smb2_to_linux_error(char *buf, bool log_err)
                return 0;
 
        /* 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);
        else if (cifsFYI & CIFS_RC)
                smb2_print_status(smb2err);