mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
Fixed a bug in DEVFS code that was producing "name slot allocation failed"
messages.
This commit is contained in:
parent
b0b321257d
commit
4297524c49
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=15056
@ -43,7 +43,7 @@
|
||||
* from: wd.c,v 1.55 1994/10/22 01:57:12 phk Exp $
|
||||
* from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91
|
||||
* from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $
|
||||
* $Id: subr_diskslice.c,v 1.21 1996/04/01 21:03:07 scrappy Exp $
|
||||
* $Id: subr_diskslice.c,v 1.22 1996/04/02 04:52:03 scrappy Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -660,10 +660,12 @@ dsopen(dname, dev, mode, sspp, lp, strat, setgeom, bdevsw, cdevsw)
|
||||
sname = dsname(dname, unit, slice, RAW_PART, partname);
|
||||
sp->ds_bdev =
|
||||
devfs_add_devswf(bdevsw, mynor, DV_BLK, UID_ROOT,
|
||||
GID_OPERATOR, 0640, "%s", sname);
|
||||
GID_OPERATOR, 0640, "%s%s", sname,
|
||||
partname);
|
||||
sp->ds_cdev =
|
||||
devfs_add_devswf(cdevsw, mynor, DV_CHR, UID_ROOT,
|
||||
GID_OPERATOR, 0640, "r%s", sname);
|
||||
GID_OPERATOR, 0640, "r%s%s", sname,
|
||||
partname);
|
||||
}
|
||||
#endif
|
||||
if (sp->ds_label == NULL) {
|
||||
@ -942,6 +944,7 @@ set_ds_labeldevs(dname, dev, ssp)
|
||||
struct disklabel *lp;
|
||||
int mynor;
|
||||
int part;
|
||||
char *devname;
|
||||
char partname[2];
|
||||
struct partition *pp;
|
||||
int slice;
|
||||
@ -956,31 +959,25 @@ set_ds_labeldevs(dname, dev, ssp)
|
||||
pp = &lp->d_partitions[part];
|
||||
if (pp->p_size == 0)
|
||||
continue;
|
||||
devname = dsname(dname, dkunit(dev), slice,
|
||||
part, partname);
|
||||
if (part == RAW_PART && sp->ds_bdev != NULL) {
|
||||
sp->ds_bdevs[part] =
|
||||
devfs_link(sp->ds_bdev, "%s%s",
|
||||
dsname(dname, dkunit(dev), slice,
|
||||
part, partname),
|
||||
partname);
|
||||
devname, partname);
|
||||
sp->ds_cdevs[part] =
|
||||
devfs_link(sp->ds_cdev, "r%s%s",
|
||||
dsname(dname, dkunit(dev), slice,
|
||||
part, partname),
|
||||
partname);
|
||||
devname, partname);
|
||||
} else {
|
||||
mynor = minor(dkmodpart(dev, part));
|
||||
sp->ds_bdevs[part] =
|
||||
devfs_add_devswf(ssp->dss_bdevsw, mynor, DV_BLK,
|
||||
UID_ROOT, GID_OPERATOR, 0640,
|
||||
"%s",
|
||||
dsname(dname, dkunit(dev),
|
||||
slice, part, partname));
|
||||
"%s%s", devname, partname);
|
||||
sp->ds_cdevs[part] =
|
||||
devfs_add_devswf(ssp->dss_cdevsw, mynor, DV_CHR,
|
||||
UID_ROOT, GID_OPERATOR, 0640,
|
||||
"r%s",
|
||||
dsname(dname, dkunit(dev),
|
||||
slice, part, partname));
|
||||
"r%s%s", devname, partname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user