From: Christoph Hellwig <hch@infradead.org>
To: Mike Christie <michaelc@cs.wisc.edu>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH RFC/RFT 2/4] add scsi helpers
Date: Thu, 15 Sep 2005 11:13:03 +0100 [thread overview]
Message-ID: <20050915101303.GB24689@infradead.org> (raw)
In-Reply-To: <1126736388.16778.25.camel@max>
> +struct __scsi_request {
> + void *data;
> + void (*done)(void *data, char *sense, int result, int resid);
> + char sense[SCSI_SENSE_BUFFERSIZE];
> +};
I don't think this is a good structure name. Just something like
iocontext or similar?
> +int scsi_execute_async_iov_req(struct scsi_device *sdev,
> + const unsigned char *cmd, int data_direction,
> + struct kvec *vec, int vec_count, int timeout,
> + int retries, void *privdata,
> + void (*done)(void *, char *, int, int))
If you passed an request_queue_t instead of th scsi_device this function
would not have any knowledge about scsi internals and could be moved up
to the block layer. not sure that's actually a good idea.
If we stick to putting it into the scsi layer the done callback could
normalize the sense data, though.
> + struct request *req;
> + struct __scsi_request *sreq;
> + int write = (data_direction == DMA_TO_DEVICE);
What about just passing in a write parameter directly?
> +
> + sreq = kzalloc(sizeof(*sreq), GFP_ATOMIC);
> + if (!sreq) {
> + return DRIVER_ERROR << 24;
> + }
> +
> + req = blk_get_request(sdev->request_queue, write, GFP_ATOMIC);
can you add a gfp_mask argument instead of hardcoding GFP_ATOMIC?
next prev parent reply other threads:[~2005-09-15 10:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-14 22:19 [PATCH RFC/RFT 2/4] add scsi helpers Mike Christie
2005-09-15 10:13 ` Christoph Hellwig [this message]
2005-09-15 17:30 ` Mike Christie
2005-09-15 17:55 ` Mike Christie
2005-09-15 18:29 ` Christoph Hellwig
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=20050915101303.GB24689@infradead.org \
--to=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