CIFS: SMBD: Read correct returned data length for RDMA write (SMB read) I/O

This patch is for preparing upper layer doing SMB read via RDMA write.

When RDMA write is used for SMB read, the returned data length is in
DataRemaining in the response packet. Reading it properly by adding a
parameter to specifiy where the returned data length is.

Add the defition for memory registration to wdata and return the correct
length based on if RDMA write is used.

Signed-off-by: Long Li <longli@microsoft.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
这个提交包含在:
Long Li
2017-11-22 17:38:46 -07:00
提交者 Steve French
父节点 db223a590d
当前提交 74dcf418fe
修改 4 个文件,包含 30 行新增7 行删除

查看文件

@@ -87,9 +87,11 @@ cifs_read_data_offset(char *buf)
}
static unsigned int
cifs_read_data_length(char *buf)
cifs_read_data_length(char *buf, bool in_remaining)
{
READ_RSP *rsp = (READ_RSP *)buf;
/* It's a bug reading remaining data for SMB1 packets */
WARN_ON(in_remaining);
return (le16_to_cpu(rsp->DataLengthHigh) << 16) +
le16_to_cpu(rsp->DataLength);
}