From 6759758c696da4eed00d532d5fed58d0a312eb41 Mon Sep 17 00:00:00 2001 From: Pavel Shilovsky Date: Thu, 17 May 2012 12:18:21 +0400 Subject: [PATCH] --- yaml --- r: 308809 b: refs/heads/master c: 082d0642c61fc309ca7f6133968ba1264193dcc1 h: refs/heads/master i: 308807: 949b3e31ede30eabcc428e7aadb761fdb2f8dd8c v: v3 --- [refs] | 2 +- trunk/fs/cifs/cifsglob.h | 7 +++++++ trunk/fs/cifs/cifsproto.h | 2 ++ trunk/fs/cifs/smb1ops.c | 2 ++ trunk/fs/cifs/transport.c | 7 ++++--- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 87f98193ff58..fd904b22c73f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2608bee744a92d60d15ff4e6e0b913d8b406aedd +refs/heads/master: 082d0642c61fc309ca7f6133968ba1264193dcc1 diff --git a/trunk/fs/cifs/cifsglob.h b/trunk/fs/cifs/cifsglob.h index b6e97f8586d2..5b108382902a 100644 --- a/trunk/fs/cifs/cifsglob.h +++ b/trunk/fs/cifs/cifsglob.h @@ -157,11 +157,18 @@ enum smb_version { struct mid_q_entry; struct TCP_Server_Info; struct cifsFileInfo; +struct cifs_ses; struct smb_version_operations { int (*send_cancel)(struct TCP_Server_Info *, void *, struct mid_q_entry *); bool (*compare_fids)(struct cifsFileInfo *, struct cifsFileInfo *); + /* setup request: allocate mid, sign message */ + int (*setup_request)(struct cifs_ses *, struct kvec *, unsigned int, + struct mid_q_entry **); + /* check response: verify signature, map error */ + int (*check_receive)(struct mid_q_entry *, struct TCP_Server_Info *, + bool); }; struct smb_version_values { diff --git a/trunk/fs/cifs/cifsproto.h b/trunk/fs/cifs/cifsproto.h index 0a3fa960b84d..57af64220747 100644 --- a/trunk/fs/cifs/cifsproto.h +++ b/trunk/fs/cifs/cifsproto.h @@ -78,6 +78,8 @@ extern int SendReceive(const unsigned int /* xid */ , struct cifs_ses *, int * /* bytes returned */ , const int long_op); extern int SendReceiveNoRsp(const unsigned int xid, struct cifs_ses *ses, char *in_buf, int flags); +extern int cifs_setup_request(struct cifs_ses *, struct kvec *, unsigned int, + struct mid_q_entry **); extern int cifs_check_receive(struct mid_q_entry *mid, struct TCP_Server_Info *server, bool log_error); extern int SendReceive2(const unsigned int /* xid */ , struct cifs_ses *, diff --git a/trunk/fs/cifs/smb1ops.c b/trunk/fs/cifs/smb1ops.c index ce27f8698b20..9cf76e89745f 100644 --- a/trunk/fs/cifs/smb1ops.c +++ b/trunk/fs/cifs/smb1ops.c @@ -69,6 +69,8 @@ cifs_compare_fids(struct cifsFileInfo *ob1, struct cifsFileInfo *ob2) struct smb_version_operations smb1_operations = { .send_cancel = send_nt_cancel, .compare_fids = cifs_compare_fids, + .setup_request = cifs_setup_request, + .check_receive = cifs_check_receive, }; struct smb_version_values smb1_values = { diff --git a/trunk/fs/cifs/transport.c b/trunk/fs/cifs/transport.c index 269a5a7e0030..87bd998cfbec 100644 --- a/trunk/fs/cifs/transport.c +++ b/trunk/fs/cifs/transport.c @@ -514,7 +514,7 @@ cifs_check_receive(struct mid_q_entry *mid, struct TCP_Server_Info *server, return map_smb_to_linux_error(mid->resp_buf, log_error); } -static int +int cifs_setup_request(struct cifs_ses *ses, struct kvec *iov, unsigned int nvec, struct mid_q_entry **ret_mid) { @@ -577,7 +577,7 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses, mutex_lock(&ses->server->srv_mutex); - rc = cifs_setup_request(ses, iov, n_vec, &midQ); + rc = ses->server->ops->setup_request(ses, iov, n_vec, &midQ); if (rc) { mutex_unlock(&ses->server->srv_mutex); cifs_small_buf_release(buf); @@ -640,7 +640,8 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses, else *pRespBufType = CIFS_SMALL_BUFFER; - rc = cifs_check_receive(midQ, ses->server, flags & CIFS_LOG_ERROR); + rc = ses->server->ops->check_receive(midQ, ses->server, + flags & CIFS_LOG_ERROR); /* mark it so buf will not be freed by delete_mid */ if ((flags & CIFS_NO_RESP) == 0)