Re: [PATCH 36/42] target/iscsi: Remove unused function iscsit_send_async_msg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2011-05-27 at 12:07 -0700, Andy Grover wrote:
> Signed-off-by: Andy Grover <agrover@xxxxxxxxxx>
> ---

<nod>

This was originally called from an IOCTL (implict) async operation
context in LIO v2.x code primarly for the purpose of sending
REQUEST_LOGOUT.  This did not end up really needing to be hooked up to
modern configfs for the shutdown code, hence the unused code here..

So committed as 14ed84a00759, as we can just open code when we decide it
to re-enable REQUEST_LOGOUT functionality via implict configfs
operation. 

Thanks,

--nab

>  drivers/target/iscsi/iscsi_target.c |  109 -----------------------------------
>  1 files changed, 0 insertions(+), 109 deletions(-)
> 
> diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
> index c8d7f94..34749e8 100644
> --- a/drivers/target/iscsi/iscsi_target.c
> +++ b/drivers/target/iscsi/iscsi_target.c
> @@ -2608,115 +2608,6 @@ static int iscsit_handle_immediate_data(
>  	return IMMEDIATE_DATA_NORMAL_OPERATION;
>  }
>  
> -int iscsit_send_async_msg(
> -	struct iscsi_conn *conn,
> -	u16 cid,
> -	u8 async_event,
> -	u8 async_vcode)
> -{
> -	u8 iscsi_hdr[ISCSI_HDR_LEN+ISCSI_CRC_LEN];
> -	u32 tx_send = ISCSI_HDR_LEN, tx_sent = 0;
> -	struct iscsi_async *hdr;
> -	struct kvec iov;
> -
> -	memset(&iov, 0, sizeof(struct kvec));
> -	memset(&iscsi_hdr, 0, ISCSI_HDR_LEN+ISCSI_CRC_LEN);
> -
> -	hdr		= (struct iscsi_async *)&iscsi_hdr;
> -	hdr->opcode	= ISCSI_OP_ASYNC_EVENT;
> -	hdr->flags	|= ISCSI_FLAG_CMD_FINAL;
> -	hton24(hdr->dlength, 0);
> -	put_unaligned_le64(0, &hdr->lun[0]);
> -	put_unaligned_be64(0xffffffffffffffff, &hdr->rsvd4[0]);
> -	hdr->statsn	= cpu_to_be32(conn->stat_sn++);
> -	spin_lock(&conn->sess->cmdsn_lock);
> -	hdr->exp_cmdsn	= cpu_to_be32(conn->sess->exp_cmd_sn);
> -	hdr->max_cmdsn	= cpu_to_be32(conn->sess->max_cmd_sn);
> -	spin_unlock(&conn->sess->cmdsn_lock);
> -	hdr->async_event = async_event;
> -	hdr->async_vcode = async_vcode;
> -
> -	switch (async_event) {
> -	case ISCSI_ASYNC_MSG_SCSI_EVENT:
> -		printk(KERN_ERR "ISCSI_ASYNC_MSG_SCSI_EVENT: not supported yet.\n");
> -		return -1;
> -	case ISCSI_ASYNC_MSG_REQUEST_LOGOUT:
> -		TRACE(TRACE_STATE, "Moving to"
> -				" TARG_CONN_STATE_LOGOUT_REQUESTED.\n");
> -		conn->conn_state = TARG_CONN_STATE_LOGOUT_REQUESTED;
> -		hdr->param1 = 0;
> -		hdr->param2 = 0;
> -		hdr->param3 = cpu_to_be16(SECONDS_FOR_ASYNC_LOGOUT);
> -		break;
> -	case ISCSI_ASYNC_MSG_DROPPING_CONNECTION:
> -		hdr->param1 = cpu_to_be16(cid);
> -		hdr->param2 = cpu_to_be16(conn->sess->sess_ops->DefaultTime2Wait);
> -		hdr->param3 = cpu_to_be16(conn->sess->sess_ops->DefaultTime2Retain);
> -		break;
> -	case ISCSI_ASYNC_MSG_DROPPING_ALL_CONNECTIONS:
> -		hdr->param1 = 0;
> -		hdr->param2 = cpu_to_be16(conn->sess->sess_ops->DefaultTime2Wait);
> -		hdr->param3 = cpu_to_be16(conn->sess->sess_ops->DefaultTime2Retain);
> -		break;
> -	case ISCSI_ASYNC_MSG_PARAM_NEGOTIATION:
> -		hdr->param1 = 0;
> -		hdr->param2 = 0;
> -		hdr->param3 = cpu_to_be16(SECONDS_FOR_ASYNC_TEXT);
> -		break;
> -	case ISCSI_ASYNC_MSG_VENDOR_SPECIFIC:
> -		printk(KERN_ERR "ISCSI_ASYNC_MSG_VENDOR_SPECIFIC not"
> -			" supported yet.\n");
> -		return -1;
> -	default:
> -		printk(KERN_ERR "Unknown AsycnEvent 0x%02x, protocol"
> -			" error.\n", async_event);
> -		return -1;
> -	}
> -
> -	iov.iov_base	= &iscsi_hdr;
> -	iov.iov_len	= ISCSI_HDR_LEN;
> -
> -	if (conn->conn_ops->HeaderDigest) {
> -		u32 *header_digest = (u32 *)&iscsi_hdr[ISCSI_HDR_LEN];
> -
> -		iscsit_do_crypto_hash_buf(&conn->conn_tx_hash,
> -				(unsigned char *)&iscsi_hdr, ISCSI_HDR_LEN,
> -				0, NULL, (u8 *)header_digest);
> -				
> -		iov.iov_len += ISCSI_CRC_LEN;
> -		tx_send += ISCSI_CRC_LEN;
> -		TRACE(TRACE_DIGEST, "Attaching CRC32 HeaderDigest for Async"
> -			" Msg PDU 0x%08x\n", *header_digest);
> -	}
> -
> -	TRACE(TRACE_ISCSI, "Built Async Message StatSN: 0x%08x, AsyncEvent:"
> -		" 0x%02x, P1: 0x%04x, P2: 0x%04x, P3: 0x%04x\n",
> -		ntohl(hdr->statsn), hdr->async_event, ntohs(hdr->param1),
> -		ntohs(hdr->param2), ntohs(hdr->param3));
> -
> -	tx_sent = tx_data(conn, &iov, 1, tx_send);
> -	if (tx_sent != tx_send) {
> -		printk(KERN_ERR "tx_data returned %d expecting %d\n",
> -				tx_sent, tx_send);
> -		return -1;
> -	}
> -
> -	if (async_event == ISCSI_ASYNC_MSG_REQUEST_LOGOUT) {
> -		wait_for_completion_timeout(&conn->sess->async_msg_comp,
> -					SECONDS_FOR_ASYNC_LOGOUT * HZ);
> -
> -		if (conn->conn_state == TARG_CONN_STATE_LOGOUT_REQUESTED) {
> -			printk(KERN_ERR "Asynchronous message timer expired"
> -				" without receiving a logout request,  dropping"
> -				" iSCSI session.\n");
> -			iscsit_send_async_msg(conn, 0,
> -				ISCSI_ASYNC_MSG_DROPPING_ALL_CONNECTIONS, 0);
> -			iscsit_free_session(conn->sess);
> -		}
> -	}
> -	return 0;
> -}
> -
>  /*
>   *	Called with sess->conn_lock held.
>   */
> -- 
> 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


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux