diff options
author | phk <phk@FreeBSD.org> | 2003-08-30 18:33:55 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-08-30 18:33:55 +0000 |
commit | a802e42c5aec19e451457d9c955b3b74eb5a42d8 (patch) | |
tree | a6f6427ec21313d44e466ee01d050c77a4016250 /sys/geom/geom_dev.c | |
parent | 2c584462d57386e8ee2b14a530152a6f24201225 (diff) | |
download | FreeBSD-src-a802e42c5aec19e451457d9c955b3b74eb5a42d8.zip FreeBSD-src-a802e42c5aec19e451457d9c955b3b74eb5a42d8.tar.gz |
Add the new g_dev_getprovider() function, the swap_pager needs it now.
Spotted by: mr
Diffstat (limited to 'sys/geom/geom_dev.c')
-rw-r--r-- | sys/geom/geom_dev.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c index 6104aed..470ac8d 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) { |