public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@SteelEye.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Mike Christie <michaelc@cs.wisc.edu>,
	device-mapper development <dm-devel@redhat.com>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	Jens Axboe <axboe@suse.de>
Subject: Re: [PATCH RFC 0/4] use scatter lists for all block pc requests and simplify hw handlers
Date: Tue, 07 Jun 2005 07:20:01 -0500	[thread overview]
Message-ID: <1118146802.4998.3.camel@mulgrave> (raw)
In-Reply-To: <20050607121020.GA6458@infradead.org>

On Tue, 2005-06-07 at 13:10 +0100, Christoph Hellwig wrote:
> shouldn't blk_rq_map_kern handle a 0 buffer and do nothing more than
> blk_get_request?  It's not exactly a criticial fastpath and that would make life
> easier for the callers.

Yes ... and it should probably do bio bouncing as well, since there's
nothing special we have to do on completion to clean it up.

I also think we might need a blk_rq_kern_iovec call that would take a
vector of user I/O's and map it to a multiple bio request.  This would
allow me to strip all of the user mapping out of sg, and also allow the
block layer SG_IO to pick up this API (currently it returns -ENOTSUPP if
you try it).

> > +		if (req->rq_disk) {
> > +			drv = *(struct scsi_driver **)req->rq_disk->private_data;
> > +			if (unlikely(!drv->init_command(cmd))) {
> > +				scsi_release_buffers(cmd);
> > +				scsi_put_command(cmd);
> > +				return BLKPREP_KILL;
> > +			}
> > +		} else {
> > +			memcpy(cmd->cmnd, req->cmd, sizeof(cmd->cmnd));
> > +			if (rq_data_dir(req) == WRITE)
> > +				cmd->sc_data_direction = DMA_TO_DEVICE;
> > +			else if (req->data_len)
> > +				cmd->sc_data_direction = DMA_FROM_DEVICE;
> > +			else
> > +				cmd->sc_data_direction = DMA_NONE;
> > +			
> > +			cmd->transfersize = req->data_len;
> > +			cmd->allowed = 3;
> > +			cmd->timeout_per_command = req->timeout;
> 
> most of this could probably be done in the midlayer always instead of the
> upper drivers.

I don't think so ... this is all struct scsi_cmnd handling.  SCSI needs
to allocate and process its internal command structures.

However, I think we have a case for the number of retries being carried
by the generic request structure.

James

  reply	other threads:[~2005-06-07 12:20 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-04  1:19 [PATCH RFC 0/4] use scatter lists for all block pc requests and simplify hw handlers Mike Christie
2005-06-04 16:07 ` James Bottomley
2005-06-05  7:15   ` Mike Christie
2005-06-05  9:41     ` [dm-devel] " christophe varoqui
2005-06-06 13:31       ` Lars Marowsky-Bree
2005-06-07  0:04         ` Michael Christie
2005-06-07  7:01           ` [dm-devel] " Lars Marowsky-Bree
2005-06-05 14:40     ` James Bottomley
2005-06-05 19:11       ` James Bottomley
2005-06-06  5:43         ` Douglas Gilbert
2005-06-06 14:19           ` James Bottomley
2005-06-07 13:08             ` Douglas Gilbert
2005-06-07 13:34               ` Tony Battersby
2005-06-07 16:34                 ` James Bottomley
2005-06-07 18:38                   ` [PATCH RFC 0/4] use scatter lists for all blockpc " Tony Battersby
2005-06-07 18:43                     ` Jens Axboe
2005-06-07 15:59               ` [PATCH RFC 0/4] use scatter lists for all block pc " James Bottomley
2005-06-07 18:07                 ` Jens Axboe
2005-06-07 19:26                   ` James Bottomley
2005-06-08  7:09                     ` Jens Axboe
2005-06-06 19:02     ` Patrick Mansfield
2005-06-07 15:26       ` Michael Christie
2005-06-07 18:23         ` Patrick Mansfield
2005-06-08 15:41           ` Mike Christie
2005-06-09  0:08             ` Patrick Mansfield
2005-06-09  6:18               ` Jens Axboe
2005-06-09 11:51                 ` James Bottomley
2005-06-09 11:54                   ` Jens Axboe
2005-06-07 12:10   ` Christoph Hellwig
2005-06-07 12:20     ` James Bottomley [this message]
2005-06-07 15:36       ` Michael Christie
2005-06-07 15:45         ` [dm-devel] " Michael Christie
2005-06-07 16:26           ` Kai Makisara
2005-06-07 19:23             ` James Bottomley
2005-06-07 18:09         ` Jens Axboe
2005-06-08 12:46           ` Mike Christie
2005-06-07 18:07 ` Jens Axboe
2005-06-07 19:38   ` James Bottomley
2005-06-08  3:00     ` Douglas Gilbert
2005-06-08 12:59       ` James Bottomley
2005-06-08 14:50         ` Luben Tuikov

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=1118146802.4998.3.camel@mulgrave \
    --to=james.bottomley@steeleye.com \
    --cc=axboe@suse.de \
    --cc=dm-devel@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    /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