aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb1ops.c
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@samba.org>2012-05-25 02:43:58 -0400
committerSteve French <smfrench@gmail.com>2012-07-24 01:33:26 -0400
commit286170aa241819f39d9d1d5d9f2434cfb8519506 (patch)
treef7f4a8fd6eb653ac0f40cab9e8468462316fe41e /fs/cifs/smb1ops.c
parenta891f0f895f4a760fdb99636fab05e60597b8224 (diff)
CIFS: Move protocol specific negotiate code to ops struct
Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb1ops.c')
-rw-r--r--fs/cifs/smb1ops.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
index f4f839459e90..ea4fb8aaaafb 100644
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
@@ -389,6 +389,27 @@ cifs_check_trans2(struct mid_q_entry *mid, struct TCP_Server_Info *server,
389 return true; 389 return true;
390} 390}
391 391
392static bool
393cifs_need_neg(struct TCP_Server_Info *server)
394{
395 return server->maxBuf == 0;
396}
397
398static int
399cifs_negotiate(const unsigned int xid, struct cifs_ses *ses)
400{
401 int rc;
402 rc = CIFSSMBNegotiate(xid, ses);
403 if (rc == -EAGAIN) {
404 /* retry only once on 1st time connection */
405 set_credits(ses->server, 1);
406 rc = CIFSSMBNegotiate(xid, ses);
407 if (rc == -EAGAIN)
408 rc = -EHOSTDOWN;
409 }
410 return rc;
411}
412
392struct smb_version_operations smb1_operations = { 413struct smb_version_operations smb1_operations = {
393 .send_cancel = send_nt_cancel, 414 .send_cancel = send_nt_cancel,
394 .compare_fids = cifs_compare_fids, 415 .compare_fids = cifs_compare_fids,
@@ -407,6 +428,8 @@ struct smb_version_operations smb1_operations = {
407 .dump_detail = cifs_dump_detail, 428 .dump_detail = cifs_dump_detail,
408 .is_oplock_break = is_valid_oplock_break, 429 .is_oplock_break = is_valid_oplock_break,
409 .check_trans2 = cifs_check_trans2, 430 .check_trans2 = cifs_check_trans2,
431 .need_neg = cifs_need_neg,
432 .negotiate = cifs_negotiate,
410}; 433};
411 434
412struct smb_version_values smb1_values = { 435struct smb_version_values smb1_values = {