aboutsummaryrefslogtreecommitdiff
path: root/sys/geom
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2003-08-30 18:33:55 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2003-08-30 18:33:55 +0000
commitbff1e2999d85307dc55c26ba7b2efc964ac37b3d (patch)
treea6f6427ec21313d44e466ee01d050c77a4016250 /sys/geom
parentdee34ca4fcf0041884e974933927aab5b8151f45 (diff)
downloadsrc-bff1e2999d85307dc55c26ba7b2efc964ac37b3d.tar.gz
src-bff1e2999d85307dc55c26ba7b2efc964ac37b3d.zip
Add the new g_dev_getprovider() function, the swap_pager needs it now.
Spotted by: mr
Notes
Notes: svn path=/head/; revision=119593
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/geom.h1
-rw-r--r--sys/geom/geom_dev.c14
2 files changed, 15 insertions, 0 deletions
diff --git a/sys/geom/geom.h b/sys/geom/geom.h
index 53f735609c74..cdb5de22e42d 100644
--- a/sys/geom/geom.h
+++ b/sys/geom/geom.h
@@ -173,6 +173,7 @@ struct g_provider {
/* geom_dev.c */
void g_dev_print(void);
+struct g_provider *g_dev_getprovider(dev_t dev);
/* geom_dump.c */
void g_hexdump(void *ptr, int length);
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c
index 6104aed9fd02..470ac8d894a0 100644
--- a/sys/geom/geom_dev.c
+++ b/sys/geom/geom_dev.c
@@ -133,6 +133,20 @@ g_dev_register_cloner(void *foo __unused)
SYSINIT(geomdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,g_dev_register_cloner,NULL);
+struct g_provider *
+g_dev_getprovider(dev_t dev)
+{
+ struct g_consumer *cp;
+
+ if (dev == NULL)
+ return (NULL);
+ if (devsw(dev) != &g_dev_cdevsw)
+ return (NULL);
+ cp = dev->si_drv2;
+ return (cp->provider);
+}
+
+
static struct g_geom *
g_dev_taste(struct g_class *mp, struct g_provider *pp, int insist __unused)
{