diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-11-21 10:16:58 +0000 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-11-21 10:16:58 +0000 |
commit | 8bedf46beb28d6f2e87e69c3cc7e25b843881225 (patch) | |
tree | d6a8a4e154b0d9f3ecd19d5d7c9bcf9cd7da95de /linux-2.6-xen-sparse | |
parent | 1dea421011a6e09ea211b1c6cdec2360ae561778 (diff) | |
download | xen-8bedf46beb28d6f2e87e69c3cc7e25b843881225.tar.gz xen-8bedf46beb28d6f2e87e69c3cc7e25b843881225.tar.bz2 xen-8bedf46beb28d6f2e87e69c3cc7e25b843881225.zip |
[BLK] Handle block devices with more than 2^32 sectors.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'linux-2.6-xen-sparse')
4 files changed, 6 insertions, 5 deletions
diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/common.h b/linux-2.6-xen-sparse/drivers/xen/blkback/common.h index d55e388107..1b5b6a427e 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/common.h +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/common.h @@ -113,7 +113,7 @@ int vbd_create(blkif_t *blkif, blkif_vdev_t vdevice, unsigned major, unsigned minor, int readonly); void vbd_free(struct vbd *vbd); -unsigned long vbd_size(struct vbd *vbd); +unsigned long long vbd_size(struct vbd *vbd); unsigned int vbd_info(struct vbd *vbd); unsigned long vbd_secsize(struct vbd *vbd); diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c b/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c index 0abd23a521..34048b32c4 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c @@ -35,7 +35,7 @@ #define vbd_sz(_v) ((_v)->bdev->bd_part ? \ (_v)->bdev->bd_part->nr_sects : (_v)->bdev->bd_disk->capacity) -unsigned long vbd_size(struct vbd *vbd) +unsigned long long vbd_size(struct vbd *vbd) { return vbd_sz(vbd); } diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c index 4d23434b71..349ae64d0f 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c @@ -389,7 +389,7 @@ again: if (err) goto abort; - err = xenbus_printf(xbt, dev->nodename, "sectors", "%lu", + err = xenbus_printf(xbt, dev->nodename, "sectors", "%llu", vbd_size(&be->blkif->vbd)); if (err) { xenbus_dev_fatal(dev, err, "writing %s/sectors", diff --git a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c index 557288b45a..019e1cca25 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c @@ -298,7 +298,8 @@ static void backend_changed(struct xenbus_device *dev, */ static void connect(struct blkfront_info *info) { - unsigned long sectors, sector_size; + unsigned long long sectors; + unsigned long sector_size; unsigned int binfo; int err; @@ -309,7 +310,7 @@ static void connect(struct blkfront_info *info) DPRINTK("blkfront.c:connect:%s.\n", info->xbdev->otherend); err = xenbus_gather(XBT_NIL, info->xbdev->otherend, - "sectors", "%lu", §ors, + "sectors", "%llu", §ors, "info", "%u", &binfo, "sector-size", "%lu", §or_size, NULL); |