Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev eliminate dk_geom
details: https://anonhg.NetBSD.org/src/rev/403d92124027
branches: trunk
changeset: 787029:403d92124027
user: christos <christos%NetBSD.org@localhost>
date: Wed May 29 23:25:55 2013 +0000
description:
eliminate dk_geom
diffstat:
sys/dev/dksubr.c | 39 +++++++++++----------------------------
sys/dev/dkvar.h | 14 +-------------
2 files changed, 12 insertions(+), 41 deletions(-)
diffs (121 lines):
diff -r bc0130e670cf -r 403d92124027 sys/dev/dksubr.c
--- a/sys/dev/dksubr.c Wed May 29 23:25:39 2013 +0000
+++ b/sys/dev/dksubr.c Wed May 29 23:25:55 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.46 2013/05/29 00:47:48 christos Exp $ */
+/* $NetBSD: dksubr.c,v 1.47 2013/05/29 23:25:55 christos Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 1999, 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.46 2013/05/29 00:47:48 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.47 2013/05/29 23:25:55 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -340,12 +340,12 @@
switch (cmd) {
#ifdef DIOCGSECTORSIZE
case DIOCGSECTORSIZE:
- *(u_int *)data = dksc->sc_geom.pdg_secsize;
+ *(u_int *)data = dksc->sc_dkdev.dk_geom.dg_secsize;
return 0;
case DIOCGMEDIASIZE:
*(off_t *)data =
- (off_t)dksc->sc_geom.pdg_secsize *
- dksc->sc_geom.pdg_nsectors;
+ (off_t)dksc->sc_dkdev.dk_geom.dg_secsize *
+ dksc->sc_dkdev.dk_geom.dg_nsectors;
return 0;
#endif
@@ -548,15 +548,15 @@
dk_getdefaultlabel(struct dk_intf *di, struct dk_softc *dksc,
struct disklabel *lp)
{
- struct dk_geom *pdg = &dksc->sc_geom;
+ struct disk_geom *dg = &dksc->sc_dkdev.dk_geom;
memset(lp, 0, sizeof(*lp));
- lp->d_secperunit = dksc->sc_size;
- lp->d_secsize = pdg->pdg_secsize;
- lp->d_nsectors = pdg->pdg_nsectors;
- lp->d_ntracks = pdg->pdg_ntracks;
- lp->d_ncylinders = pdg->pdg_ncylinders;
+ lp->d_secperunit = dg->dg_secperunit;
+ lp->d_secsize = dg->dg_secsize;
+ lp->d_nsectors = dg->dg_nsectors;
+ lp->d_ntracks = dg->dg_ntracks;
+ lp->d_ncylinders = dg->dg_ncylinders;
lp->d_secpercyl = lp->d_ntracks * lp->d_nsectors;
strncpy(lp->d_typename, di->di_dkname, sizeof(lp->d_typename));
@@ -626,23 +626,6 @@
lp->d_checksum = dkcksum(lp);
}
-void
-dk_set_geometry(struct dk_intf *di, struct dk_softc *dksc)
-{
- struct disk_geom *dg = &dksc->sc_dkdev.dk_geom;
-
- memset(dg, 0, sizeof(*dg));
-
- dg->dg_secperunit = dksc->sc_size;
- dg->dg_secsize = dksc->sc_geom.pdg_secsize;
- dg->dg_nsectors = dksc->sc_geom.pdg_nsectors;
- dg->dg_ntracks = dksc->sc_geom.pdg_ntracks;
- dg->dg_ncylinders = dksc->sc_geom.pdg_ncylinders;
-
- disk_set_info(dksc->sc_dev, &dksc->sc_dkdev, NULL);
-
-}
-
/* This function is taken from ccd.c:1.76 --rcd */
/*
diff -r bc0130e670cf -r 403d92124027 sys/dev/dkvar.h
--- a/sys/dev/dkvar.h Wed May 29 23:25:39 2013 +0000
+++ b/sys/dev/dkvar.h Wed May 29 23:25:55 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dkvar.h,v 1.17 2013/05/29 00:47:48 christos Exp $ */
+/* $NetBSD: dkvar.h,v 1.18 2013/05/29 23:25:55 christos Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -32,14 +32,6 @@
struct pathbuf; /* from namei.h */
-/* XXX: GC */
-struct dk_geom {
- u_int32_t pdg_secsize;
- u_int32_t pdg_nsectors;
- u_int32_t pdg_ntracks;
- u_int32_t pdg_ncylinders;
-};
-
/* literally this is not a softc, but is intended to be included in
* the pseudo-disk's softc and passed to calls in dksubr.c. It
* should include the common elements of the pseudo-disk's softc.
@@ -50,8 +42,6 @@
struct dk_softc {
device_t sc_dev;
u_int32_t sc_flags; /* flags */
- size_t sc_size; /* size of disk */
- struct dk_geom sc_geom; /* geometry info */
#define DK_XNAME_SIZE 8
char sc_xname[DK_XNAME_SIZE]; /* external name */
struct disk sc_dkdev; /* generic disk info */
@@ -113,7 +103,5 @@
void dk_getdisklabel(struct dk_intf *, struct dk_softc *, dev_t);
void dk_getdefaultlabel(struct dk_intf *, struct dk_softc *,
struct disklabel *);
-/* XXX: GC use disk_set_info() */
-void dk_set_geometry(struct dk_intf *, struct dk_softc *);
int dk_lookup(struct pathbuf *, struct lwp *, struct vnode **);
Home |
Main Index |
Thread Index |
Old Index