Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Always fixup zero sector size, even when other geom...
details: https://anonhg.NetBSD.org/src/rev/bf88d95fdf2f
branches: trunk
changeset: 337979:bf88d95fdf2f
user: mlelstv <mlelstv%NetBSD.org@localhost>
date: Tue May 05 22:09:24 2015 +0000
description:
Always fixup zero sector size, even when other geometry values are invalid.
diffstat:
sys/kern/subr_disk.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diffs (52 lines):
diff -r 1b027a3daa11 -r bf88d95fdf2f sys/kern/subr_disk.c
--- a/sys/kern/subr_disk.c Tue May 05 21:52:10 2015 +0000
+++ b/sys/kern/subr_disk.c Tue May 05 22:09:24 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_disk.c,v 1.111 2015/01/02 01:14:22 christos Exp $ */
+/* $NetBSD: subr_disk.c,v 1.112 2015/05/05 22:09:24 mlelstv Exp $ */
/*-
* Copyright (c) 1996, 1997, 1999, 2000, 2009 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.111 2015/01/02 01:14:22 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.112 2015/05/05 22:09:24 mlelstv Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -564,6 +564,16 @@
{
struct disk_geom *dg = &dk->dk_geom;
+ if (dg->dg_secsize == 0) {
+#ifdef DIAGNOSTIC
+ printf("%s: fixing 0 sector size\n", dk->dk_name);
+#endif
+ dg->dg_secsize = DEV_BSIZE;
+ }
+
+ dk->dk_blkshift = DK_BSIZE2BLKSHIFT(dg->dg_secsize);
+ dk->dk_byteshift = DK_BSIZE2BYTESHIFT(dg->dg_secsize);
+
if (dg->dg_secperunit == 0 && dg->dg_ncylinders == 0) {
#ifdef DIAGNOSTIC
printf("%s: secperunit and ncylinders are zero\n", dk->dk_name);
@@ -589,16 +599,6 @@
(dg->dg_ntracks * dg->dg_nsectors);
}
- if (dg->dg_secsize == 0) {
-#ifdef DIAGNOSTIC
- printf("%s: fixing 0 sector size\n", dk->dk_name);
-#endif
- dg->dg_secsize = DEV_BSIZE;
- }
-
- dk->dk_blkshift = DK_BSIZE2BLKSHIFT(dg->dg_secsize);
- dk->dk_byteshift = DK_BSIZE2BYTESHIFT(dg->dg_secsize);
-
prop_dictionary_t disk_info, odisk_info, geom;
disk_info = prop_dictionary_create();
Home |
Main Index |
Thread Index |
Old Index