Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Notify disk subsystem of the current geometry.
details: https://anonhg.NetBSD.org/src/rev/b6c2b15f73d4
branches: trunk
changeset: 342671:b6c2b15f73d4
user: hannken <hannken%NetBSD.org@localhost>
date: Mon Jan 04 16:24:52 2016 +0000
description:
Notify disk subsystem of the current geometry.
Ok: Michael van Elst
diffstat:
sys/dev/md.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diffs (43 lines):
diff -r 85832dc8c8b9 -r b6c2b15f73d4 sys/dev/md.c
--- a/sys/dev/md.c Mon Jan 04 14:10:15 2016 +0000
+++ b/sys/dev/md.c Mon Jan 04 16:24:52 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.75 2015/08/20 14:40:17 christos Exp $ */
+/* $NetBSD: md.c,v 1.76 2016/01/04 16:24:52 hannken Exp $ */
/*
* Copyright (c) 1995 Gordon W. Ross, Leo Weppelman.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: md.c,v 1.75 2015/08/20 14:40:17 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: md.c,v 1.76 2016/01/04 16:24:52 hannken Exp $");
#ifdef _KERNEL_OPT
#include "opt_md.h"
@@ -528,6 +528,7 @@
static void
md_set_disklabel(struct md_softc *sc)
{
+ struct disk_geom *dg = &sc->sc_dkdev.dk_geom;
struct disklabel *lp = sc->sc_dkdev.dk_label;
struct partition *pp;
@@ -567,6 +568,16 @@
lp->d_magic = DISKMAGIC;
lp->d_magic2 = DISKMAGIC;
lp->d_checksum = dkcksum(lp);
+
+ memset(dg, 0, sizeof(*dg));
+
+ dg->dg_secsize = lp->d_secsize;
+ dg->dg_secperunit = lp->d_secperunit;
+ dg->dg_nsectors = lp->d_nsectors;
+ dg->dg_ntracks = lp->d_ntracks = 64;;
+ dg->dg_ncylinders = lp->d_ncylinders;
+
+ disk_set_info(sc->sc_dev, &sc->sc_dkdev, NULL);
}
/*
Home |
Main Index |
Thread Index |
Old Index