[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [BLK] Handle block devices with more than 2^32 sectors.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID 0c0ef61de06b523fa44f67d97de01def87306e1d
# Parent  82ba3c086e6ca02b4c24f0a0171bd34e1bcc612a
[BLK] Handle block devices with more than 2^32 sectors.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/drivers/xen/blkback/common.h    |    2 +-
 linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c       |    2 +-
 linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c    |    2 +-
 linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c |    5 +++--
 4 files changed, 6 insertions(+), 5 deletions(-)

diff -r 82ba3c086e6c -r 0c0ef61de06b 
linux-2.6-xen-sparse/drivers/xen/blkback/common.h
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/common.h Tue Nov 21 09:26:43 
2006 +0000
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/common.h Tue Nov 21 10:16:58 
2006 +0000
@@ -113,7 +113,7 @@ int vbd_create(blkif_t *blkif, blkif_vde
               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 -r 82ba3c086e6c -r 0c0ef61de06b 
linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c    Tue Nov 21 09:26:43 
2006 +0000
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c    Tue Nov 21 10:16:58 
2006 +0000
@@ -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 -r 82ba3c086e6c -r 0c0ef61de06b 
linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c Tue Nov 21 09:26:43 
2006 +0000
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c Tue Nov 21 10:16:58 
2006 +0000
@@ -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 -r 82ba3c086e6c -r 0c0ef61de06b 
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c      Tue Nov 21 
09:26:43 2006 +0000
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c      Tue Nov 21 
10:16:58 2006 +0000
@@ -298,7 +298,8 @@ static void backend_changed(struct xenbu
  */
 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
        DPRINTK("blkfront.c:connect:%s.\n", info->xbdev->otherend);
 
        err = xenbus_gather(XBT_NIL, info->xbdev->otherend,
-                           "sectors", "%lu", &sectors,
+                           "sectors", "%llu", &sectors,
                            "info", "%u", &binfo,
                            "sector-size", "%lu", &sector_size,
                            NULL);

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.