| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: disksubr.c,v 1.62 2014/09/21 15:43:11 christos Exp $ */ | | 1 | /* $NetBSD: disksubr.c,v 1.63 2015/07/04 06:13:01 maxv Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1982, 1986, 1988 Regents of the University of California. | | 4 | * Copyright (c) 1982, 1986, 1988 Regents of the University of California. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -56,27 +56,27 @@ | | | @@ -56,27 +56,27 @@ |
56 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 56 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
57 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 57 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
58 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 58 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
59 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 59 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
60 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 60 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
61 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 61 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
62 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 62 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
63 | * SUCH DAMAGE. | | 63 | * SUCH DAMAGE. |
64 | * | | 64 | * |
65 | * @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91 | | 65 | * @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91 |
66 | */ | | 66 | */ |
67 | | | 67 | |
68 | #include <sys/cdefs.h> | | 68 | #include <sys/cdefs.h> |
69 | __KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.62 2014/09/21 15:43:11 christos Exp $"); | | 69 | __KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.63 2015/07/04 06:13:01 maxv Exp $"); |
70 | | | 70 | |
71 | #include <sys/param.h> | | 71 | #include <sys/param.h> |
72 | #include <sys/systm.h> | | 72 | #include <sys/systm.h> |
73 | #include <sys/buf.h> | | 73 | #include <sys/buf.h> |
74 | #include <sys/disklabel.h> | | 74 | #include <sys/disklabel.h> |
75 | #include <sys/disk.h> | | 75 | #include <sys/disk.h> |
76 | | | 76 | |
77 | /* | | 77 | /* |
78 | * In /usr/src/sys/dev/scsipi/sd.c, routine sdstart() adjusts the | | 78 | * In /usr/src/sys/dev/scsipi/sd.c, routine sdstart() adjusts the |
79 | * block numbers, it changes from DEV_BSIZE units to physical units: | | 79 | * block numbers, it changes from DEV_BSIZE units to physical units: |
80 | * blkno = bp->b_blkno / (lp->d_secsize / DEV_BSIZE); | | 80 | * blkno = bp->b_blkno / (lp->d_secsize / DEV_BSIZE); |
81 | * As long as media with sector sizes of 512 bytes are used, this | | 81 | * As long as media with sector sizes of 512 bytes are used, this |
82 | * doesn't matter (divide by 1), but for successful usage of media with | | 82 | * doesn't matter (divide by 1), but for successful usage of media with |
| @@ -321,27 +321,26 @@ readdisklabel(dev_t dev, void (*strat)(s | | | @@ -321,27 +321,26 @@ readdisklabel(dev_t dev, void (*strat)(s |
321 | } | | 321 | } |
322 | if (rdbchksum(pbp)) { | | 322 | if (rdbchksum(pbp)) { |
323 | msg = "partition block bad checksum"; | | 323 | msg = "partition block bad checksum"; |
324 | goto done; | | 324 | goto done; |
325 | } | | 325 | } |
326 | | | 326 | |
327 | if (pbp->e.tabsize < 11) { | | 327 | if (pbp->e.tabsize < 11) { |
328 | /* | | 328 | /* |
329 | * not enough info, too funky for us. | | 329 | * not enough info, too funky for us. |
330 | * I don't want to skip I want it fixed. | | 330 | * I don't want to skip I want it fixed. |
331 | */ | | 331 | */ |
332 | msg = "bad partition info (environ < 11)"; | | 332 | msg = "bad partition info (environ < 11)"; |
333 | goto done; | | 333 | goto done; |
334 | continue; | | | |
335 | } | | 334 | } |
336 | | | 335 | |
337 | /* | | 336 | /* |
338 | * XXXX should be ">" however some vendors don't know | | 337 | * XXXX should be ">" however some vendors don't know |
339 | * what a table size is so, we hack for them. | | 338 | * what a table size is so, we hack for them. |
340 | * the other checks can fail for all I care but this | | 339 | * the other checks can fail for all I care but this |
341 | * is a very common value. *sigh*. | | 340 | * is a very common value. *sigh*. |
342 | */ | | 341 | */ |
343 | if (pbp->e.tabsize >= 16) | | 342 | if (pbp->e.tabsize >= 16) |
344 | adt = getadostype(pbp->e.dostype); | | 343 | adt = getadostype(pbp->e.dostype); |
345 | else { | | 344 | else { |
346 | adt.archtype = ADT_UNKNOWN; | | 345 | adt.archtype = ADT_UNKNOWN; |
347 | adt.fstype = FS_UNUSED; | | 346 | adt.fstype = FS_UNUSED; |