From: Jeff Garzik <jgarzik@pobox.com>
To: Jens Axboe <axboe@suse.de>
Cc: James Bottomley <James.Bottomley@SteelEye.com>,
SCSI Mailing List <linux-scsi@vger.kernel.org>,
linux-ide@vger.kernel.org
Subject: Re: [PATCH] libata: device suspend/resume
Date: Wed, 25 May 2005 21:05:51 -0400 [thread overview]
Message-ID: <429520EF.2070501@pobox.com> (raw)
In-Reply-To: <20050525092952.GA7005@suse.de>
[-- Attachment #1: Type: text/plain, Size: 1938 bytes --]
Jens Axboe wrote:
> On Tue, May 24 2005, Jeff Garzik wrote:
>
>>Jens Axboe wrote:
>>
>>>I agree, it's a cleaner approach, with the rq being a container for
>>>generel messages as well not just SCSI commands. The one missing piece
>>>for that was the rq->end_io() callback so everything doesn't have to go
>>>down sync, but that is in now as well.
>>>
>>>I'll try and cook something up.
>>
>>Very cool ;)
>
>
> This is the base for it. It splits request->flags into two variables:
>
> - cmd_type. this is not a bitmask, but a value indicating what type of
> request this is.
>
> - cmd_flags. various command modified flags.
>
> The idea is to add a REQ_TYPE_LINUX_BLOCK request type, where we define
> a set of command opcodes that signify an upper level defined function
> (such as flush) that is implemented differently at the hardware/driver
> level. Basically a way to pass down messages or commands generically.
>
> I like this better than using scsi opcodes always, it's a cleaner
> abstraction. For sending generic commands to a device, we could add a
> function ala:
cmd_type just adds a needless layer of switch{} statements in block
drivers, and its information that can be trivially derived from the
command opcode itself.
cmd_type = cmd_types[opcode];
HOWEVER, don't fall in love with SCSI opcodes.
We want _Linux_ commands, not SCSI commands. Just think of a
request_queue as having its own command protocol, one that you can
_change at will_.
Yes, often request_queue commands may map seamlessly to SCSI (or ATA or
I2O) commands. And that's good. But don't let yourself be locked into
SCSI. SCSI is not generic enough, nor mutable enough for all our needs.
Just the other day I was thinking about the simpler approach, like the
attached :) It
* adds RQ_ to avoid namespace conflicts
* adds RQ_FLUSH, RQ_PM_EVENT
So, overall, I would say "think Linux opcodes" as the preferred direction.
Jeff
[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 1210 bytes --]
diff --git a/include/linux/fs.h b/include/linux/fs.h
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -66,13 +66,24 @@ extern int dir_notify_enable;
#define RW_MASK 1
#define RWA_MASK 2
-#define READ 0
-#define WRITE 1
-#define READA 2 /* read-ahead - don't block if no resources */
-#define SPECIAL 4 /* For non-blockdevice requests in request queue */
-#define READ_SYNC (READ | (1 << BIO_RW_SYNC))
-#define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC))
-#define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER))
+#define RQ_READ 0
+#define RQ_WRITE 1
+#define RQ_READA 2 /* read-ahead - don't block if no resources */
+#define RQ_SPECIAL 4 /* For non-blockdevice requests in request queue */
+#define RQ_READ_SYNC (READ | (1 << BIO_RW_SYNC))
+#define RQ_WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC))
+#define RQ_WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER))
+#define RQ_FLUSH 7
+#define RQ_PM_EVENT 8
+
+/* compatibility with existing code */
+#define READ RQ_READ
+#define WRITE RQ_WRITE
+#define READA RQ_READA
+#define SPECIAL RQ_SPECIAL
+#define READ_SYNC RQ_READ_SYNC
+#define WRITE_SYNC RQ_WRITE_SYNC
+#define WRITE_BARRIER RQ_WRITE_BARRIER
#define SEL_IN 1
#define SEL_OUT 2
next prev parent reply other threads:[~2005-05-26 1:05 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-23 20:15 [PATCH] libata: device suspend/resume Jeff Garzik
2005-05-23 20:41 ` James Bottomley
2005-05-23 20:45 ` Jeff Garzik
2005-05-23 22:10 ` James Bottomley
2005-05-24 6:21 ` Jens Axboe
2005-05-24 6:53 ` Jeff Garzik
2005-05-24 7:06 ` Hannes Reinecke
2005-05-24 7:08 ` Jens Axboe
2005-05-24 7:16 ` Jeff Garzik
2005-05-24 7:07 ` Jens Axboe
2005-05-24 7:10 ` Jeff Garzik
2005-05-24 7:13 ` Jens Axboe
2005-05-27 2:49 ` libata, SCSI and storage drivers Jeff Garzik
2005-05-27 6:45 ` Douglas Gilbert
2005-05-27 14:41 ` Luben Tuikov
2005-05-24 7:14 ` [PATCH] libata: device suspend/resume Hannes Reinecke
2005-05-24 7:15 ` Jens Axboe
2005-05-24 7:18 ` Jeff Garzik
2005-05-24 10:17 ` Douglas Gilbert
2005-05-24 17:10 ` Jeff Garzik
2005-05-24 7:59 ` Jens Axboe
2005-05-24 8:21 ` Jeff Garzik
2005-05-24 8:51 ` Jens Axboe
2005-05-24 16:37 ` Jeff Garzik
2005-05-25 9:29 ` Jens Axboe
2005-05-25 23:40 ` Guennadi Liakhovetski
2005-05-26 1:05 ` Jeff Garzik [this message]
2005-05-26 5:57 ` Jens Axboe
2005-05-26 22:56 ` Bartlomiej Zolnierkiewicz
2005-05-27 6:54 ` Jens Axboe
2005-05-27 2:01 ` Benjamin Herrenschmidt
2005-05-27 6:55 ` Jens Axboe
2005-05-24 13:48 ` Luben Tuikov
2005-05-24 17:29 ` Jeff Garzik
2005-05-24 13:05 ` Luben Tuikov
2005-05-27 2:54 ` Jeff Garzik
2005-05-24 16:27 ` Mark Lord
2005-05-24 16:33 ` Mark Lord
2005-05-24 16:04 ` Mark Lord
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=429520EF.2070501@pobox.com \
--to=jgarzik@pobox.com \
--cc=James.Bottomley@SteelEye.com \
--cc=axboe@suse.de \
--cc=linux-ide@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).