]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] libata: move dev->max_sectors configuration into ata_dev_configure()
authorTejun Heo <htejun@gmail.com>
Wed, 1 Nov 2006 09:39:55 +0000 (18:39 +0900)
committerJeff Garzik <jeff@garzik.org>
Sat, 2 Dec 2006 03:41:31 +0000 (22:41 -0500)
Move dev->max_sectors configuration from ata_scsi_dev_config() to
ata_dev_configure().

* more consistent.
* allows LLDs to peek at the default dev->max_sectors value.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/ata/libata-core.c
drivers/ata/libata-scsi.c

index 5028396029b3722eb7661cda00a10f318f90d598..f531a89c26c9add70493083771debe8bd2fa0ba5 100644 (file)
@@ -1533,6 +1533,11 @@ int ata_dev_configure(struct ata_device *dev)
                                       cdb_intr_string);
        }
 
+       /* determine max_sectors */
+       dev->max_sectors = ATA_MAX_SECTORS;
+       if (dev->flags & ATA_DFLAG_LBA48)
+               dev->max_sectors = ATA_MAX_SECTORS_LBA48;
+
        if (dev->horkage & ATA_HORKAGE_DIAGNOSTIC) {
                /* Let the user know. We don't want to disallow opens for
                   rescue purposes, or in case the vendor is just a blithering
index 6b2553dae489c0e5a43754f93b6592ccc7fc8deb..f13dd07a5331403d028b511794c997a1edf245f8 100644 (file)
@@ -807,23 +807,10 @@ static void ata_scsi_sdev_config(struct scsi_device *sdev)
 static void ata_scsi_dev_config(struct scsi_device *sdev,
                                struct ata_device *dev)
 {
-       unsigned int max_sectors;
+       /* configure max sectors */
+       blk_queue_max_sectors(sdev->request_queue, dev->max_sectors);
 
-       /* TODO: 2048 is an arbitrary number, not the
-        * hardware maximum.  This should be increased to
-        * 65534 when Jens Axboe's patch for dynamically
-        * determining max_sectors is merged.
-        */
-       max_sectors = ATA_MAX_SECTORS;
-       if (dev->flags & ATA_DFLAG_LBA48)
-               max_sectors = ATA_MAX_SECTORS_LBA48;
-       if (dev->max_sectors)
-               max_sectors = dev->max_sectors;
-
-       blk_queue_max_sectors(sdev->request_queue, max_sectors);
-
-       /*
-        * SATA DMA transfers must be multiples of 4 byte, so
+       /* SATA DMA transfers must be multiples of 4 byte, so
         * we need to pad ATAPI transfers using an extra sg.
         * Decrement max hw segments accordingly.
         */