aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2pdu.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-09-18 19:20:35 -0400
committerSteve French <smfrench@gmail.com>2012-09-24 22:46:31 -0400
commitfec344e3f31aa911297cd3a4639432d983b1f324 (patch)
treec46deb8e54d4a1f00be47f7d34e572730b0df988 /fs/cifs/smb2pdu.c
parentfb308a6f22f7f4f3574dab6b36c4a3598e50cf05 (diff)
cifs: change cifs_call_async to use smb_rqst structs
For now, none of the callers populate rq_pages. That will be done for writes in a later patch. While we're at it, change the prototype of setup_async_request not to need a return pointer argument. Just return the pointer to the mid_q_entry or an ERR_PTR. Reviewed-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb2pdu.c')
-rw-r--r--fs/cifs/smb2pdu.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index e188d137cab2..a04301b69b4e 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -1171,6 +1171,8 @@ SMB2_echo(struct TCP_Server_Info *server)
1171 struct smb2_echo_req *req; 1171 struct smb2_echo_req *req;
1172 int rc = 0; 1172 int rc = 0;
1173 struct kvec iov; 1173 struct kvec iov;
1174 struct smb_rqst rqst = { .rq_iov = &iov,
1175 .rq_nvec = 1 };
1174 1176
1175 cFYI(1, "In echo request"); 1177 cFYI(1, "In echo request");
1176 1178
@@ -1184,7 +1186,7 @@ SMB2_echo(struct TCP_Server_Info *server)
1184 /* 4 for rfc1002 length field */ 1186 /* 4 for rfc1002 length field */
1185 iov.iov_len = get_rfc1002_length(req) + 4; 1187 iov.iov_len = get_rfc1002_length(req) + 4;
1186 1188
1187 rc = cifs_call_async(server, &iov, 1, NULL, smb2_echo_callback, server, 1189 rc = cifs_call_async(server, &rqst, NULL, smb2_echo_callback, server,
1188 CIFS_ECHO_OP); 1190 CIFS_ECHO_OP);
1189 if (rc) 1191 if (rc)
1190 cFYI(1, "Echo request failed: %d", rc); 1192 cFYI(1, "Echo request failed: %d", rc);
@@ -1344,6 +1346,8 @@ smb2_async_readv(struct cifs_readdata *rdata)
1344 int rc; 1346 int rc;
1345 struct smb2_hdr *buf; 1347 struct smb2_hdr *buf;
1346 struct cifs_io_parms io_parms; 1348 struct cifs_io_parms io_parms;
1349 struct smb_rqst rqst = { .rq_iov = rdata->iov,
1350 .rq_nvec = 1 };
1347 1351
1348 cFYI(1, "%s: offset=%llu bytes=%u", __func__, 1352 cFYI(1, "%s: offset=%llu bytes=%u", __func__,
1349 rdata->offset, rdata->bytes); 1353 rdata->offset, rdata->bytes);
@@ -1363,7 +1367,7 @@ smb2_async_readv(struct cifs_readdata *rdata)
1363 rdata->iov[0].iov_len = get_rfc1002_length(rdata->iov[0].iov_base) + 4; 1367 rdata->iov[0].iov_len = get_rfc1002_length(rdata->iov[0].iov_base) + 4;
1364 1368
1365 kref_get(&rdata->refcount); 1369 kref_get(&rdata->refcount);
1366 rc = cifs_call_async(io_parms.tcon->ses->server, rdata->iov, 1, 1370 rc = cifs_call_async(io_parms.tcon->ses->server, &rqst,
1367 cifs_readv_receive, smb2_readv_callback, 1371 cifs_readv_receive, smb2_readv_callback,
1368 rdata, 0); 1372 rdata, 0);
1369 if (rc) 1373 if (rc)
@@ -1484,6 +1488,7 @@ smb2_async_writev(struct cifs_writedata *wdata)
1484 struct smb2_write_req *req = NULL; 1488 struct smb2_write_req *req = NULL;
1485 struct cifs_tcon *tcon = tlink_tcon(wdata->cfile->tlink); 1489 struct cifs_tcon *tcon = tlink_tcon(wdata->cfile->tlink);
1486 struct kvec *iov = NULL; 1490 struct kvec *iov = NULL;
1491 struct smb_rqst rqst;
1487 1492
1488 rc = small_smb2_init(SMB2_WRITE, tcon, (void **) &req); 1493 rc = small_smb2_init(SMB2_WRITE, tcon, (void **) &req);
1489 if (rc) 1494 if (rc)
@@ -1495,6 +1500,8 @@ smb2_async_writev(struct cifs_writedata *wdata)
1495 rc = -ENOMEM; 1500 rc = -ENOMEM;
1496 goto async_writev_out; 1501 goto async_writev_out;
1497 } 1502 }
1503 rqst.rq_iov = iov;
1504 rqst.rq_nvec = wdata->nr_pages + 1;
1498 1505
1499 req->hdr.ProcessId = cpu_to_le32(wdata->cfile->pid); 1506 req->hdr.ProcessId = cpu_to_le32(wdata->cfile->pid);
1500 1507
@@ -1530,8 +1537,8 @@ smb2_async_writev(struct cifs_writedata *wdata)
1530 inc_rfc1001_len(&req->hdr, wdata->bytes - 1 /* Buffer */); 1537 inc_rfc1001_len(&req->hdr, wdata->bytes - 1 /* Buffer */);
1531 1538
1532 kref_get(&wdata->refcount); 1539 kref_get(&wdata->refcount);
1533 rc = cifs_call_async(tcon->ses->server, iov, wdata->nr_pages + 1, 1540 rc = cifs_call_async(tcon->ses->server, &rqst, NULL,
1534 NULL, smb2_writev_callback, wdata, 0); 1541 smb2_writev_callback, wdata, 0);
1535 1542
1536 if (rc) 1543 if (rc)
1537 kref_put(&wdata->refcount, cifs_writedata_release); 1544 kref_put(&wdata->refcount, cifs_writedata_release);