All of lore.kernel.org
 help / color / mirror / Atom feed
From: keith.busch@intel.com (Keith Busch)
Subject: [PATCHv3] NVMe: write_long SCSI to NVMe translation implementation
Date: Tue, 24 Mar 2015 16:36:50 +0000 (UTC)	[thread overview]
Message-ID: <alpine.LNX.2.00.1503241628000.32385@localhost.lm.intel.com> (raw)
In-Reply-To: <20150324162301.GN4003@linux.intel.com>

On Tue, 24 Mar 2015, Matthew Wilcox wrote:
> On Mon, Mar 23, 2015@07:18:13PM +0530, Sunad Bhandary S wrote:
>> +	case WRITE_LONG:
>> +		retcode = nvme_trans_write_long(ns, hdr, cmd);
>> +		break;
>> +	case SERVICE_ACTION_OUT_16:
>> +		if (IS_WRITE_LONG_16(cmd))
>> +			retcode = nvme_trans_write_long(ns, hdr, cmd);
>> +		else
>> +			goto out;
>> +		break;
>>  	default:
>>   out:
>
> Umm, why not simply:
>
> 	case SERVICE_ACTION_OUT_16:
> 		if (IS_WRITE_LONG_16(cmd))
> 			retcode = nvme_trans_write_long(ns, hdr, cmd);
> 		break;

We need to jump to a case that sets the sense data for the IllReq Check
Condition.

Actually I'm not sure why there are a bunch of:

 	case foobar:
 		retcode = nvme_trans_foobar();
 		break;

Rather than just:

 	case foobar:
 		return nvme_trans_foobar();

It make the whole thing cleaner and allow breaking out to an error
handler at the end of the function.

Anyhow, it's on my list to clean up this up since we are blk-mq now and
can leverage REQ_BLOCK_TYPE_PC to do all the boiler plate user space
copying, among other things. We can reduce the nvme-scsi.c file size
by half.

      reply	other threads:[~2015-03-24 16:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23 13:48 [PATCHv3] NVMe: write_long SCSI to NVMe translation implementation Sunad Bhandary S
2015-03-24 11:57 ` Sunad Bhandary
2015-03-24 13:54   ` Keith Busch
2015-04-16 12:04     ` Sunad Bhandary
2015-04-16 14:27       ` Keith Busch
2015-03-24 16:23 ` Matthew Wilcox
2015-03-24 16:36   ` Keith Busch [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.00.1503241628000.32385@localhost.lm.intel.com \
    --to=keith.busch@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.