Re: block layer sg, bsg

From: Douglas Gilbert
Date: Wed Aug 04 2004 - 18:13:00 EST


Jens Axboe wrote:
On Wed, Aug 04 2004, Jeff Garzik wrote:

On Wed, Aug 04, 2004 at 08:44:29AM -0700, David S. Miller wrote:

Or use a more portable well-defined type which does not change
size nor layout between 32-bit and 64-bit environments.

IMO if this (the above) is not done, the interface needs work.

For interfaces that replace ioctl(2) with read(2)/write(2), for passing
data structures to/from the kernel, Al has rightly suggested that these
structures be not only fixed size (as David described above), but also
fixed-endian.


I completely agree with that, we need a different structure for other
devices as well. Show me what you'd like for libata, for instance.

If a new structure with anything but 'S' (0x53) in the first 4
bytes was chosen then the bsg driver could handle the new
structure and sg_io_hdr.

For example:
struct bsg_io_hdr {
int8_t interface_id[4]; /* [i] 'B' in each element (required) */
uint8_t dxfer_direction;
.............
};

SCSI commands are all big endian and that seems to work
fine. Could pointers be passed as 8 byte big endian
unsigned integers?

Doug Gilbert

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/