EFS crud
authorBill Joy <root@ucbvax.Berkeley.EDU>
Fri, 16 Jul 1982 11:48:41 +0000 (03:48 -0800)
committerBill Joy <root@ucbvax.Berkeley.EDU>
Fri, 16 Jul 1982 11:48:41 +0000 (03:48 -0800)
SCCS-vsn: sys/kern/vfs_vnops.c 4.24

usr/src/sys/kern/vfs_vnops.c

index 26b82b4..36b49aa 100644 (file)
@@ -1,4 +1,4 @@
-/*     vfs_vnops.c     4.23    82/04/19        */
+/*     vfs_vnops.c     4.24    82/07/15        */
 
 /* merged into kernel: @(#)fio.c 2.2 4/8/82 */
 
 
 /* merged into kernel: @(#)fio.c 2.2 4/8/82 */
 
 #include "../h/socket.h"
 #include "../h/socketvar.h"
 #include "../h/proc.h"
 #include "../h/socket.h"
 #include "../h/socketvar.h"
 #include "../h/proc.h"
+#ifdef EFS
+#include "../net/in.h"
+#include "../h/efs.h"
+#endif
 
 /*
  * Convert a user supplied file descriptor into a pointer
 
 /*
  * Convert a user supplied file descriptor into a pointer
@@ -84,6 +88,18 @@ closef(fp, nouser)
 
        case IFCHR:
                cfunc = cdevsw[major(dev)].d_close;
 
        case IFCHR:
                cfunc = cdevsw[major(dev)].d_close;
+#ifdef EFS
+               /*
+                * Every close() must call the driver if the
+                * extended file system is being used -- not
+                * just the last close.  Pass along the file
+                * pointer for reference later.
+                */
+               if (major(dev) == efs_major) {
+                       (*cfunc)(dev, flag, fp, nouser);
+                       return;
+               }
+#endif
                break;
 
        case IFBLK:
                break;
 
        case IFBLK:
@@ -122,7 +138,11 @@ closef(fp, nouser)
  * of special files to initialize and
  * validate before actual IO.
  */
  * of special files to initialize and
  * validate before actual IO.
  */
+#ifdef EFS
+openi(ip, rw, trf)
+#else
 openi(ip, rw)
 openi(ip, rw)
+#endif
        register struct inode *ip;
 {
        dev_t dev;
        register struct inode *ip;
 {
        dev_t dev;
@@ -135,7 +155,11 @@ openi(ip, rw)
        case IFCHR:
                if (maj >= nchrdev)
                        goto bad;
        case IFCHR:
                if (maj >= nchrdev)
                        goto bad;
+#ifdef EFS
+               (*cdevsw[maj].d_open)(dev, rw, trf);
+#else
                (*cdevsw[maj].d_open)(dev, rw);
                (*cdevsw[maj].d_open)(dev, rw);
+#endif
                break;
 
        case IFBLK:
                break;
 
        case IFBLK:
@@ -213,6 +237,14 @@ owner(follow)
        ip = namei(uchar, 0, follow);
        if (ip == NULL)
                return (NULL);
        ip = namei(uchar, 0, follow);
        if (ip == NULL)
                return (NULL);
+#ifdef EFS
+       /*
+        * References to extended file system are
+        * returned to the caller.
+        */
+       if (efsinode(ip))
+               return (ip);
+#endif
        if (u.u_uid == ip->i_uid)
                return (ip);
        if (suser())
        if (u.u_uid == ip->i_uid)
                return (ip);
        if (suser())