diff options
author | Pavel Shilovsky <pshilovsky@samba.org> | 2012-05-25 02:43:58 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-07-24 01:33:26 -0400 |
commit | 286170aa241819f39d9d1d5d9f2434cfb8519506 (patch) | |
tree | f7f4a8fd6eb653ac0f40cab9e8468462316fe41e /fs/cifs/smb1ops.c | |
parent | a891f0f895f4a760fdb99636fab05e60597b8224 (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.c | 23 |
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 | ||
392 | static bool | ||
393 | cifs_need_neg(struct TCP_Server_Info *server) | ||
394 | { | ||
395 | return server->maxBuf == 0; | ||
396 | } | ||
397 | |||
398 | static int | ||
399 | cifs_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 | |||
392 | struct smb_version_operations smb1_operations = { | 413 | struct 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 | ||
412 | struct smb_version_values smb1_values = { | 435 | struct smb_version_values smb1_values = { |