WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-3.4-testing] minios: Fix blkfront driver when secto

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.4-testing] minios: Fix blkfront driver when sector_size != 512
From: "Xen patchbot-3.4-testing" <patchbot-3.4-testing@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 02 Jun 2009 22:10:21 -0700
Delivery-date: Thu, 11 Jun 2009 08:04:34 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1243863342 -3600
# Node ID 9603c86017f42529d158f373531ad2415384a011
# Parent  7998fa60ec4ba080d89d7c7e93c001f9937db471
minios: Fix blkfront driver when sector_size != 512

The first and last sector as well as the sector number of the request
is expressed in 512 bytes units, independently from the real sector
size.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
xen-unstable changeset:   19635:85d6849bdcd9
xen-unstable date:        Tue May 26 09:49:19 2009 +0100
---
 extras/mini-os/blkfront.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff -r 7998fa60ec4b -r 9603c86017f4 extras/mini-os/blkfront.c
--- a/extras/mini-os/blkfront.c Mon Jun 01 14:35:11 2009 +0100
+++ b/extras/mini-os/blkfront.c Mon Jun 01 14:35:42 2009 +0100
@@ -310,14 +310,14 @@ void blkfront_aio(struct blkfront_aiocb 
     req->nr_segments = n;
     req->handle = dev->handle;
     req->id = (uintptr_t) aiocbp;
-    req->sector_number = aiocbp->aio_offset / dev->info.sector_size;
+    req->sector_number = aiocbp->aio_offset / 512;
 
     for (j = 0; j < n; j++) {
         req->seg[j].first_sect = 0;
-        req->seg[j].last_sect = PAGE_SIZE / dev->info.sector_size - 1;
-    }
-    req->seg[0].first_sect = ((uintptr_t)aiocbp->aio_buf & ~PAGE_MASK) / 
dev->info.sector_size;
-    req->seg[n-1].last_sect = (((uintptr_t)aiocbp->aio_buf + 
aiocbp->aio_nbytes - 1) & ~PAGE_MASK) / dev->info.sector_size;
+        req->seg[j].last_sect = PAGE_SIZE / 512 - 1;
+    }
+    req->seg[0].first_sect = ((uintptr_t)aiocbp->aio_buf & ~PAGE_MASK) / 512;
+    req->seg[n-1].last_sect = (((uintptr_t)aiocbp->aio_buf + 
aiocbp->aio_nbytes - 1) & ~PAGE_MASK) / 512;
     for (j = 0; j < n; j++) {
        uintptr_t data = start + j * PAGE_SIZE;
         if (!write) {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.4-testing] minios: Fix blkfront driver when sector_size != 512, Xen patchbot-3.4-testing <=