From patchwork Sun Feb 1 02:55:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 4946 Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n112uZji018782 for ; Sun, 1 Feb 2009 02:56:35 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id E62978E0F4A; Sat, 31 Jan 2009 21:56:34 -0500 (EST) Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n112uV9F004279 for ; Sat, 31 Jan 2009 21:56:31 -0500 Received: from mx3.redhat.com (mx3.redhat.com [172.16.48.32]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n112uXDl004536; Sat, 31 Jan 2009 21:56:33 -0500 Received: from hera.kernel.org (hera.kernel.org [140.211.167.34]) by mx3.redhat.com (8.13.8/8.13.8) with ESMTP id n112uIpD008556; Sat, 31 Jan 2009 21:56:18 -0500 Received: from htj.dyndns.org (IDENT:U2FsdGVkX198imzgOe7rgbeGODt3qLVf0rBbPTI6I4E@localhost [127.0.0.1]) by hera.kernel.org (8.14.2/8.14.2) with ESMTP id n112tuW1028005 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 1 Feb 2009 02:56:01 GMT Received: by htj.dyndns.org (Postfix, from userid 10000) id 937E94094A7B9; Sun, 1 Feb 2009 11:55:51 +0900 (KST) From: Tejun Heo To: jeff@garzik.org, linux-ide@vger.kernel.org, jens.axboe@oracle.com, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, James.Bottomley@HansenPartnership.com, Mauelshagen@redhat.com, dm-devel@redhat.com Date: Sun, 1 Feb 2009 11:55:51 +0900 Message-Id: <1233456951-992-4-git-send-email-tj@kernel.org> In-Reply-To: <1233456951-992-1-git-send-email-tj@kernel.org> References: <1233456951-992-1-git-send-email-tj@kernel.org> X-Virus-Scanned: ClamAV 0.93.3/8932/Sat Jan 31 23:12:16 2009 on hera.kernel.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, UNPARSEABLE_RELAY autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on hera.kernel.org X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (hera.kernel.org [127.0.0.1]); Sun, 01 Feb 2009 02:56:05 +0000 (UTC) X-RedHat-Spam-Score: -3.933 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Scanned-By: MIMEDefang 2.63 on 172.16.48.32 X-loop: dm-devel@redhat.com Cc: Tejun Heo Subject: [dm-devel] [PATCH 3/3] libata: export HPA size as alt_size X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com Export HPA size as alt_size so that userland tools which need the BIOS size can determine it. Signed-off-by: Tejun Heo --- drivers/ata/libata-core.c | 2 ++ drivers/ata/libata-scsi.c | 2 ++ include/linux/libata.h | 1 + 3 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 88c2428..cfea50a 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -1537,6 +1537,8 @@ static int ata_hpa_resize(struct ata_device *dev) } /* let's unlock HPA */ + dev->alt_n_sectors = sectors; + rc = ata_set_max_sectors(dev, native_sectors); if (rc == -EACCES) { /* if device aborted the command, skip HPA resizing */ diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 3c4c5ae..911fe7c 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -1104,6 +1104,8 @@ static int ata_scsi_dev_config(struct scsi_device *sdev, blk_queue_update_dma_alignment(sdev->request_queue, ATA_SECT_SIZE - 1); sdev->manage_start_stop = 1; + + sdev->alt_capacity = dev->alt_n_sectors; } if (dev->flags & ATA_DFLAG_AN) diff --git a/include/linux/libata.h b/include/linux/libata.h index bca3ba2..97736d5 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -582,6 +582,7 @@ struct ata_device { #endif /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ u64 n_sectors; /* size of device, if ATA */ + u64 alt_n_sectors; /* size bios wants us to see */ unsigned int class; /* ATA_DEV_xxx */ unsigned long unpark_deadline;