ia64/xen-unstable

changeset 2112:b142982228ea

bitkeeper revision 1.1159.1.5 (4113a9f3PDFYg7EjovC2RDHcOb74rA)

2.6 block device backend fix -- we weren't allowing whole disks to be exported.
author iap10@tetris.cl.cam.ac.uk
date Fri Aug 06 15:55:31 2004 +0000 (2004-08-06)
parents bd1640d9d7d4
children 1b4dbe8d9172 b9edbe5d4952
files linux-2.6.7-xen-sparse/drivers/xen/blkback/vbd.c
line diff
     1.1 --- a/linux-2.6.7-xen-sparse/drivers/xen/blkback/vbd.c	Fri Aug 06 15:01:04 2004 +0000
     1.2 +++ b/linux-2.6.7-xen-sparse/drivers/xen/blkback/vbd.c	Fri Aug 06 15:55:31 2004 +0000
     1.3 @@ -145,16 +145,20 @@ void vbd_grow(blkif_be_vbd_grow_t *grow)
     1.4      }
     1.5      /* XXXcl maybe bd_claim? */
     1.6  
     1.7 -    if ( (x->bdev->bd_disk == NULL) || (x->bdev->bd_part == NULL) )
     1.8 +    if ( (x->bdev->bd_disk == NULL) )
     1.9      {
    1.10          DPRINTK("vbd_grow: device %08x doesn't exist.\n", x->extent.device);
    1.11          grow->status = BLKIF_BE_STATUS_EXTENT_NOT_FOUND;
    1.12          blkdev_put(x->bdev);
    1.13          goto out;
    1.14      }
    1.15 -   
    1.16 -    /* get size in sectors */
    1.17 -    sz = x->bdev->bd_part->nr_sects;
    1.18 +
    1.19 +    /* get size in sectors */   
    1.20 +    if ( x->bdev->bd_part )
    1.21 +	 sz = x->bdev->bd_part->nr_sects;
    1.22 +    else
    1.23 +	 sz = x->bdev->bd_disk->capacity;
    1.24 +
    1.25  #else
    1.26      if( !blk_size[MAJOR(x->extent.device)] )
    1.27      {