summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_disk.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/geom/geom_disk.c')
-rw-r--r--sys/geom/geom_disk.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index 8eb486a..e0f2bc1 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -75,6 +75,7 @@ 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;
+static g_provgone_t g_disk_providergone;
static struct g_class g_disk_class = {
.name = "DISK",
@@ -84,6 +85,7 @@ static struct g_class g_disk_class = {
.start = g_disk_start,
.access = g_disk_access,
.ioctl = g_disk_ioctl,
+ .providergone = g_disk_providergone,
.dumpconf = g_disk_dumpconf,
};
@@ -487,6 +489,25 @@ g_disk_create(void *arg, int flag)
g_error_provider(pp, 0);
}
+/*
+ * We get this callback after all of the consumers have gone away, and just
+ * before the provider is freed. If the disk driver provided a d_gone
+ * callback, let them know that it is okay to free resources -- they won't
+ * be getting any more accesses from GEOM.
+ */
+static void
+g_disk_providergone(struct g_provider *pp)
+{
+ struct disk *dp;
+ struct g_disk_softc *sc;
+
+ sc = (struct g_disk_softc *)pp->geom->softc;
+ dp = sc->dp;
+
+ if (dp->d_gone != NULL)
+ dp->d_gone(dp);
+}
+
static void
g_disk_destroy(void *ptr, int flag)
{
@@ -550,7 +571,7 @@ void
disk_create(struct disk *dp, int version)
{
- if (version != DISK_VERSION_00 && version != DISK_VERSION_01) {
+ if (version != DISK_VERSION_02) {
printf("WARNING: Attempt to add disk %s%d %s",
dp->d_name, dp->d_unit,
" using incompatible ABI version of disk(9)\n");
OpenPOWER on IntegriCloud