diff options
author | Pavel Shilovsky <piastry@etersoft.ru> | 2012-03-23 14:28:02 -0400 |
---|---|---|
committer | Jeff Layton <jlayton@redhat.com> | 2012-03-23 14:28:02 -0400 |
commit | 792af7b05b8a78def080ec757a4d4420b9fd0cc2 (patch) | |
tree | 6f6d556f155194295375f3d4ad6cbfabbd7aeeeb /fs/cifs/cifssmb.c | |
parent | 934e18b5cb4531cc6e81865bf54115cfd21d1ac6 (diff) |
CIFS: Separate protocol-specific code from transport routines
that lets us use this functions for SMB2.
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r-- | fs/cifs/cifssmb.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 70aac35c398f..a7ed01cd0242 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
@@ -696,7 +696,7 @@ CIFSSMBTDis(const int xid, struct cifs_tcon *tcon) | |||
696 | if (rc) | 696 | if (rc) |
697 | return rc; | 697 | return rc; |
698 | 698 | ||
699 | rc = SendReceiveNoRsp(xid, tcon->ses, smb_buffer, 0); | 699 | rc = SendReceiveNoRsp(xid, tcon->ses, (char *)smb_buffer, 0); |
700 | if (rc) | 700 | if (rc) |
701 | cFYI(1, "Tree disconnect failed %d", rc); | 701 | cFYI(1, "Tree disconnect failed %d", rc); |
702 | 702 | ||
@@ -792,7 +792,7 @@ CIFSSMBLogoff(const int xid, struct cifs_ses *ses) | |||
792 | pSMB->hdr.Uid = ses->Suid; | 792 | pSMB->hdr.Uid = ses->Suid; |
793 | 793 | ||
794 | pSMB->AndXCommand = 0xFF; | 794 | pSMB->AndXCommand = 0xFF; |
795 | rc = SendReceiveNoRsp(xid, ses, (struct smb_hdr *) pSMB, 0); | 795 | rc = SendReceiveNoRsp(xid, ses, (char *) pSMB, 0); |
796 | session_already_dead: | 796 | session_already_dead: |
797 | mutex_unlock(&ses->session_mutex); | 797 | mutex_unlock(&ses->session_mutex); |
798 | 798 | ||
@@ -2420,8 +2420,7 @@ CIFSSMBLock(const int xid, struct cifs_tcon *tcon, | |||
2420 | (struct smb_hdr *) pSMB, &bytes_returned); | 2420 | (struct smb_hdr *) pSMB, &bytes_returned); |
2421 | cifs_small_buf_release(pSMB); | 2421 | cifs_small_buf_release(pSMB); |
2422 | } else { | 2422 | } else { |
2423 | rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *)pSMB, | 2423 | rc = SendReceiveNoRsp(xid, tcon->ses, (char *)pSMB, timeout); |
2424 | timeout); | ||
2425 | /* SMB buffer freed by function above */ | 2424 | /* SMB buffer freed by function above */ |
2426 | } | 2425 | } |
2427 | cifs_stats_inc(&tcon->num_locks); | 2426 | cifs_stats_inc(&tcon->num_locks); |
@@ -2588,7 +2587,7 @@ CIFSSMBClose(const int xid, struct cifs_tcon *tcon, int smb_file_id) | |||
2588 | pSMB->FileID = (__u16) smb_file_id; | 2587 | pSMB->FileID = (__u16) smb_file_id; |
2589 | pSMB->LastWriteTime = 0xFFFFFFFF; | 2588 | pSMB->LastWriteTime = 0xFFFFFFFF; |
2590 | pSMB->ByteCount = 0; | 2589 | pSMB->ByteCount = 0; |
2591 | rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); | 2590 | rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); |
2592 | cifs_stats_inc(&tcon->num_closes); | 2591 | cifs_stats_inc(&tcon->num_closes); |
2593 | if (rc) { | 2592 | if (rc) { |
2594 | if (rc != -EINTR) { | 2593 | if (rc != -EINTR) { |
@@ -2617,7 +2616,7 @@ CIFSSMBFlush(const int xid, struct cifs_tcon *tcon, int smb_file_id) | |||
2617 | 2616 | ||
2618 | pSMB->FileID = (__u16) smb_file_id; | 2617 | pSMB->FileID = (__u16) smb_file_id; |
2619 | pSMB->ByteCount = 0; | 2618 | pSMB->ByteCount = 0; |
2620 | rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); | 2619 | rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); |
2621 | cifs_stats_inc(&tcon->num_flushes); | 2620 | cifs_stats_inc(&tcon->num_flushes); |
2622 | if (rc) | 2621 | if (rc) |
2623 | cERROR(1, "Send error in Flush = %d", rc); | 2622 | cERROR(1, "Send error in Flush = %d", rc); |
@@ -4625,7 +4624,7 @@ CIFSFindClose(const int xid, struct cifs_tcon *tcon, | |||
4625 | 4624 | ||
4626 | pSMB->FileID = searchHandle; | 4625 | pSMB->FileID = searchHandle; |
4627 | pSMB->ByteCount = 0; | 4626 | pSMB->ByteCount = 0; |
4628 | rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); | 4627 | rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); |
4629 | if (rc) | 4628 | if (rc) |
4630 | cERROR(1, "Send error in FindClose = %d", rc); | 4629 | cERROR(1, "Send error in FindClose = %d", rc); |
4631 | 4630 | ||
@@ -5646,7 +5645,7 @@ CIFSSMBSetFileSize(const int xid, struct cifs_tcon *tcon, __u64 size, | |||
5646 | pSMB->Reserved4 = 0; | 5645 | pSMB->Reserved4 = 0; |
5647 | inc_rfc1001_len(pSMB, byte_count); | 5646 | inc_rfc1001_len(pSMB, byte_count); |
5648 | pSMB->ByteCount = cpu_to_le16(byte_count); | 5647 | pSMB->ByteCount = cpu_to_le16(byte_count); |
5649 | rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); | 5648 | rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); |
5650 | if (rc) { | 5649 | if (rc) { |
5651 | cFYI(1, "Send error in SetFileInfo (SetFileSize) = %d", rc); | 5650 | cFYI(1, "Send error in SetFileInfo (SetFileSize) = %d", rc); |
5652 | } | 5651 | } |
@@ -5715,7 +5714,7 @@ CIFSSMBSetFileInfo(const int xid, struct cifs_tcon *tcon, | |||
5715 | inc_rfc1001_len(pSMB, byte_count); | 5714 | inc_rfc1001_len(pSMB, byte_count); |
5716 | pSMB->ByteCount = cpu_to_le16(byte_count); | 5715 | pSMB->ByteCount = cpu_to_le16(byte_count); |
5717 | memcpy(data_offset, data, sizeof(FILE_BASIC_INFO)); | 5716 | memcpy(data_offset, data, sizeof(FILE_BASIC_INFO)); |
5718 | rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); | 5717 | rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); |
5719 | if (rc) | 5718 | if (rc) |
5720 | cFYI(1, "Send error in Set Time (SetFileInfo) = %d", rc); | 5719 | cFYI(1, "Send error in Set Time (SetFileInfo) = %d", rc); |
5721 | 5720 | ||
@@ -5774,7 +5773,7 @@ CIFSSMBSetFileDisposition(const int xid, struct cifs_tcon *tcon, | |||
5774 | inc_rfc1001_len(pSMB, byte_count); | 5773 | inc_rfc1001_len(pSMB, byte_count); |
5775 | pSMB->ByteCount = cpu_to_le16(byte_count); | 5774 | pSMB->ByteCount = cpu_to_le16(byte_count); |
5776 | *data_offset = delete_file ? 1 : 0; | 5775 | *data_offset = delete_file ? 1 : 0; |
5777 | rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); | 5776 | rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); |
5778 | if (rc) | 5777 | if (rc) |
5779 | cFYI(1, "Send error in SetFileDisposition = %d", rc); | 5778 | cFYI(1, "Send error in SetFileDisposition = %d", rc); |
5780 | 5779 | ||
@@ -6006,7 +6005,7 @@ CIFSSMBUnixSetFileInfo(const int xid, struct cifs_tcon *tcon, | |||
6006 | 6005 | ||
6007 | cifs_fill_unix_set_info(data_offset, args); | 6006 | cifs_fill_unix_set_info(data_offset, args); |
6008 | 6007 | ||
6009 | rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); | 6008 | rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); |
6010 | if (rc) | 6009 | if (rc) |
6011 | cFYI(1, "Send error in Set Time (SetFileInfo) = %d", rc); | 6010 | cFYI(1, "Send error in Set Time (SetFileInfo) = %d", rc); |
6012 | 6011 | ||