On Fri, 2011-05-27 at 12:07 -0700, Andy Grover wrote: > I needed to add a pad_bytes field in cmd, so we might as well use it > everywhere we need pad bytes. > > Signed-off-by: Andy Grover <agrover@xxxxxxxxxx> > --- Committed as e947358c9630 Thanks, --nab > drivers/target/iscsi/iscsi_target.c | 24 +++++++++++------------- > 1 files changed, 11 insertions(+), 13 deletions(-) > > diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c > index 2fe6004..72a24b7 100644 > --- a/drivers/target/iscsi/iscsi_target.c > +++ b/drivers/target/iscsi/iscsi_target.c > @@ -1245,7 +1245,7 @@ static void iscsit_do_crypto_hash_buf( > static int iscsit_handle_data_out(struct iscsi_conn *conn, unsigned char *buf) > { > int iov_ret, ooo_cmdsn = 0, ret; > - u8 data_crc_failed = 0, *pad_bytes[4]; > + u8 data_crc_failed = 0; > u32 checksum, iov_count = 0, padding = 0, rx_got = 0; > u32 rx_size = 0, payload_length; > struct iscsi_cmd *cmd = NULL; > @@ -1428,7 +1428,7 @@ static int iscsit_handle_data_out(struct iscsi_conn *conn, unsigned char *buf) > > padding = ((-payload_length) & 3); > if (padding != 0) { > - iov[iov_count].iov_base = &pad_bytes; > + iov[iov_count].iov_base = cmd->pad_bytes; > iov[iov_count++].iov_len = padding; > rx_size += padding; > TRACE(TRACE_ISCSI, "Receiving %u padding bytes.\n", padding); > @@ -1452,7 +1452,7 @@ static int iscsit_handle_data_out(struct iscsi_conn *conn, unsigned char *buf) > > data_crc = iscsit_do_crypto_hash_sg(&conn->conn_rx_hash, cmd, > hdr->offset, payload_length, padding, > - (u8 *)&pad_bytes); > + cmd->pad_bytes); > > if (checksum != data_crc) { > printk(KERN_ERR "ITT: 0x%08x, Offset: %u, Length: %u," > @@ -1600,7 +1600,7 @@ static int iscsit_handle_nop_out( > if (conn->conn_ops->DataDigest) { > iscsit_do_crypto_hash_buf(&conn->conn_rx_hash, > ping_data, payload_length, > - padding, (u8 *)&cmd->pad_bytes, > + padding, cmd->pad_bytes, > (u8 *)&data_crc); > > if (checksum != data_crc) { > @@ -1887,7 +1887,7 @@ static int iscsit_handle_text_cmd( > char *text_ptr, *text_in; > int cmdsn_ret, niov = 0, rx_got, rx_size; > u32 checksum = 0, data_crc = 0, payload_length; > - u32 padding = 0, pad_bytes = 0, text_length = 0; > + u32 padding = 0, text_length = 0; > struct iscsi_cmd *cmd; > struct kvec iov[3]; > struct iscsi_text *hdr; > @@ -1926,7 +1926,7 @@ static int iscsit_handle_text_cmd( > > padding = ((-payload_length) & 3); > if (padding != 0) { > - iov[niov].iov_base = &pad_bytes; > + iov[niov].iov_base = cmd->pad_bytes; > iov[niov++].iov_len = padding; > rx_size += padding; > TRACE(TRACE_ISCSI, "Receiving %u additional bytes" > @@ -1947,7 +1947,7 @@ static int iscsit_handle_text_cmd( > if (conn->conn_ops->DataDigest) { > iscsit_do_crypto_hash_buf(&conn->conn_rx_hash, > text_in, text_length, > - padding, (u8 *)&pad_bytes, > + padding, cmd->pad_bytes, > (u8 *)&data_crc); > > if (checksum != data_crc) { > @@ -2312,7 +2312,7 @@ static int iscsit_handle_immediate_data( > u32 length) > { > int iov_ret, rx_got = 0, rx_size = 0; > - u32 checksum, iov_count = 0, padding = 0, pad_bytes = 0; > + u32 checksum, iov_count = 0, padding = 0; > struct iscsi_conn *conn = cmd->conn; > struct kvec *iov; > > @@ -2326,7 +2326,7 @@ static int iscsit_handle_immediate_data( > > padding = ((-length) & 3); > if (padding != 0) { > - iov[iov_count].iov_base = &pad_bytes; > + iov[iov_count].iov_base = cmd->pad_bytes; > iov[iov_count++].iov_len = padding; > rx_size += padding; > } > @@ -2351,7 +2351,7 @@ static int iscsit_handle_immediate_data( > > data_crc = iscsit_do_crypto_hash_sg(&conn->conn_rx_hash, cmd, > cmd->write_data_done, length, padding, > - (u8 *)&pad_bytes); > + cmd->pad_bytes); > > if (checksum != data_crc) { > printk(KERN_ERR "ImmediateData CRC32C DataDigest 0x%08x" > @@ -2485,7 +2485,6 @@ static int iscsit_send_data_in( > int *eodr) > { > int iov_ret = 0, set_statsn = 0; > - u8 *pad_bytes; > u32 iov_count = 0, tx_size = 0; > struct iscsi_datain datain; > struct iscsi_datain_req *dr; > @@ -2597,8 +2596,7 @@ static int iscsit_send_data_in( > > padding = ((-datain.length) & 3); > if (padding) { > - pad_bytes = cmd->pad_bytes; > - iov[iov_count].iov_base = pad_bytes; > + iov[iov_count].iov_base = cmd->pad_bytes; > iov[iov_count++].iov_len = cmd->padding; > tx_size += cmd->padding; > > -- > 1.7.1 > -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html