diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-05-26 09:49:19 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-05-26 09:49:19 +0100 |
commit | 0f688ae30489d364fb6f12428b695cd7d83e9cdc (patch) | |
tree | 3a65b64c2089aec9c139a2c131763515c688d4ba /extras/mini-os/blkfront.c | |
parent | c04c51bbf9790ee336a3f17a9045fb9f3568d1e3 (diff) | |
download | xen-0f688ae30489d364fb6f12428b695cd7d83e9cdc.tar.gz xen-0f688ae30489d364fb6f12428b695cd7d83e9cdc.tar.bz2 xen-0f688ae30489d364fb6f12428b695cd7d83e9cdc.zip |
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@eu.citrix.com>
Diffstat (limited to 'extras/mini-os/blkfront.c')
-rw-r--r-- | extras/mini-os/blkfront.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/extras/mini-os/blkfront.c b/extras/mini-os/blkfront.c index d869715bea..6fc2c96eac 100644 --- a/extras/mini-os/blkfront.c +++ b/extras/mini-os/blkfront.c @@ -310,14 +310,14 @@ void blkfront_aio(struct blkfront_aiocb *aiocbp, int write) 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[j].last_sect = PAGE_SIZE / 512 - 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[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) { |