summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/cifs/smb2pdu.c22
-rw-r--r--fs/cifs/smb2pdu.h14
-rw-r--r--fs/cifs/smbdirect.c5
3 files changed, 21 insertions, 20 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 17b7f3aed195..63778ac22fd9 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -2463,13 +2463,13 @@ smb2_new_read_req(void **buf, unsigned int *total_len,
2463 if (need_invalidate) 2463 if (need_invalidate)
2464 req->Channel = SMB2_CHANNEL_RDMA_V1; 2464 req->Channel = SMB2_CHANNEL_RDMA_V1;
2465 req->ReadChannelInfoOffset = 2465 req->ReadChannelInfoOffset =
2466 offsetof(struct smb2_read_plain_req, Buffer); 2466 cpu_to_le16(offsetof(struct smb2_read_plain_req, Buffer));
2467 req->ReadChannelInfoLength = 2467 req->ReadChannelInfoLength =
2468 sizeof(struct smbd_buffer_descriptor_v1); 2468 cpu_to_le16(sizeof(struct smbd_buffer_descriptor_v1));
2469 v1 = (struct smbd_buffer_descriptor_v1 *) &req->Buffer[0]; 2469 v1 = (struct smbd_buffer_descriptor_v1 *) &req->Buffer[0];
2470 v1->offset = rdata->mr->mr->iova; 2470 v1->offset = cpu_to_le64(rdata->mr->mr->iova);
2471 v1->token = rdata->mr->mr->rkey; 2471 v1->token = cpu_to_le32(rdata->mr->mr->rkey);
2472 v1->length = rdata->mr->mr->length; 2472 v1->length = cpu_to_le32(rdata->mr->mr->length);
2473 2473
2474 *total_len += sizeof(*v1) - 1; 2474 *total_len += sizeof(*v1) - 1;
2475 } 2475 }
@@ -2840,18 +2840,18 @@ smb2_async_writev(struct cifs_writedata *wdata,
2840 req->Length = 0; 2840 req->Length = 0;
2841 req->DataOffset = 0; 2841 req->DataOffset = 0;
2842 req->RemainingBytes = 2842 req->RemainingBytes =
2843 (wdata->nr_pages-1)*PAGE_SIZE + wdata->tailsz; 2843 cpu_to_le32((wdata->nr_pages-1)*PAGE_SIZE + wdata->tailsz);
2844 req->Channel = SMB2_CHANNEL_RDMA_V1_INVALIDATE; 2844 req->Channel = SMB2_CHANNEL_RDMA_V1_INVALIDATE;
2845 if (need_invalidate) 2845 if (need_invalidate)
2846 req->Channel = SMB2_CHANNEL_RDMA_V1; 2846 req->Channel = SMB2_CHANNEL_RDMA_V1;
2847 req->WriteChannelInfoOffset = 2847 req->WriteChannelInfoOffset =
2848 offsetof(struct smb2_write_req, Buffer); 2848 cpu_to_le16(offsetof(struct smb2_write_req, Buffer));
2849 req->WriteChannelInfoLength = 2849 req->WriteChannelInfoLength =
2850 sizeof(struct smbd_buffer_descriptor_v1); 2850 cpu_to_le16(sizeof(struct smbd_buffer_descriptor_v1));
2851 v1 = (struct smbd_buffer_descriptor_v1 *) &req->Buffer[0]; 2851 v1 = (struct smbd_buffer_descriptor_v1 *) &req->Buffer[0];
2852 v1->offset = wdata->mr->mr->iova; 2852 v1->offset = cpu_to_le64(wdata->mr->mr->iova);
2853 v1->token = wdata->mr->mr->rkey; 2853 v1->token = cpu_to_le32(wdata->mr->mr->rkey);
2854 v1->length = wdata->mr->mr->length; 2854 v1->length = cpu_to_le32(wdata->mr->mr->length);
2855 } 2855 }
2856#endif 2856#endif
2857 /* 4 for rfc1002 length field and 1 for Buffer */ 2857 /* 4 for rfc1002 length field and 1 for Buffer */
diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h
index 19d34881815f..6eb9f9691ed4 100644
--- a/fs/cifs/smb2pdu.h
+++ b/fs/cifs/smb2pdu.h
@@ -830,9 +830,9 @@ struct smb2_flush_rsp {
830#define SMB2_READFLAG_READ_UNBUFFERED 0x01 830#define SMB2_READFLAG_READ_UNBUFFERED 0x01
831 831
832/* Channel field for read and write: exactly one of following flags can be set*/ 832/* Channel field for read and write: exactly one of following flags can be set*/
833#define SMB2_CHANNEL_NONE 0x00000000 833#define SMB2_CHANNEL_NONE cpu_to_le32(0x00000000)
834#define SMB2_CHANNEL_RDMA_V1 0x00000001 /* SMB3 or later */ 834#define SMB2_CHANNEL_RDMA_V1 cpu_to_le32(0x00000001) /* SMB3 or later */
835#define SMB2_CHANNEL_RDMA_V1_INVALIDATE 0x00000002 /* SMB3.02 or later */ 835#define SMB2_CHANNEL_RDMA_V1_INVALIDATE cpu_to_le32(0x00000002) /* >= SMB3.02 */
836 836
837/* SMB2 read request without RFC1001 length at the beginning */ 837/* SMB2 read request without RFC1001 length at the beginning */
838struct smb2_read_plain_req { 838struct smb2_read_plain_req {
@@ -847,8 +847,8 @@ struct smb2_read_plain_req {
847 __le32 MinimumCount; 847 __le32 MinimumCount;
848 __le32 Channel; /* MBZ except for SMB3 or later */ 848 __le32 Channel; /* MBZ except for SMB3 or later */
849 __le32 RemainingBytes; 849 __le32 RemainingBytes;
850 __le16 ReadChannelInfoOffset; /* Reserved MBZ */ 850 __le16 ReadChannelInfoOffset;
851 __le16 ReadChannelInfoLength; /* Reserved MBZ */ 851 __le16 ReadChannelInfoLength;
852 __u8 Buffer[1]; 852 __u8 Buffer[1];
853} __packed; 853} __packed;
854 854
@@ -877,8 +877,8 @@ struct smb2_write_req {
877 __u64 VolatileFileId; /* opaque endianness */ 877 __u64 VolatileFileId; /* opaque endianness */
878 __le32 Channel; /* Reserved MBZ */ 878 __le32 Channel; /* Reserved MBZ */
879 __le32 RemainingBytes; 879 __le32 RemainingBytes;
880 __le16 WriteChannelInfoOffset; /* Reserved MBZ */ 880 __le16 WriteChannelInfoOffset;
881 __le16 WriteChannelInfoLength; /* Reserved MBZ */ 881 __le16 WriteChannelInfoLength;
882 __le32 Flags; 882 __le32 Flags;
883 __u8 Buffer[1]; 883 __u8 Buffer[1];
884} __packed; 884} __packed;
diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c
index f9234ed83a60..5130492847eb 100644
--- a/fs/cifs/smbdirect.c
+++ b/fs/cifs/smbdirect.c
@@ -1855,7 +1855,8 @@ try_again:
1855 * consumed. But this will require more changes to upper layer code, and also 1855 * consumed. But this will require more changes to upper layer code, and also
1856 * need to consider packet boundaries while they still being reassembled. 1856 * need to consider packet boundaries while they still being reassembled.
1857 */ 1857 */
1858int smbd_recv_buf(struct smbd_connection *info, char *buf, unsigned int size) 1858static int smbd_recv_buf(struct smbd_connection *info, char *buf,
1859 unsigned int size)
1859{ 1860{
1860 struct smbd_response *response; 1861 struct smbd_response *response;
1861 struct smbd_data_transfer *data_transfer; 1862 struct smbd_data_transfer *data_transfer;
@@ -1992,7 +1993,7 @@ read_rfc1002_done:
1992 * to_read: the length of data to read 1993 * to_read: the length of data to read
1993 * return value: actual data read 1994 * return value: actual data read
1994 */ 1995 */
1995int smbd_recv_page(struct smbd_connection *info, 1996static int smbd_recv_page(struct smbd_connection *info,
1996 struct page *page, unsigned int to_read) 1997 struct page *page, unsigned int to_read)
1997{ 1998{
1998 int ret; 1999 int ret;