4.4BSD snapshot (revision 8.1); add 1993 to copyright
[unix-history] / usr / src / sys / miscfs / fdesc / fdesc_vfsops.c
index 542203e..b78efbc 100644 (file)
@@ -1,6 +1,6 @@
 /*
 /*
- * Copyright (c) 1992 The Regents of the University of California
- * Copyright (c) 1990, 1992 Jan-Simon Pendry
+ * Copyright (c) 1992, 1993
+ *     The Regents of the University of California.  All rights reserved.
  * All rights reserved.
  *
  * This code is derived from software donated to Berkeley by
  * All rights reserved.
  *
  * This code is derived from software donated to Berkeley by
@@ -8,9 +8,9 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)fdesc_vfsops.c      7.1 (Berkeley) %G%
+ *     @(#)fdesc_vfsops.c      8.1 (Berkeley) %G%
  *
  *
- * $Id: fdesc_vfsops.c,v 1.6 1992/05/30 10:25:59 jsp Exp jsp $
+ * $Id: fdesc_vfsops.c,v 1.9 1993/04/06 15:28:33 jsp Exp $
  */
 
 /*
  */
 
 /*
 #include <sys/malloc.h>
 #include <miscfs/fdesc/fdesc.h>
 
 #include <sys/malloc.h>
 #include <miscfs/fdesc/fdesc.h>
 
-static u_short fdesc_mntid;
+dev_t devctty;
 
 fdesc_init()
 {
 #ifdef FDESC_DIAGNOSTIC
        printf("fdesc_init\n");         /* printed during system boot */
 #endif
 
 fdesc_init()
 {
 #ifdef FDESC_DIAGNOSTIC
        printf("fdesc_init\n");         /* printed during system boot */
 #endif
+       devctty = makedev(nchrdev, 0);
 }
 
 /*
 }
 
 /*
@@ -64,7 +65,7 @@ fdesc_mount(mp, path, data, ndp, p)
        if (mp->mnt_flag & MNT_UPDATE)
                return (EOPNOTSUPP);
 
        if (mp->mnt_flag & MNT_UPDATE)
                return (EOPNOTSUPP);
 
-       error = getnewvnode(VT_UFS, mp, fdesc_vnodeop_p, &rvp); /* XXX */
+       error = fdesc_allocvp(Froot, FD_ROOT, mp, &rvp);
        if (error)
                return (error);
 
        if (error)
                return (error);
 
@@ -76,7 +77,8 @@ fdesc_mount(mp, path, data, ndp, p)
        printf("fdesc_mount: root vp = %x\n", rvp);
 #endif
        fmp->f_root = rvp;
        printf("fdesc_mount: root vp = %x\n", rvp);
 #endif
        fmp->f_root = rvp;
-       mp->mnt_flag |= MNT_LOCAL;
+       /* XXX -- don't mark as local to work around fts() problems */
+       /*mp->mnt_flag |= MNT_LOCAL;*/
        mp->mnt_data = (qaddr_t) fmp;
        getnewfsid(mp, MOUNT_FDESC);
 
        mp->mnt_data = (qaddr_t) fmp;
        getnewfsid(mp, MOUNT_FDESC);
 
@@ -214,7 +216,7 @@ fdesc_statfs(mp, sbp, p)
         * limit is ever reduced below the current number
         * of open files... ]
         */
         * limit is ever reduced below the current number
         * of open files... ]
         */
-       lim = p->p_rlimit[RLIMIT_OFILE].rlim_cur;
+       lim = p->p_rlimit[RLIMIT_NOFILE].rlim_cur;
        fdp = p->p_fd;
        last = min(fdp->fd_nfiles, lim);
        freefd = 0;
        fdp = p->p_fd;
        last = min(fdp->fd_nfiles, lim);
        freefd = 0;