Commit 2dabfd5b authored by Long Li's avatar Long Li Committed by Steve French

CIFS: SMBD: Add parameter rdata to smb2_new_read_req

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

When we assemble the SMB read packet header, we need to know the I/O layout
if this request is to use a RDMA write. rdata has all the information we need
for memory registration. Add rdata to smb2_new_read_req.
Signed-off-by: default avatarLong Li <longli@microsoft.com>
Reviewed-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: default avatarSteve French <smfrench@gmail.com>
Acked-by: Ronnie Sahlberg <lsahlber.redhat.com>
parent 3cecf486
...@@ -2429,18 +2429,21 @@ SMB2_flush(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, ...@@ -2429,18 +2429,21 @@ SMB2_flush(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
*/ */
static int static int
smb2_new_read_req(void **buf, unsigned int *total_len, smb2_new_read_req(void **buf, unsigned int *total_len,
struct cifs_io_parms *io_parms, unsigned int remaining_bytes, struct cifs_io_parms *io_parms, struct cifs_readdata *rdata,
int request_type) unsigned int remaining_bytes, int request_type)
{ {
int rc = -EACCES; int rc = -EACCES;
struct smb2_read_plain_req *req = NULL; struct smb2_read_plain_req *req = NULL;
struct smb2_sync_hdr *shdr; struct smb2_sync_hdr *shdr;
struct TCP_Server_Info *server;
rc = smb2_plain_req_init(SMB2_READ, io_parms->tcon, (void **) &req, rc = smb2_plain_req_init(SMB2_READ, io_parms->tcon, (void **) &req,
total_len); total_len);
if (rc) if (rc)
return rc; return rc;
if (io_parms->tcon->ses->server == NULL)
server = io_parms->tcon->ses->server;
if (server == NULL)
return -ECONNABORTED; return -ECONNABORTED;
shdr = &req->sync_hdr; shdr = &req->sync_hdr;
...@@ -2568,7 +2571,8 @@ smb2_async_readv(struct cifs_readdata *rdata) ...@@ -2568,7 +2571,8 @@ smb2_async_readv(struct cifs_readdata *rdata)
server = io_parms.tcon->ses->server; server = io_parms.tcon->ses->server;
rc = smb2_new_read_req((void **) &buf, &total_len, &io_parms, 0, 0); rc = smb2_new_read_req(
(void **) &buf, &total_len, &io_parms, rdata, 0, 0);
if (rc) { if (rc) {
if (rc == -EAGAIN && rdata->credits) { if (rc == -EAGAIN && rdata->credits) {
/* credits was reset by reconnect */ /* credits was reset by reconnect */
...@@ -2633,7 +2637,7 @@ SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms, ...@@ -2633,7 +2637,7 @@ SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms,
struct cifs_ses *ses = io_parms->tcon->ses; struct cifs_ses *ses = io_parms->tcon->ses;
*nbytes = 0; *nbytes = 0;
rc = smb2_new_read_req((void **)&req, &total_len, io_parms, 0, 0); rc = smb2_new_read_req((void **)&req, &total_len, io_parms, NULL, 0, 0);
if (rc) if (rc)
return rc; return rc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment