diff options
author | phk <phk@FreeBSD.org> | 2000-06-15 20:30:53 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2000-06-15 20:30:53 +0000 |
commit | b54e59b4798af58f5f24df6660f6266e2427f4f0 (patch) | |
tree | 74a118e8bb0a9078715914b46d7c077d2dd58f91 /sys/kern/subr_disk.c | |
parent | b598f843e4c71a9589f484f61768d6e37be9520a (diff) | |
download | FreeBSD-src-b54e59b4798af58f5f24df6660f6266e2427f4f0.zip FreeBSD-src-b54e59b4798af58f5f24df6660f6266e2427f4f0.tar.gz |
Add disk_enumerate() for finding names of disks. Vinum and libh will
need this RSN.
Remove a pointless warning in the root device locating code.
Remove the "wd" compatibility name from the "ad" driver.
WARNING: If you have not updated to use /dev/wd* in your /etc/fstab
and modern bootblocks, it would be a very good idea to do so BEFORE
you upgrade your kernel.
Diffstat (limited to 'sys/kern/subr_disk.c')
-rw-r--r-- | sys/kern/subr_disk.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c index c600d38..5e18163 100644 --- a/sys/kern/subr_disk.c +++ b/sys/kern/subr_disk.c @@ -27,6 +27,8 @@ static d_open_t diskopen; static d_close_t diskclose; static d_ioctl_t diskioctl; static d_psize_t diskpsize; + +static LIST_HEAD(, disk) disklist = LIST_HEAD_INITIALIZER(&disklist); dev_t disk_create(int unit, struct disk *dp, int flags, struct cdevsw *cdevsw, struct cdevsw *proto) @@ -49,12 +51,13 @@ disk_create(int unit, struct disk *dp, int flags, struct cdevsw *cdevsw, struct if (bootverbose) printf("Creating DISK %s%d\n", cdevsw->d_name, unit); dev = make_dev(proto, dkmakeminor(unit, WHOLE_DISK_SLICE, RAW_PART), - 0, 0, 0, "r%s%d", cdevsw->d_name, unit); + 0, 0, 0, "%s%d", cdevsw->d_name, unit); dev->si_disk = dp; dp->d_dev = dev; dp->d_dsflags = flags; dp->d_devsw = cdevsw; + LIST_INSERT_HEAD(&disklist, dp, d_list); return (dev); } @@ -95,11 +98,22 @@ disk_invalidate (struct disk *disk) void disk_destroy(dev_t dev) { + LIST_REMOVE(dev->si_disk, d_list); + bzero(dev->si_disk, sizeof(*dev->si_disk)); dev->si_disk = NULL; destroy_dev(dev); return; } +struct disk * +disk_enumerate(struct disk *disk) +{ + if (!disk) + return (LIST_FIRST(&disklist)); + else + return (LIST_NEXT(disk, d_list)); +} + /* * The cdevsw functions */ |