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.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index e663e3d..17cae68 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -347,6 +347,15 @@ g_disk_start(struct bio *bp)
} while (bp2 != NULL);
break;
case BIO_GETATTR:
+ /* Give the driver a chance to override */
+ if (dp->d_getattr != NULL) {
+ if (bp->bio_disk == NULL)
+ bp->bio_disk = dp;
+ error = dp->d_getattr(bp);
+ if (error != -1)
+ break;
+ error = EJUSTRETURN;
+ }
if (g_handleattr_int(bp, "GEOM::candelete",
(dp->d_flags & DISKFLAG_CANDELETE) != 0))
break;
@@ -582,6 +591,18 @@ disk_gone(struct disk *dp)
g_wither_provider(pp, ENXIO);
}
+void
+disk_attr_changed(struct disk *dp, const char *attr, int flag)
+{
+ struct g_geom *gp;
+ struct g_provider *pp;
+
+ gp = dp->d_geom;
+ if (gp != NULL)
+ LIST_FOREACH(pp, &gp->provider, provider)
+ (void)g_attr_changed(pp, attr, flag);
+}
+
static void
g_kern_disks(void *p, int flag __unused)
{
OpenPOWER on IntegriCloud