public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Patrick Mansfield <patmans@us.ibm.com>
Cc: Jens Axboe <axboe@suse.de>, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] add scsi_cmd_ioctl (SG_IO) support for st
Date: Sun, 1 Feb 2004 21:35:52 +0000	[thread overview]
Message-ID: <20040201213552.B17988@infradead.org> (raw)
In-Reply-To: <20040201125031.A18128@beaverton.ibm.com>; from patmans@us.ibm.com on Sun, Feb 01, 2004 at 12:50:31PM -0800

> +static void st_intr(struct scsi_cmnd *SCpnt)
> +{

What about st_done instead?  I know sd and sr use the intr names, but
they're really misleading.  Also convention for new code is to use
cmd or scmd as variable names for scsi commands.

> +static int st_init_command(struct scsi_cmnd *SCpnt)
> +{
> +	struct request *rq;
> +
> +	if (!(SCpnt->request->flags & REQ_BLOCK_PC))
> +		return 0;
> +
> +	rq = SCpnt->request;
> +	if (sizeof(rq->cmd) > sizeof(SCpnt->cmnd))
> +		return 0;
> +
> +	memcpy(SCpnt->cmnd, rq->cmd, sizeof(SCpnt->cmnd));
> +
> +	if (rq_data_dir(rq) == WRITE)
> +		SCpnt->sc_data_direction = DMA_TO_DEVICE;
> +	else if (rq->data_len)
> +		SCpnt->sc_data_direction = DMA_FROM_DEVICE;
> +	else
> +		SCpnt->sc_data_direction = DMA_NONE;
> +
> +	SCpnt->timeout_per_command = rq->timeout;
> +	SCpnt->transfersize = rq->data_len;
> +	SCpnt->done = st_intr;
> +	return 1;

This one looks obviously good, but yeah, this would much better fit into
the scsi midlayer.  Not for this patch session, though.


  reply	other threads:[~2004-02-01 21:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-01 20:48 [PATCH] change scsi_cmd_ioctl to take a gendisk instead of a queue Patrick Mansfield
2004-02-01 20:50 ` [PATCH] add scsi_cmd_ioctl (SG_IO) support for st Patrick Mansfield
2004-02-01 21:35   ` Christoph Hellwig [this message]
2004-02-01 21:51     ` Patrick Mansfield
2004-02-01 22:28     ` Willem Riede
2004-02-01 22:36       ` Christoph Hellwig
2004-02-01 21:33 ` [PATCH] change scsi_cmd_ioctl to take a gendisk instead of a queue Christoph Hellwig
2004-02-01 21:49   ` Patrick Mansfield
2004-02-01 22:13     ` Christoph Hellwig
2004-02-02 13:27 ` Jens Axboe

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=20040201213552.B17988@infradead.org \
    --to=hch@infradead.org \
    --cc=axboe@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=patmans@us.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox