Re: [patch] My AMD IDE driver, v2.7

Linus Torvalds
2002-03-12T04:51:49Z

On Mon, 11 Mar 2002, Jeff Garzik wrote:
>
> For the details of the userspace interface (for both ATA and SCSI), my
> idea was to use standard read(2) and write(2).

I like it, but you have to realize that most, if not all, of the commands
really are not a matter of a read or a write, but a "transaction", which
is a pair of both (and at least in theory you could have transactions that
are more complex than just a "command + result", ie more than just a
write("cmd + outdata")+read("status + indata")).

I agree 100% with the notion of using read/write to do this, but I think
you need to make it very explicit that we _are_ talking about
transactions, and that the file descriptor would act as a "transaction
descriptor" when you do this. The file descriptor is the one that matches
up the write that started the transaction with the read that gets the
status of it - thus allowing multiple concurrent transactions in flight.

And the command has to have some structure, ie it needs to not just be the
low-level command, but also have the information about the "format" of the
transaction (so that the generic layer can build up the correct BIO data
structures for the result, before it actually sees the read itself).

Linus