aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/cifs/cifsglob.h5
-rw-r--r--fs/cifs/cifsproto.h10
-rw-r--r--fs/cifs/cifssmb.c2
-rw-r--r--fs/cifs/connect.c18
-rw-r--r--fs/cifs/sess.c2
-rw-r--r--fs/cifs/smb1ops.c2
6 files changed, 24 insertions, 15 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 8a4150573cf8..a6eb9befdb2d 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -196,6 +196,11 @@ struct smb_version_operations {
196 bool (*need_neg)(struct TCP_Server_Info *); 196 bool (*need_neg)(struct TCP_Server_Info *);
197 /* negotiate to the server */ 197 /* negotiate to the server */
198 int (*negotiate)(const unsigned int, struct cifs_ses *); 198 int (*negotiate)(const unsigned int, struct cifs_ses *);
199 /* setup smb sessionn */
200 int (*sess_setup)(const unsigned int, struct cifs_ses *,
201 const struct nls_table *);
202 /* close smb session */
203 int (*logoff)(const unsigned int, struct cifs_ses *);
199}; 204};
200 205
201struct smb_version_values { 206struct smb_version_values {
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index 723a3273c6bb..a17be2618473 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -112,8 +112,8 @@ extern void header_assemble(struct smb_hdr *, char /* command */ ,
112extern int small_smb_init_no_tc(const int smb_cmd, const int wct, 112extern int small_smb_init_no_tc(const int smb_cmd, const int wct,
113 struct cifs_ses *ses, 113 struct cifs_ses *ses,
114 void **request_buf); 114 void **request_buf);
115extern int CIFS_SessSetup(unsigned int xid, struct cifs_ses *ses, 115extern int CIFS_SessSetup(const unsigned int xid, struct cifs_ses *ses,
116 const struct nls_table *nls_cp); 116 const struct nls_table *nls_cp);
117extern struct timespec cifs_NTtimeToUnix(__le64 utc_nanoseconds_since_1601); 117extern struct timespec cifs_NTtimeToUnix(__le64 utc_nanoseconds_since_1601);
118extern u64 cifs_UnixTimeToNT(struct timespec); 118extern u64 cifs_UnixTimeToNT(struct timespec);
119extern struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, 119extern struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time,
@@ -180,8 +180,8 @@ void cifs_proc_clean(void);
180 180
181extern int cifs_negotiate_protocol(const unsigned int xid, 181extern int cifs_negotiate_protocol(const unsigned int xid,
182 struct cifs_ses *ses); 182 struct cifs_ses *ses);
183extern int cifs_setup_session(unsigned int xid, struct cifs_ses *ses, 183extern int cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
184 struct nls_table *nls_info); 184 struct nls_table *nls_info);
185extern int CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses); 185extern int CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses);
186 186
187extern int CIFSTCon(unsigned int xid, struct cifs_ses *ses, 187extern int CIFSTCon(unsigned int xid, struct cifs_ses *ses,
@@ -391,7 +391,7 @@ extern int CIFSSMBPosixLock(const int xid, struct cifs_tcon *tcon,
391 const bool waitFlag); 391 const bool waitFlag);
392extern int CIFSSMBTDis(const int xid, struct cifs_tcon *tcon); 392extern int CIFSSMBTDis(const int xid, struct cifs_tcon *tcon);
393extern int CIFSSMBEcho(struct TCP_Server_Info *server); 393extern int CIFSSMBEcho(struct TCP_Server_Info *server);
394extern int CIFSSMBLogoff(const int xid, struct cifs_ses *ses); 394extern int CIFSSMBLogoff(const unsigned int xid, struct cifs_ses *ses);
395 395
396extern struct cifs_ses *sesInfoAlloc(void); 396extern struct cifs_ses *sesInfoAlloc(void);
397extern void sesInfoFree(struct cifs_ses *); 397extern void sesInfoFree(struct cifs_ses *);
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index ae59d6e4e4f5..915b8fc212e9 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -781,7 +781,7 @@ CIFSSMBEcho(struct TCP_Server_Info *server)
781} 781}
782 782
783int 783int
784CIFSSMBLogoff(const int xid, struct cifs_ses *ses) 784CIFSSMBLogoff(const unsigned int xid, struct cifs_ses *ses)
785{ 785{
786 LOGOFF_ANDX_REQ *pSMB; 786 LOGOFF_ANDX_REQ *pSMB;
787 int rc = 0; 787 int rc = 0;
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 03389f59390f..444243d9232b 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2253,7 +2253,7 @@ cifs_find_smb_ses(struct TCP_Server_Info *server, struct smb_vol *vol)
2253static void 2253static void
2254cifs_put_smb_ses(struct cifs_ses *ses) 2254cifs_put_smb_ses(struct cifs_ses *ses)
2255{ 2255{
2256 int xid; 2256 unsigned int xid;
2257 struct TCP_Server_Info *server = ses->server; 2257 struct TCP_Server_Info *server = ses->server;
2258 2258
2259 cFYI(1, "%s: ses_count=%d", __func__, ses->ses_count); 2259 cFYI(1, "%s: ses_count=%d", __func__, ses->ses_count);
@@ -2266,9 +2266,9 @@ cifs_put_smb_ses(struct cifs_ses *ses)
2266 list_del_init(&ses->smb_ses_list); 2266 list_del_init(&ses->smb_ses_list);
2267 spin_unlock(&cifs_tcp_ses_lock); 2267 spin_unlock(&cifs_tcp_ses_lock);
2268 2268
2269 if (ses->status == CifsGood) { 2269 if (ses->status == CifsGood && server->ops->logoff) {
2270 xid = GetXid(); 2270 xid = GetXid();
2271 CIFSSMBLogoff(xid, ses); 2271 server->ops->logoff(xid, ses);
2272 _FreeXid(xid); 2272 _FreeXid(xid);
2273 } 2273 }
2274 sesInfoFree(ses); 2274 sesInfoFree(ses);
@@ -3989,11 +3989,11 @@ cifs_negotiate_protocol(const unsigned int xid, struct cifs_ses *ses)
3989 return rc; 3989 return rc;
3990} 3990}
3991 3991
3992 3992int
3993int cifs_setup_session(unsigned int xid, struct cifs_ses *ses, 3993cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
3994 struct nls_table *nls_info) 3994 struct nls_table *nls_info)
3995{ 3995{
3996 int rc = 0; 3996 int rc = -ENOSYS;
3997 struct TCP_Server_Info *server = ses->server; 3997 struct TCP_Server_Info *server = ses->server;
3998 3998
3999 ses->flags = 0; 3999 ses->flags = 0;
@@ -4004,7 +4004,9 @@ int cifs_setup_session(unsigned int xid, struct cifs_ses *ses,
4004 cFYI(1, "Security Mode: 0x%x Capabilities: 0x%x TimeAdjust: %d", 4004 cFYI(1, "Security Mode: 0x%x Capabilities: 0x%x TimeAdjust: %d",
4005 server->sec_mode, server->capabilities, server->timeAdj); 4005 server->sec_mode, server->capabilities, server->timeAdj);
4006 4006
4007 rc = CIFS_SessSetup(xid, ses, nls_info); 4007 if (server->ops->sess_setup)
4008 rc = server->ops->sess_setup(xid, ses, nls_info);
4009
4008 if (rc) { 4010 if (rc) {
4009 cERROR(1, "Send error in SessSetup = %d", rc); 4011 cERROR(1, "Send error in SessSetup = %d", rc);
4010 } else { 4012 } else {
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index 3ba3f3cd2397..08efc3c8efef 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -556,7 +556,7 @@ setup_ntlmv2_ret:
556} 556}
557 557
558int 558int
559CIFS_SessSetup(unsigned int xid, struct cifs_ses *ses, 559CIFS_SessSetup(const unsigned int xid, struct cifs_ses *ses,
560 const struct nls_table *nls_cp) 560 const struct nls_table *nls_cp)
561{ 561{
562 int rc = 0; 562 int rc = 0;
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
index ea4fb8aaaafb..6b0a5d616338 100644
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
@@ -430,6 +430,8 @@ struct smb_version_operations smb1_operations = {
430 .check_trans2 = cifs_check_trans2, 430 .check_trans2 = cifs_check_trans2,
431 .need_neg = cifs_need_neg, 431 .need_neg = cifs_need_neg,
432 .negotiate = cifs_negotiate, 432 .negotiate = cifs_negotiate,
433 .sess_setup = CIFS_SessSetup,
434 .logoff = CIFSSMBLogoff,
433}; 435};
434 436
435struct smb_version_values smb1_values = { 437struct smb_version_values smb1_values = {