Deleted Added
full compact
9c9
< * $FreeBSD: head/sys/dev/md/md.c 63309 2000-07-17 13:13:04Z sheldonh $
---
> * $FreeBSD: head/sys/dev/md/md.c 64880 2000-08-20 21:34:39Z phk $
14c14,15
< #include "opt_md.h" /* We have adopted some tasks from MFS */
---
> #include "opt_md.h"
> #include "opt_devfs.h"
25a27
> #include <sys/queue.h>
26a29,33
> #ifdef DEVFS
> #include <sys/eventhandler.h>
> #include <fs/devfs/devfs.h>
> #endif
>
55c62
< static void mdcreate_malloc(void);
---
> static void mdcreate_malloc(int unit);
84a92,93
> static LIST_HEAD(, md_s) md_softc_list = LIST_HEAD_INITIALIZER(&md_softc_list);
>
86a96
> LIST_ENTRY(md_s) list;
116a127
> #ifndef DEVFS
118c129,130
< mdcreate_malloc();
---
> mdcreate_malloc(-1);
> #endif
344c356
< mdcreate(void)
---
> mdcreate(int unit)
347a360,366
> if (unit == -1)
> unit = mdunits++;
> /* Make sure this unit isn't already in action */
> LIST_FOREACH(sc, &md_softc_list, list) {
> if (sc->unit == unit)
> return (NULL);
> }
350c369,370
< sc->unit = mdunits++;
---
> LIST_INSERT_HEAD(&md_softc_list, sc, list);
> sc->unit = unit;
366c386
< sc = mdcreate();
---
> sc = mdcreate(-1);
377c397
< mdcreate_malloc(void)
---
> mdcreate_malloc(int unit)
381c401,404
< sc = mdcreate();
---
> sc = mdcreate(unit);
> if (sc == NULL)
> return;
>
390a414
> #ifdef DEVFS
391a416,436
> md_clone (void *arg, char *name, int namelen, dev_t *dev)
> {
> int i, u;
>
> if (*dev != NODEV)
> return;
> i = devfs_stdclone(name, NULL, "md", &u);
> if (i == 0)
> return;
> /* XXX: should check that next char is [\0sa-h] */
> /*
> * Now we cheat: We just create the disk, but don't match.
> * Since we run before it, subr_disk.c::disk_clone() will
> * find our disk and match the sought for device.
> */
> mdcreate_malloc(u);
> return;
> }
> #endif
>
> static void
421c466,470
< mdcreate_malloc();
---
> #ifdef DEVFS
> EVENTHANDLER_REGISTER(devfs_clone, md_clone, 0, 999);
> #else
> mdcreate_malloc(-1);
> #endif
435a485
>