From 15f4f6a52b122bc25685c03d547db8506a57b97a Mon Sep 17 00:00:00 2001 From: phk Date: Sat, 8 Feb 2003 12:30:12 +0000 Subject: [PATCH] Move #defines of major/minor to internal header file so other bits can share and coordinate with geom_dev. --- sys/geom/geom_dev.c | 6 ++---- sys/geom/geom_int.h | 9 ++++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c index 24234b95333..5c1cb05cf5c 100644 --- a/sys/geom/geom_dev.c +++ b/sys/geom/geom_dev.c @@ -52,8 +52,6 @@ #include #include -#define CDEV_MAJOR 4 - static d_open_t g_dev_open; static d_close_t g_dev_close; static d_strategy_t g_dev_strategy; @@ -70,7 +68,7 @@ static struct cdevsw g_dev_cdevsw = { /* mmap */ nommap, /* strategy */ g_dev_strategy, /* name */ "g_dev", - /* maj */ CDEV_MAJOR, + /* maj */ GEOM_MAJOR, /* dump */ nodump, /* psize */ g_dev_psize, /* flags */ D_DISK | D_CANFREE | D_TRACKCLOSE, @@ -149,7 +147,7 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, int insist __unused) { struct g_geom *gp; struct g_consumer *cp; - static int unit; + static int unit = GEOM_MINOR_PROVIDERS; int error; dev_t dev; diff --git a/sys/geom/geom_int.h b/sys/geom/geom_int.h index 5962c86adcb..3b33501e3c3 100644 --- a/sys/geom/geom_int.h +++ b/sys/geom/geom_int.h @@ -70,13 +70,20 @@ struct g_event { g_call_me_t *func; }; +/* + * We actually have a number of drivers sharing the same major number + * so we coordinate the major/minor usage here + */ +#define GEOM_MAJOR 4 +#define GEOM_MINOR_STATS 0 +#define GEOM_MINOR_PROVIDERS 10 + /* geom_dump.c */ void g_confxml(void *); void g_conf_specific(struct sbuf *sb, struct g_class *mp, struct g_geom *gp, struct g_provider *pp, struct g_consumer *cp); void g_confdot(void *); void g_conftxt(void *); - /* geom_event.c */ void g_event_init(void); void g_post_event(enum g_events ev, struct g_class *mp, struct g_geom *gp, struct g_provider *pp, struct g_consumer *cp); -- 2.45.2