# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID 4a5cbd892ace94d6b70ade541febfcd927bc460c
# Parent 1a66de3462c1290b6612a5c2b329b303d7b51cd3
backport blkback
Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
---
drivers/xen/blkback/blkback.c | 25 ++++++++-----------------
1 files changed, 8 insertions(+), 17 deletions(-)
diff -r 1a66de3462c1 -r 4a5cbd892ace drivers/xen/blkback/blkback.c
--- a/drivers/xen/blkback/blkback.c Sun Oct 08 13:10:56 2006 -0400
+++ b/drivers/xen/blkback/blkback.c Sun Oct 08 13:50:43 2006 -0400
@@ -341,7 +341,7 @@ static void dispatch_rw_block_io(blkif_t
blkif_request_t *req,
pending_req_t *pending_req)
{
- extern void ll_rw_block(int rw, int nr, struct buffer_head * bhs[]);
+ extern void ll_rw_block(int rw, int nr, struct buffer_head * bhs[]);
int operation = (req->operation == BLKIF_OP_WRITE) ? WRITE : READ;
struct gnttab_map_grant_ref map[BLKIF_MAX_SEGMENTS_PER_REQUEST];
struct phys_req preq;
@@ -398,14 +398,9 @@ static void dispatch_rw_block_io(blkif_t
}
pending_handle(pending_req, i) = map[i].handle;
-#ifdef CONFIG_XEN_IA64_DOM0_NON_VP
- pending_vaddrs[vaddr_pagenr(pending_req, i)] =
- (unsigned long)gnttab_map_vaddr(map[i]);
-#else
set_phys_to_machine(__pa(vaddr(
pending_req, i)) >> PAGE_SHIFT,
FOREIGN_FRAME(map[i].dev_bus_addr >> PAGE_SHIFT));
-#endif
seg[i].buf = map[i].dev_bus_addr |
(req->seg[i].first_sect << 9);
}
@@ -414,7 +409,7 @@ static void dispatch_rw_block_io(blkif_t
DPRINTK("access denied: %s of [%llu,%llu] on dev=%04x\n",
operation == READ ? "read" : "write",
preq.sector_number,
- preq.sector_number + preq.nr_sects, preq.dev);
+ preq.sector_number + preq.nr_sects, preq.dev);
goto fail_flush;
}
@@ -518,6 +513,12 @@ static int __init blkif_init(void)
return -ENODEV;
mmap_pages = blkif_reqs * BLKIF_MAX_SEGMENTS_PER_REQUEST;
+
+ page = balloon_alloc_empty_page_range(mmap_pages);
+ if (page == NULL)
+ return -ENOMEM;
+ mmap_vstart = (unsigned long)pfn_to_kaddr(page_to_pfn(page));
+
pending_reqs = kmalloc(sizeof(pending_reqs[0]) *
blkif_reqs, GFP_KERNEL);
pending_grant_handles = kmalloc(sizeof(pending_grant_handles[0]) *
@@ -534,16 +535,6 @@ static int __init blkif_init(void)
blkif_interface_init();
-#ifdef CONFIG_XEN_IA64_DOM0_NON_VP
- extern unsigned long alloc_empty_foreign_map_page_range(
- unsigned long pages);
- mmap_vstart = (unsigned long)
- alloc_empty_foreign_map_page_range(mmap_pages);
-#else /* ! ia64 */
- page = balloon_alloc_empty_page_range(mmap_pages);
- BUG_ON(page == NULL);
- mmap_vstart = (unsigned long)pfn_to_kaddr(page_to_pfn(page));
-#endif
printk("%s: reqs=%d, pages=%d, mmap_vstart=0x%lx\n",
__FUNCTION__, blkif_reqs, mmap_pages, mmap_vstart);
BUG_ON(mmap_vstart == 0);
_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel
|