Re: swsusp: don't eat ide disks

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Mon Nov 04 2002 - 08:37:54 EST


On Mon, 2002-11-04 at 09:44, Jens Axboe wrote:
> It's probably not a good idea to rely on ata drives that also speak
> atapi, to my knowledge only a few old WDC drives ever did that. Since we
> are basically moving to the point where "SCSI" commands is the
> commandset that the block layer uses to make drivers do things for it,
> I had the idea of doing a rq -> taskfile conversion for ide. Just for
> simple things like read/write and sync cache, basically stuff that is
> directly translatable. That would make Linus' example actually work, and
> it would also make the direct read/write programs using SG_IO work on
> IDE drives as well.

Going beyond IDE it might be cleaner to be able to do

        struct bio_command_ops
        {
                eject: idedisk_eject,
                suspend: idedisk_suspend,
                identify: idedisk_identify,
                ...
                [maybe even read:/write: in some cases
                 like smart scsi raids]
        }

that way IDE disk and all the other weirdass drives can have -one-
command parser not the twenty differently buggy ones we have now simply
by doing

        if(rq_is_command(rq))
                bio_do_command(rq, &bio_command_ops);

Its also very convenient as we can add fields to the structure and then
to drives without breaking the API and without so much updating

Alan

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



This archive was generated by hypermail 2b29 : Thu Nov 07 2002 - 22:00:32 EST