diff options
author | Jeff Layton <jlayton@redhat.com> | 2012-09-19 09:22:34 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-09-24 22:46:32 -0400 |
commit | 5819575ec6b82345e1a21a960d381c699a91c700 (patch) | |
tree | 9ffe9d41ddbc8009c7ecbf132533d5d1315f0f13 /fs/cifs/cifssmb.c | |
parent | 8321fec436050b586cee448f2da0a6999e5172dd (diff) |
cifs: replace kvec array in readdata with a single kvec
The array is no longer needed. We just need a single kvec to hold the
header for signature checking.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r-- | fs/cifs/cifssmb.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 5d7bd757dcf1..88bbb3ef95b3 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
@@ -1436,10 +1436,10 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid) | |||
1436 | len = min_t(unsigned int, buflen, server->vals->read_rsp_size) - | 1436 | len = min_t(unsigned int, buflen, server->vals->read_rsp_size) - |
1437 | HEADER_SIZE(server) + 1; | 1437 | HEADER_SIZE(server) + 1; |
1438 | 1438 | ||
1439 | rdata->iov[0].iov_base = buf + HEADER_SIZE(server) - 1; | 1439 | rdata->iov.iov_base = buf + HEADER_SIZE(server) - 1; |
1440 | rdata->iov[0].iov_len = len; | 1440 | rdata->iov.iov_len = len; |
1441 | 1441 | ||
1442 | length = cifs_readv_from_socket(server, rdata->iov, 1, len); | 1442 | length = cifs_readv_from_socket(server, &rdata->iov, 1, len); |
1443 | if (length < 0) | 1443 | if (length < 0) |
1444 | return length; | 1444 | return length; |
1445 | server->total_read += length; | 1445 | server->total_read += length; |
@@ -1485,20 +1485,19 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid) | |||
1485 | len = data_offset - server->total_read; | 1485 | len = data_offset - server->total_read; |
1486 | if (len > 0) { | 1486 | if (len > 0) { |
1487 | /* read any junk before data into the rest of smallbuf */ | 1487 | /* read any junk before data into the rest of smallbuf */ |
1488 | rdata->iov[0].iov_base = buf + server->total_read; | 1488 | rdata->iov.iov_base = buf + server->total_read; |
1489 | rdata->iov[0].iov_len = len; | 1489 | rdata->iov.iov_len = len; |
1490 | length = cifs_readv_from_socket(server, rdata->iov, 1, len); | 1490 | length = cifs_readv_from_socket(server, &rdata->iov, 1, len); |
1491 | if (length < 0) | 1491 | if (length < 0) |
1492 | return length; | 1492 | return length; |
1493 | server->total_read += length; | 1493 | server->total_read += length; |
1494 | } | 1494 | } |
1495 | 1495 | ||
1496 | /* set up first iov for signature check */ | 1496 | /* set up first iov for signature check */ |
1497 | rdata->iov[0].iov_base = buf; | 1497 | rdata->iov.iov_base = buf; |
1498 | rdata->iov[0].iov_len = server->total_read; | 1498 | rdata->iov.iov_len = server->total_read; |
1499 | rdata->nr_iov = 1; | ||
1500 | cFYI(1, "0: iov_base=%p iov_len=%zu", | 1499 | cFYI(1, "0: iov_base=%p iov_len=%zu", |
1501 | rdata->iov[0].iov_base, rdata->iov[0].iov_len); | 1500 | rdata->iov.iov_base, rdata->iov.iov_len); |
1502 | 1501 | ||
1503 | /* how much data is in the response? */ | 1502 | /* how much data is in the response? */ |
1504 | data_len = server->ops->read_data_length(buf); | 1503 | data_len = server->ops->read_data_length(buf); |
@@ -1532,8 +1531,8 @@ cifs_readv_callback(struct mid_q_entry *mid) | |||
1532 | struct cifs_readdata *rdata = mid->callback_data; | 1531 | struct cifs_readdata *rdata = mid->callback_data; |
1533 | struct cifs_tcon *tcon = tlink_tcon(rdata->cfile->tlink); | 1532 | struct cifs_tcon *tcon = tlink_tcon(rdata->cfile->tlink); |
1534 | struct TCP_Server_Info *server = tcon->ses->server; | 1533 | struct TCP_Server_Info *server = tcon->ses->server; |
1535 | struct smb_rqst rqst = { .rq_iov = rdata->iov, | 1534 | struct smb_rqst rqst = { .rq_iov = &rdata->iov, |
1536 | .rq_nvec = rdata->nr_iov, | 1535 | .rq_nvec = 1, |
1537 | .rq_pages = rdata->pages, | 1536 | .rq_pages = rdata->pages, |
1538 | .rq_npages = rdata->nr_pages, | 1537 | .rq_npages = rdata->nr_pages, |
1539 | .rq_pagesz = rdata->pagesz, | 1538 | .rq_pagesz = rdata->pagesz, |
@@ -1580,7 +1579,7 @@ cifs_async_readv(struct cifs_readdata *rdata) | |||
1580 | READ_REQ *smb = NULL; | 1579 | READ_REQ *smb = NULL; |
1581 | int wct; | 1580 | int wct; |
1582 | struct cifs_tcon *tcon = tlink_tcon(rdata->cfile->tlink); | 1581 | struct cifs_tcon *tcon = tlink_tcon(rdata->cfile->tlink); |
1583 | struct smb_rqst rqst = { .rq_iov = rdata->iov, | 1582 | struct smb_rqst rqst = { .rq_iov = &rdata->iov, |
1584 | .rq_nvec = 1 }; | 1583 | .rq_nvec = 1 }; |
1585 | 1584 | ||
1586 | cFYI(1, "%s: offset=%llu bytes=%u", __func__, | 1585 | cFYI(1, "%s: offset=%llu bytes=%u", __func__, |
@@ -1621,8 +1620,8 @@ cifs_async_readv(struct cifs_readdata *rdata) | |||
1621 | } | 1620 | } |
1622 | 1621 | ||
1623 | /* 4 for RFC1001 length + 1 for BCC */ | 1622 | /* 4 for RFC1001 length + 1 for BCC */ |
1624 | rdata->iov[0].iov_base = smb; | 1623 | rdata->iov.iov_base = smb; |
1625 | rdata->iov[0].iov_len = be32_to_cpu(smb->hdr.smb_buf_length) + 4; | 1624 | rdata->iov.iov_len = be32_to_cpu(smb->hdr.smb_buf_length) + 4; |
1626 | 1625 | ||
1627 | kref_get(&rdata->refcount); | 1626 | kref_get(&rdata->refcount); |
1628 | rc = cifs_call_async(tcon->ses->server, &rqst, cifs_readv_receive, | 1627 | rc = cifs_call_async(tcon->ses->server, &rqst, cifs_readv_receive, |