Re: [PATCH] iscsi-target: Remove SCF_SE_LUN_CMD flag abuses

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

 



On Sun, Oct 09, 2011 at 08:56:33AM +0000, Nicholas A. Bellinger wrote:
> +				if ((cmd->iscsi_opcode != ISCSI_OP_SCSI_CMD) &&
> +				    (cmd->iscsi_opcode != ISCSI_OP_SCSI_TMFUNC))
>  					iscsit_release_cmd(cmd);
>  				else
>  					transport_generic_free_cmd(&cmd->se_cmd,

This code block is duplicated all over, I think it should be factored
into a little helper.  Also there are superflous braces in the code
above, e.g.

void iscsit_free_cmd(struct iscsi_cmd *cmd)
{
	switch (cmd->iscsi_opcode) {
	case ISCSI_OP_SCSI_CMD:
	case ISCSI_OP_SCSI_TMFUNC:
		iscsit_release_cmd(cmd);
		break;
	default:
		transport_generic_free_cmd(&cmd->se_cmd, 1);
		break;
	}
}

> +			if (cmd->iscsi_opcode != ISCSI_OP_SCSI_CMD)
>  				iscsit_release_cmd(cmd);
>  			else
>  				transport_generic_free_cmd(&cmd->se_cmd, 1);

And this doesn't test for ISCSI_OP_SCSI_TMFUNC just because it can't
happen here, because of oversight or another reason?

--
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