ia64/xen-unstable
changeset 515:0b00a7979a36
bitkeeper revision 1.282 (3f093fcaCmzVi3ORQ1OWHhWEtzbamA)
Make sure we try the physical partition table if we can't find
any partitions with the hypervisor.
Make sure we try the physical partition table if we can't find
any partitions with the hypervisor.
author | sos22@labyrinth.cl.cam.ac.uk |
---|---|
date | Mon Jul 07 09:39:22 2003 +0000 (2003-07-07) |
parents | 4cd6bdc089bb |
children | f8d8a9307804 |
files | xenolinux-2.4.21-sparse/fs/partitions/xeno.c |
line diff
1.1 --- a/xenolinux-2.4.21-sparse/fs/partitions/xeno.c Mon Jul 07 09:31:18 2003 +0000 1.2 +++ b/xenolinux-2.4.21-sparse/fs/partitions/xeno.c Mon Jul 07 09:39:22 2003 +0000 1.3 @@ -18,6 +18,7 @@ int xeno_partition(struct gendisk *hd, 1.4 physdisk_probebuf_t *buf; 1.5 int i; 1.6 int minor; 1.7 + int count; 1.8 1.9 buf = kmalloc(sizeof(*buf), GFP_KERNEL); 1.10 if (!buf) 1.11 @@ -39,6 +40,8 @@ int xeno_partition(struct gendisk *hd, 1.12 return 0; 1.13 } 1.14 1.15 + count = 0; 1.16 + 1.17 for (i = 0; i < buf->n_aces; i++) { 1.18 if ((buf->entries[i].device & 0x1f) == 0) 1.19 continue; 1.20 @@ -50,13 +53,20 @@ int xeno_partition(struct gendisk *hd, 1.21 /* This is a bit of a hack - the partition numbers are specified 1.22 by the hypervisor, and if we want them to match up, this is 1.23 what we need to do. */ 1.24 + count ++; 1.25 minor = (buf->entries[i].device & 0x1f) + first_part_minor - 1; 1.26 add_gd_partition(hd, 1.27 minor, 1.28 buf->entries[i].start_sect, 1.29 buf->entries[i].n_sectors); 1.30 - } 1.31 + } 1.32 kfree(buf); 1.33 + 1.34 + /* If we didn't find any suitable Xeno partitions, try the other 1.35 + types. */ 1.36 + if (!count) 1.37 + return 0; 1.38 + 1.39 printk("\n"); 1.40 return 1; 1.41 }