summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-08-08 06:49:07 +0000
committerphk <phk@FreeBSD.org>2004-08-08 06:49:07 +0000
commit8a11f1b4a6e444c06beac9b61cd820cf6b82516f (patch)
tree93b8d93d433b81dc0f847a70e6344dafaeccf6d8 /sys/geom
parentcb84366718580d5c3c1cdea1706a0c06eea5d876 (diff)
downloadFreeBSD-src-8a11f1b4a6e444c06beac9b61cd820cf6b82516f.zip
FreeBSD-src-8a11f1b4a6e444c06beac9b61cd820cf6b82516f.tar.gz
Use default method initialization on geoms.
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/bde/g_bde.c8
-rw-r--r--sys/geom/geom_aes.c8
-rw-r--r--sys/geom/geom_apple.c2
-rw-r--r--sys/geom/geom_bsd.c9
-rw-r--r--sys/geom/geom_ccd.c6
-rw-r--r--sys/geom/geom_dev.c2
-rw-r--r--sys/geom/geom_disk.c11
-rw-r--r--sys/geom/geom_fox.c8
-rw-r--r--sys/geom/geom_gpt.c2
-rw-r--r--sys/geom/geom_mbr.c6
-rw-r--r--sys/geom/geom_pc98.c4
-rw-r--r--sys/geom/geom_sunlabel.c2
12 files changed, 33 insertions, 35 deletions
diff --git a/sys/geom/bde/g_bde.c b/sys/geom/bde/g_bde.c
index 84a7b8b..73d85ab 100644
--- a/sys/geom/bde/g_bde.c
+++ b/sys/geom/bde/g_bde.c
@@ -130,10 +130,6 @@ g_bde_create_geom(struct gctl_req *req, struct g_class *mp, struct g_provider *p
gp = g_new_geomf(mp, "%s.bde", pp->name);
- gp->start = g_bde_start;
- gp->orphan = g_bde_orphan;
- gp->access = g_bde_access;
- gp->spoiled = g_std_spoiled;
cp = g_new_consumer(gp);
g_attach(cp, pp);
error = g_access(cp, 1, 1, 1);
@@ -278,6 +274,10 @@ static struct g_class g_bde_class = {
.name = BDE_CLASS_NAME,
.destroy_geom = g_bde_destroy_geom,
.ctlreq = g_bde_ctlreq,
+ .start = g_bde_start,
+ .orphan = g_bde_orphan,
+ .access = g_bde_access,
+ .spoiled = g_std_spoiled,
};
DECLARE_GEOM_CLASS(g_bde_class, g_bde);
diff --git a/sys/geom/geom_aes.c b/sys/geom/geom_aes.c
index 1ac425a..ea0ce52 100644
--- a/sys/geom/geom_aes.c
+++ b/sys/geom/geom_aes.c
@@ -283,9 +283,6 @@ g_aes_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
g_trace(G_T_TOPOLOGY, "aes_taste(%s,%s)", mp->name, pp->name);
g_topology_assert();
gp = g_new_geomf(mp, "%s.aes", pp->name);
- gp->start = g_aes_start;
- gp->orphan = g_aes_orphan;
- gp->spoiled = g_std_spoiled;
cp = g_new_consumer(gp);
g_attach(cp, pp);
error = g_access(cp, 1, 0, 0);
@@ -321,7 +318,6 @@ g_aes_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
}
g_free(buf);
gp->softc = sc;
- gp->access = g_aes_access;
sc->sectorsize = sectorsize;
sc->mediasize = mediasize - sectorsize;
rijndael_cipherInit(&sc->ci, MODE_CBC, NULL);
@@ -369,6 +365,10 @@ g_aes_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
static struct g_class g_aes_class = {
.name = AES_CLASS_NAME,
.taste = g_aes_taste,
+ .start = g_aes_start,
+ .orphan = g_aes_orphan,
+ .spoiled = g_std_spoiled,
+ .access = g_aes_access,
};
DECLARE_GEOM_CLASS(g_aes_class, g_aes);
diff --git a/sys/geom/geom_apple.c b/sys/geom/geom_apple.c
index a1e8bc2..1b43633 100644
--- a/sys/geom/geom_apple.c
+++ b/sys/geom/geom_apple.c
@@ -157,7 +157,6 @@ g_apple_taste(struct g_class *mp, struct g_provider *pp, int insist)
if (gp == NULL)
return (NULL);
g_topology_unlock();
- gp->dumpconf = g_apple_dumpconf;
do {
if (gp->rank != 2 && insist == 0)
break;
@@ -257,6 +256,7 @@ g_apple_taste(struct g_class *mp, struct g_provider *pp, int insist)
static struct g_class g_apple_class = {
.name = APPLE_CLASS_NAME,
.taste = g_apple_taste,
+ .dumpconf = g_apple_dumpconf,
};
DECLARE_GEOM_CLASS(g_apple_class, g_apple);
diff --git a/sys/geom/geom_bsd.c b/sys/geom/geom_bsd.c
index bbf4022..66cff5c 100644
--- a/sys/geom/geom_bsd.c
+++ b/sys/geom/geom_bsd.c
@@ -490,13 +490,6 @@ g_bsd_taste(struct g_class *mp, struct g_provider *pp, int flags)
if (gp == NULL)
return (NULL);
- /*
- * Fill in the optional details, in our case we have a dumpconf
- * routine which the "slice" code should call at the right time
- */
- gp->dumpconf = g_bsd_dumpconf;
- gp->ioctl = g_bsd_ioctl;
-
/* Get the geom_slicer softc from the geom. */
gsp = gp->softc;
@@ -671,6 +664,8 @@ static struct g_class g_bsd_class = {
.name = BSD_CLASS_NAME,
.taste = g_bsd_taste,
.ctlreq = g_bsd_config,
+ .dumpconf = g_bsd_dumpconf,
+ .ioctl = g_bsd_ioctl,
};
DECLARE_GEOM_CLASS(g_bsd_class, g_bsd);
diff --git a/sys/geom/geom_ccd.c b/sys/geom/geom_ccd.c
index 7ec3d2e..586fd74 100644
--- a/sys/geom/geom_ccd.c
+++ b/sys/geom/geom_ccd.c
@@ -718,9 +718,6 @@ g_ccd_create(struct gctl_req *req, struct g_class *mp)
}
gp = g_new_geomf(mp, "ccd%d", *unit);
- gp->start = g_ccd_start;
- gp->orphan = g_ccd_orphan;
- gp->access = g_ccd_access;
sc = g_malloc(sizeof *sc, M_WAITOK | M_ZERO);
gp->softc = sc;
sc->sc_ndisks = *nprovider;
@@ -863,6 +860,9 @@ static struct g_class g_ccd_class = {
.name = "CCD",
.ctlreq = g_ccd_config,
.destroy_geom = g_ccd_destroy_geom,
+ .start = g_ccd_start,
+ .orphan = g_ccd_orphan,
+ .access = g_ccd_access,
};
DECLARE_GEOM_CLASS(g_ccd_class, g_ccd);
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c
index baaf191..9cd9e81 100644
--- a/sys/geom/geom_dev.c
+++ b/sys/geom/geom_dev.c
@@ -77,6 +77,7 @@ static g_orphan_t g_dev_orphan;
static struct g_class g_dev_class = {
.name = "DEV",
.taste = g_dev_taste,
+ .orphan = g_dev_orphan,
};
void
@@ -121,7 +122,6 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, int insist __unused)
if (cp->geom->class == mp)
return (NULL);
gp = g_new_geomf(mp, pp->name);
- gp->orphan = g_dev_orphan;
cp = g_new_consumer(gp);
error = g_attach(cp, pp);
KASSERT(error == 0,
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index 6b83173..eed2bda 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -61,11 +61,18 @@ static struct mtx g_disk_done_mtx;
static g_access_t g_disk_access;
static g_init_t g_disk_init;
static g_fini_t g_disk_fini;
+static g_start_t g_disk_start;
+static g_ioctl_t g_disk_ioctl;
+static g_dumpconf_t g_disk_dumpconf;
struct g_class g_disk_class = {
.name = "DISK",
.init = g_disk_init,
.fini = g_disk_fini,
+ .start = g_disk_start,
+ .access = g_disk_access,
+ .ioctl = g_disk_ioctl,
+ .dumpconf = g_disk_dumpconf,
};
static void
@@ -334,11 +341,7 @@ g_disk_create(void *arg, int flag)
g_topology_assert();
dp = arg;
gp = g_new_geomf(&g_disk_class, "%s%d", dp->d_name, dp->d_unit);
- gp->start = g_disk_start;
- gp->access = g_disk_access;
- gp->ioctl = g_disk_ioctl;
gp->softc = dp;
- gp->dumpconf = g_disk_dumpconf;
pp = g_new_providerf(gp, "%s", gp->name);
pp->mediasize = dp->d_mediasize;
pp->sectorsize = dp->d_sectorsize;
diff --git a/sys/geom/geom_fox.c b/sys/geom/geom_fox.c
index d546fc3..f112d86 100644
--- a/sys/geom/geom_fox.c
+++ b/sys/geom/geom_fox.c
@@ -357,10 +357,6 @@ g_fox_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
gp->softc = g_malloc(sizeof(struct g_fox_softc), M_WAITOK | M_ZERO);
sc = gp->softc;
- gp->start = g_fox_start;
- gp->spoiled = g_fox_orphan;
- gp->orphan = g_fox_orphan;
- gp->access= g_fox_access;
cp = g_new_consumer(gp);
g_attach(cp, pp);
error = g_access(cp, 1, 0, 0);
@@ -466,6 +462,10 @@ static struct g_class g_fox_class = {
.name = FOX_CLASS_NAME,
.taste = g_fox_taste,
.destroy_geom = g_fox_destroy_geom,
+ .start = g_fox_start,
+ .spoiled = g_fox_orphan,
+ .orphan = g_fox_orphan,
+ .access= g_fox_access,
};
DECLARE_GEOM_CLASS(g_fox_class, g_fox);
diff --git a/sys/geom/geom_gpt.c b/sys/geom/geom_gpt.c
index 54ffb1e..0a75e9e 100644
--- a/sys/geom/geom_gpt.c
+++ b/sys/geom/geom_gpt.c
@@ -134,7 +134,6 @@ g_gpt_taste(struct g_class *mp, struct g_provider *pp, int insist)
return (NULL);
g_topology_unlock();
- gp->dumpconf = g_gpt_dumpconf;
do {
mbr = NULL;
@@ -231,6 +230,7 @@ g_gpt_taste(struct g_class *mp, struct g_provider *pp, int insist)
static struct g_class g_gpt_class = {
.name = "GPT",
.taste = g_gpt_taste,
+ .dumpconf = g_gpt_dumpconf,
};
DECLARE_GEOM_CLASS(g_gpt_class, g_gpt);
diff --git a/sys/geom/geom_mbr.c b/sys/geom/geom_mbr.c
index 8d4d262..c3beeed 100644
--- a/sys/geom/geom_mbr.c
+++ b/sys/geom/geom_mbr.c
@@ -241,8 +241,6 @@ g_mbr_taste(struct g_class *mp, struct g_provider *pp, int insist)
if (gp == NULL)
return (NULL);
g_topology_unlock();
- gp->dumpconf = g_mbr_dumpconf;
- gp->ioctl = g_mbr_ioctl;
do {
/* XXX: phk think about this! */
if (gp->rank != 2 &&
@@ -279,6 +277,8 @@ g_mbr_taste(struct g_class *mp, struct g_provider *pp, int insist)
static struct g_class g_mbr_class = {
.name = MBR_CLASS_NAME,
.taste = g_mbr_taste,
+ .dumpconf = g_mbr_dumpconf,
+ .ioctl = g_mbr_ioctl,
};
DECLARE_GEOM_CLASS(g_mbr_class, g_mbr);
@@ -348,7 +348,6 @@ g_mbrext_taste(struct g_class *mp, struct g_provider *pp, int insist __unused)
if (gp == NULL)
return (NULL);
g_topology_unlock();
- gp->dumpconf = g_mbrext_dumpconf;
off = 0;
slice = 0;
do {
@@ -420,6 +419,7 @@ g_mbrext_taste(struct g_class *mp, struct g_provider *pp, int insist __unused)
static struct g_class g_mbrext_class = {
.name = MBREXT_CLASS_NAME,
.taste = g_mbrext_taste,
+ .dumpconf = g_mbrext_dumpconf,
};
DECLARE_GEOM_CLASS(g_mbrext_class, g_mbrext);
diff --git a/sys/geom/geom_pc98.c b/sys/geom/geom_pc98.c
index 2e0c212..07e131b 100644
--- a/sys/geom/geom_pc98.c
+++ b/sys/geom/geom_pc98.c
@@ -238,8 +238,6 @@ g_pc98_taste(struct g_class *mp, struct g_provider *pp, int flags)
if (gp == NULL)
return (NULL);
g_topology_unlock();
- gp->dumpconf = g_pc98_dumpconf;
- gp->ioctl = g_pc98_ioctl;
do {
if (gp->rank != 2 && flags == G_TF_NORMAL)
break;
@@ -284,6 +282,8 @@ g_pc98_taste(struct g_class *mp, struct g_provider *pp, int flags)
static struct g_class g_pc98_class = {
.name = PC98_CLASS_NAME,
.taste = g_pc98_taste,
+ .dumpconf = g_pc98_dumpconf,
+ .ioctl = g_pc98_ioctl,
};
DECLARE_GEOM_CLASS(g_pc98_class, g_pc98);
diff --git a/sys/geom/geom_sunlabel.c b/sys/geom/geom_sunlabel.c
index 8b11dd9..4225dd5 100644
--- a/sys/geom/geom_sunlabel.c
+++ b/sys/geom/geom_sunlabel.c
@@ -243,7 +243,6 @@ g_sunlabel_taste(struct g_class *mp, struct g_provider *pp, int flags)
if (gp == NULL)
return (NULL);
gsp = gp->softc;
- gp->dumpconf = g_sunlabel_dumpconf;
do {
if (gp->rank != 2 && flags == G_TF_NORMAL)
break;
@@ -276,6 +275,7 @@ static struct g_class g_sunlabel_class = {
.name = SUNLABEL_CLASS_NAME,
.taste = g_sunlabel_taste,
.ctlreq = g_sunlabel_config,
+ .dumpconf = g_sunlabel_dumpconf,
};
DECLARE_GEOM_CLASS(g_sunlabel_class, g_sunlabel);
OpenPOWER on IntegriCloud