/* FIXME: Use dynamic device id if this is not set. */
err = xenbus_scanf(XBT_NIL, dev->nodename,
@@ -1033,10 +990,6 @@ static int blkfront_probe(struct xenbus_device *dev,
return err;
}
}
- err = xenbus_scanf(XBT_NIL, dev->otherend,
- "max-ring-pages", "%u", &max_ring_pages);
- if (err != 1)
- max_ring_pages = 1;
if (xen_hvm_domain()) {
char *type;
@@ -1080,13 +1033,9 @@ static int blkfront_probe(struct xenbus_device *dev,
info->connected = BLKIF_STATE_DISCONNECTED;
INIT_WORK(&info->work, blkif_restart_queue);
- info->num_ring_pages = min(max_ring_pages, BLKIF_MAX_NUM_RING_PAGES);
-
- ring_size = __RING_SIZE((struct blkif_sring *)0,
- info->num_ring_pages * PAGE_SIZE);
- for (i = 0; i < ring_size; i++)
+ for (i = 0; i < BLK_RING_SIZE; i++)
info->shadow[i].req.u.rw.id = i+1;
- info->shadow[ring_size-1].req.u.rw.id = 0x0fffffff;
+ info->shadow[BLK_RING_SIZE-1].req.u.rw.id = 0x0fffffff;
/* Front end dir is a number, which is used as the id. */
info->handle = simple_strtoul(strrchr(dev->nodename, '/')+1, NULL, 0);
@@ -1099,9 +1048,6 @@ static int blkfront_probe(struct xenbus_device *dev,
return err;
}
@@ -1112,7 +1058,6 @@ static int blkif_recover(struct blkfront_info *info)
struct blkif_request *req;
struct blk_shadow *copy;
int j;
- int ring_size = __RING_SIZE((struct blkif_sring *)0, info->num_ring_pages * PAGE_SIZE);
/* Stage 1: Make a safe copy of the shadow state. */
copy = kmalloc(sizeof(info->shadow),
@@ -1123,13 +1068,13 @@ static int blkif_recover(struct blkfront_info *info)
/* Stage 2: Set up free list. */
memset(&info->shadow, 0, sizeof(info->shadow));
- for (i = 0; i < ring_size; i++)
+ for (i = 0; i < BLK_RING_SIZE; i++)
info->shadow[i].req.u.rw.id = i+1;
info->shadow_free = info->ring.req_prod_pvt;
- info->shadow[ring_size-1].req.u.rw.id = 0x0fffffff;
+ info->shadow[BLK_RING_SIZE-1].req.u.rw.id = 0x0fffffff;
/* Stage 3: Find pending requests and requeue them. */
- for (i = 0; i < ring_size; i++) {
+ for (i = 0; i < BLK_RING_SIZE; i++) {
/* Not in use? */
if (!copy[i].request)
continue;
@@ -1600,4 +1545,3 @@ MODULE_LICENSE("GPL");
MODULE_ALIAS_BLOCKDEV_MAJOR(XENVBD_MAJOR);
MODULE_ALIAS("xen:vbd");
MODULE_ALIAS("xenblk");
-
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h
index 31063bd..ee338bf 100644
--- a/include/xen/interface/io/blkif.h
+++ b/include/xen/interface/io/blkif.h
@@ -168,18 +168,6 @@ struct blkif_response {
-/*
- * Maximum number of pages used for a blkif ring
- * max-ring-pages advertised by blkback to blkfront may be lowered at blkback
- * mod load time. Load time param set to default.
- */
-#define BLKIF_MAX_NUM_RING_PAGES 16
-#define BLKIF_MAX_NUM_RING_PAGES_DFLT 4
-#if BLKIF_MAX_NUM_RING_PAGES < BLKIF_MAX_NUM_RING_PAGES_DFLT
-#undef BLKIF_MAX_NUM_RING_PAGES_DFLT
-#define BLKIF_MAX_NUM_RING_PAGES_DFLT BLKIF_MAX_NUM_RING_PAGES
-#endif
-
#define VDISK_CDROM 0x1
#define VDISK_REMOVABLE 0x2
#define VDISK_READONLY 0x4
--
1.7.9.5
--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team