pull load average and misc changes down from magnum
This commit is contained in:
parent
bdabe240d0
commit
86f960201b
|
@ -33,7 +33,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: kernfs_vfsops.c,v 1.9 1993/12/18 03:55:47 mycroft Exp $
|
||||
* $Id: kernfs_vfsops.c,v 1.10 1993/12/20 12:39:10 cgd Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -60,31 +60,40 @@ struct vnode *rrootdevvp;
|
|||
|
||||
kernfs_init()
|
||||
{
|
||||
int error, bmaj, cmaj;
|
||||
|
||||
#ifdef KERNFS_DIAGNOSTIC
|
||||
printf("kernfs_init\n"); /* printed during system boot */
|
||||
printf("kernfs_init\n"); /* printed during system boot */
|
||||
#endif
|
||||
|
||||
bmaj = major(rootdev);
|
||||
/* DO NOTHING */
|
||||
}
|
||||
|
||||
/* hunt for the raw root device by looking in cdevsw for a matching
|
||||
* open routine...
|
||||
*/
|
||||
for (cmaj = 0; cmaj < nchrdev; cmaj++) {
|
||||
if (cdevsw[cmaj].d_open == bdevsw[bmaj].d_open) {
|
||||
dev_t cdev = makedev(cmaj, minor(rootdev));
|
||||
error = cdevvp(cdev, &rrootdevvp);
|
||||
if (error == 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
kernfs_rrootdevvp_init()
|
||||
{
|
||||
int error, bmaj, cmaj;
|
||||
|
||||
/* this isn't fatal... */
|
||||
if (error) {
|
||||
printf("kernfs: no raw root device\n");
|
||||
rrootdevvp = 0;
|
||||
}
|
||||
if (rrootdevvp != NULL) /* then we've already done this */
|
||||
return;
|
||||
|
||||
error = ENXIO;
|
||||
bmaj = major(rootdev);
|
||||
|
||||
/* hunt for the raw root device by looking in cdevsw for a matching
|
||||
* open routine...
|
||||
*/
|
||||
for (cmaj = 0; cmaj < nchrdev; cmaj++) {
|
||||
if (cdevsw[cmaj].d_open == bdevsw[bmaj].d_open) {
|
||||
dev_t cdev = makedev(cmaj, minor(rootdev));
|
||||
error = cdevvp(cdev, &rrootdevvp);
|
||||
if (!error)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* this isn't fatal... */
|
||||
if (error) {
|
||||
printf("kernfs: no raw root device\n");
|
||||
rrootdevvp = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -136,6 +145,9 @@ kernfs_mount(mp, path, data, ndp, p)
|
|||
#ifdef KERNFS_DIAGNOSTIC
|
||||
printf("kernfs_mount: at %s\n", mp->mnt_stat.f_mntonname);
|
||||
#endif
|
||||
|
||||
kernfs_rrootdevvp_init();
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: kernfs_vnops.c,v 1.14 1993/12/18 03:56:12 mycroft Exp $
|
||||
* $Id: kernfs_vnops.c,v 1.15 1993/12/20 12:39:12 cgd Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -126,9 +126,9 @@ kernfs_xread(kt, buf, len, lenp)
|
|||
|
||||
case KTT_AVENRUN:
|
||||
sprintf(buf, "%d %d %d %d\n",
|
||||
averunnable[0],
|
||||
averunnable[1],
|
||||
averunnable[2],
|
||||
averunnable.ldavg[0],
|
||||
averunnable.ldavg[1],
|
||||
averunnable.ldavg[2],
|
||||
FSCALE);
|
||||
break;
|
||||
|
||||
|
@ -203,19 +203,25 @@ kernfs_lookup(dvp, ndp, p)
|
|||
* /kern/rootdev is the root device
|
||||
*/
|
||||
if (ndp->ni_namelen == 7 && bcmp(pname, "rootdev", 7) == 0) {
|
||||
if (vfinddev(rootdev, VBLK, &fvp))
|
||||
return (ENXIO);
|
||||
if (!rootvp) {
|
||||
error = ENOENT;
|
||||
goto bad;
|
||||
}
|
||||
ndp->ni_dvp = dvp;
|
||||
ndp->ni_vp = fvp;
|
||||
VREF(fvp);
|
||||
VOP_LOCK(fvp);
|
||||
ndp->ni_vp = rootvp;
|
||||
VREF(rootvp);
|
||||
VOP_LOCK(rootvp);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* /kern/rrootdev is the root device
|
||||
* /kern/rrootdev is the raw root device
|
||||
*/
|
||||
if (ndp->ni_namelen == 8 && bcmp(pname, "rrootdev", 7) == 0) {
|
||||
if (!rrootdevvp) {
|
||||
error = ENOENT;
|
||||
goto bad;
|
||||
}
|
||||
ndp->ni_dvp = dvp;
|
||||
ndp->ni_vp = rrootdevvp;
|
||||
VREF(rrootdevvp);
|
||||
|
|
Loading…
Reference in New Issue