public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Patrick Mansfield <patmans@us.ibm.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jens Axboe <axboe@suse.de>, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] change scsi_cmd_ioctl to take a gendisk instead of a queue
Date: Sun, 1 Feb 2004 13:49:16 -0800	[thread overview]
Message-ID: <20040201134916.A18509@beaverton.ibm.com> (raw)
In-Reply-To: <20040201213334.A17988@infradead.org>; from hch@infradead.org on Sun, Feb 01, 2004 at 09:33:34PM +0000

On Sun, Feb 01, 2004 at 09:33:34PM +0000, Christoph Hellwig wrote:
> On Sun, Feb 01, 2004 at 12:48:03PM -0800, Patrick Mansfield wrote:
> > Jens or others, any comments?
> > 
> > This patch against a recent bk 2.6 changes scsi_cmd_ioctl to take a
> > gendisk as an argument instead of a request_queue_t. This allows scsi char
> > devices to use the scsi_cmd_ioctl interface.
> 
> Heh, I had pretty much the same patch in 2.5.  I don't rember why
> I dropped it but you're looks at least as nice.

> > If the scsi upper level scsi_cmd_ioctl usage were consolidated in
> > scsi_prep_fn, we could pass a request_queue_t instead of a gendisk to
> > scsi_cmd_ioctl.
> 
> I don't parse that.  You mean taking REQ_PC handling from upper drivers
> to the scsi core?

Yes. That would also clean up the upper level driver code (for example,
sd.c's sd_init_command), but I have not tried this.

Basically for the REQ_BLOCK_PC, setup our own scsi_block_pc_intr in
scsi_lib.c, set up the scsi_cmnd, and set the scsi_cmnd done to
scsi_block_pc_intr. And maybe make still call scsi_init_io.

Then we don't need the:

	drv = *(struct scsi_driver **)req->rq_disk->private_data

And so, in theory ;-), we don't need rq_disk to be set. My reading of
current code shows none of the other scsi_cmd_ioctl users need rq_disk,
so we could then pass a q to scsi_cmd_ioctl. 

Then in the future we could use sg_io instead of the scsi_do_req,
scsi_wait_req, etc., and get rid of REQ_CMD in favor of REQ_BLOCK_PC.

> > +int bio_add_page(struct bio *bio, struct page *page, unsigned int len,
> > +		 unsigned int offset)
> > +{
> > +	return __bio_add_page(bdev_get_queue(bio->bi_bdev), bio, page,
> > +			      len, offset);
> > +}
> 
> Maybe worth inlining in a header? 

Maybe, and then export __bio_add_page.

-- Patrick Mansfield

  reply	other threads:[~2004-02-01 21:50 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
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 [this message]
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=20040201134916.A18509@beaverton.ibm.com \
    --to=patmans@us.ibm.com \
    --cc=axboe@suse.de \
    --cc=hch@infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    /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