From: Nicholas Bellinger Date: Thu, 20 Jun 2013 06:16:49 +0000 (-0700) Subject: iser-target: Setup incoming ISCSI_OP_TEXT buffer X-Git-Tag: next-20130628~75^2~5 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3d811292090fac47495120273606203f9a7761dc;p=karo-tx-linux.git iser-target: Setup incoming ISCSI_OP_TEXT buffer This patch copies ISCSI_OP_TEXT payload using unsolicited payload at &iser_rx_desc->data[0] into iscsi_cmd->text_in_ptr for usage with outgoing isert_put_text_rsp() -> iscsit_build_text_rsp() Cc: Or Gerlitz Cc: Mike Christie Signed-off-by: Nicholas Bellinger --- diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index ca440f4ad8ea..891087a37658 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c @@ -1025,15 +1025,24 @@ isert_handle_text_cmd(struct isert_conn *isert_conn, struct isert_cmd *isert_cmd { struct iscsi_cmd *cmd = &isert_cmd->iscsi_cmd; struct iscsi_conn *conn = isert_conn->conn; + u32 payload_length = ntoh24(hdr->dlength); int rc; + unsigned char *text_in; rc = iscsit_setup_text_cmd(conn, cmd, hdr); if (rc < 0) return rc; - /* - * FIXME: Add support for TEXT payload parsing - */ + text_in = kzalloc(payload_length, GFP_KERNEL); + if (!text_in) { + pr_err("Unable to allocate text_in of payload_length: %u\n", + payload_length); + return -ENOMEM; + } + cmd->text_in_ptr = text_in; + + memcpy(cmd->text_in_ptr, &rx_desc->data[0], payload_length); + return iscsit_process_text_cmd(conn, cmd, hdr); }