direct-io.hg

changeset 12496:0c0ef61de06b

[BLK] Handle block devices with more than 2^32 sectors.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Tue Nov 21 10:16:58 2006 +0000 (2006-11-21)
parents 82ba3c086e6c
children bc14f1e1961a
files linux-2.6-xen-sparse/drivers/xen/blkback/common.h linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/common.h	Tue Nov 21 09:26:43 2006 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/common.h	Tue Nov 21 10:16:58 2006 +0000
     1.3 @@ -113,7 +113,7 @@ int vbd_create(blkif_t *blkif, blkif_vde
     1.4  	       unsigned minor, int readonly);
     1.5  void vbd_free(struct vbd *vbd);
     1.6  
     1.7 -unsigned long vbd_size(struct vbd *vbd);
     1.8 +unsigned long long vbd_size(struct vbd *vbd);
     1.9  unsigned int vbd_info(struct vbd *vbd);
    1.10  unsigned long vbd_secsize(struct vbd *vbd);
    1.11  
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c	Tue Nov 21 09:26:43 2006 +0000
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c	Tue Nov 21 10:16:58 2006 +0000
     2.3 @@ -35,7 +35,7 @@
     2.4  #define vbd_sz(_v)   ((_v)->bdev->bd_part ?				\
     2.5  	(_v)->bdev->bd_part->nr_sects : (_v)->bdev->bd_disk->capacity)
     2.6  
     2.7 -unsigned long vbd_size(struct vbd *vbd)
     2.8 +unsigned long long vbd_size(struct vbd *vbd)
     2.9  {
    2.10  	return vbd_sz(vbd);
    2.11  }
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c	Tue Nov 21 09:26:43 2006 +0000
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c	Tue Nov 21 10:16:58 2006 +0000
     3.3 @@ -389,7 +389,7 @@ again:
     3.4  	if (err)
     3.5  		goto abort;
     3.6  
     3.7 -	err = xenbus_printf(xbt, dev->nodename, "sectors", "%lu",
     3.8 +	err = xenbus_printf(xbt, dev->nodename, "sectors", "%llu",
     3.9  			    vbd_size(&be->blkif->vbd));
    3.10  	if (err) {
    3.11  		xenbus_dev_fatal(dev, err, "writing %s/sectors",
     4.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Tue Nov 21 09:26:43 2006 +0000
     4.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Tue Nov 21 10:16:58 2006 +0000
     4.3 @@ -298,7 +298,8 @@ static void backend_changed(struct xenbu
     4.4   */
     4.5  static void connect(struct blkfront_info *info)
     4.6  {
     4.7 -	unsigned long sectors, sector_size;
     4.8 +	unsigned long long sectors;
     4.9 +	unsigned long sector_size;
    4.10  	unsigned int binfo;
    4.11  	int err;
    4.12  
    4.13 @@ -309,7 +310,7 @@ static void connect(struct blkfront_info
    4.14  	DPRINTK("blkfront.c:connect:%s.\n", info->xbdev->otherend);
    4.15  
    4.16  	err = xenbus_gather(XBT_NIL, info->xbdev->otherend,
    4.17 -			    "sectors", "%lu", &sectors,
    4.18 +			    "sectors", "%llu", &sectors,
    4.19  			    "info", "%u", &binfo,
    4.20  			    "sector-size", "%lu", &sector_size,
    4.21  			    NULL);