summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_diskslice.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2001-05-26 08:27:58 +0000
committerphk <phk@FreeBSD.org>2001-05-26 08:27:58 +0000
commit2072a71f0e5186928f3cb8cfac61fe8199029442 (patch)
treeb40e6ace9e559eda88dc8e88344909bffdde59e4 /sys/kern/subr_diskslice.c
parent32df247d021a07cb6a2425587a871d41f24660e6 (diff)
downloadFreeBSD-src-2072a71f0e5186928f3cb8cfac61fe8199029442.zip
FreeBSD-src-2072a71f0e5186928f3cb8cfac61fe8199029442.tar.gz
Create a general facility for making dev_t's depend on another
dev_t. The dev_depends(dev_t, dev_t) function is for tying them to each other. When destroy_dev() is called on a dev_t, all dev_t's depending on it will also be destroyed (depth first order). Rewrite the make_dev_alias() to use this dependency facility. kern/subr_disk.c: Make the disk mini-layer use dependencies to make sure all relevant dev_t's are removed when the disk disappears. Make the disk mini-layer precreate some magic sub devices which the disk/slice/label code expects to be there. kern/subr_disklabel.c: Remove some now unneeded variables. kern/subr_diskmbr.c: Remove some ancient, commented out code. kern/subr_diskslice.c: Minor cleanup. Use name from dev_t instead of dsname()
Diffstat (limited to 'sys/kern/subr_diskslice.c')
-rw-r--r--sys/kern/subr_diskslice.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/kern/subr_diskslice.c b/sys/kern/subr_diskslice.c
index 9d9c705..0e20032 100644
--- a/sys/kern/subr_diskslice.c
+++ b/sys/kern/subr_diskslice.c
@@ -648,7 +648,6 @@ dsopen(dev, mode, flags, sspp, lp)
struct disklabel *lp1;
char *msg;
u_char mask;
- bool_t need_init;
int part;
char partname[2];
int slice;
@@ -671,10 +670,9 @@ dsopen(dev, mode, flags, sspp, lp)
* on the unit. This should only be done if the media has changed.
*/
ssp = *sspp;
- need_init = !dsisopen(ssp);
- if (ssp != NULL && need_init)
- dsgone(sspp);
- if (need_init) {
+ if (!dsisopen(ssp)) {
+ if (ssp != NULL)
+ dsgone(sspp);
/*
* Allocate a minimal slices "struct". This will become
* the final slices "struct" if we don't want real slices
@@ -730,9 +728,12 @@ dsopen(dev, mode, flags, sspp, lp)
)
continue;
dev1 = dkmodslice(dkmodpart(dev, RAW_PART), slice);
- if (dev1->si_devsw == NULL)
- dev1->si_devsw = dev->si_devsw;
+#if 0
sname = dsname(dev, unit, slice, RAW_PART, partname);
+#else
+ *partname='\0';
+ sname = dev1->si_name;
+#endif
/*
* XXX this should probably only be done for the need_init
* case, but there may be a problem with DIOCSYNCSLICEINFO.
OpenPOWER on IntegriCloud