Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263881
b: refs/heads/master
c: 40b0549
h: refs/heads/master
i:
  263879: ffab23c
v: v3
  • Loading branch information
Nicholas Bellinger committed Sep 16, 2011
1 parent a885fff commit 47170d1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2ff017f5b4299e24a7f22d9a336dd162bf52bb54
refs/heads/master: 40b054970afcf067896d62cd6f7e617c62665304
22 changes: 15 additions & 7 deletions trunk/drivers/target/iscsi/iscsi_target_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@ int iscsit_fe_sendpage_sg(
struct kvec iov;
u32 tx_hdr_size, data_len;
u32 offset = cmd->first_data_sg_off;
int tx_sent;
int tx_sent, iov_off;

send_hdr:
tx_hdr_size = ISCSI_HDR_LEN;
Expand All @@ -1276,9 +1276,19 @@ int iscsit_fe_sendpage_sg(
}

data_len = cmd->tx_size - tx_hdr_size - cmd->padding;
if (conn->conn_ops->DataDigest)
/*
* Set iov_off used by padding and data digest tx_data() calls below
* in order to determine proper offset into cmd->iov_data[]
*/
if (conn->conn_ops->DataDigest) {
data_len -= ISCSI_CRC_LEN;

if (cmd->padding)
iov_off = (cmd->iov_data_count - 2);
else
iov_off = (cmd->iov_data_count - 1);
} else {
iov_off = (cmd->iov_data_count - 1);
}
/*
* Perform sendpage() for each page in the scatterlist
*/
Expand Down Expand Up @@ -1307,8 +1317,7 @@ int iscsit_fe_sendpage_sg(

send_padding:
if (cmd->padding) {
struct kvec *iov_p =
&cmd->iov_data[cmd->iov_data_count-1];
struct kvec *iov_p = &cmd->iov_data[iov_off++];

tx_sent = tx_data(conn, iov_p, 1, cmd->padding);
if (cmd->padding != tx_sent) {
Expand All @@ -1322,8 +1331,7 @@ int iscsit_fe_sendpage_sg(

send_datacrc:
if (conn->conn_ops->DataDigest) {
struct kvec *iov_d =
&cmd->iov_data[cmd->iov_data_count];
struct kvec *iov_d = &cmd->iov_data[iov_off];

tx_sent = tx_data(conn, iov_d, 1, ISCSI_CRC_LEN);
if (ISCSI_CRC_LEN != tx_sent) {
Expand Down

0 comments on commit 47170d1

Please sign in to comment.