first listing, remove CHAOS and mpxip
authorBill Joy <wnj@ucbvax.Berkeley.EDU>
Mon, 9 Nov 1981 08:55:52 +0000 (00:55 -0800)
committerBill Joy <wnj@ucbvax.Berkeley.EDU>
Mon, 9 Nov 1981 08:55:52 +0000 (00:55 -0800)
SCCS-vsn: sys/kern/vfs_lookup.c 4.8
SCCS-vsn: sys/ufs/ffs/ufs_lookup.c 4.8
SCCS-vsn: sys/ufs/ufs/ufs_lookup.c 4.8

usr/src/sys/kern/vfs_lookup.c
usr/src/sys/ufs/ffs/ufs_lookup.c
usr/src/sys/ufs/ufs/ufs_lookup.c

index 9870e0c..8226bbe 100644 (file)
@@ -1,4 +1,4 @@
-/*     vfs_lookup.c    4.7     81/05/18        */
+/*     vfs_lookup.c    4.8     81/11/08        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -22,7 +22,7 @@
  */
 struct inode *
 namei(func, flag)
  */
 struct inode *
 namei(func, flag)
-int (*func)();
+       int (*func)();
 {
        register struct inode *dp;
        register c;
 {
        register struct inode *dp;
        register c;
@@ -39,13 +39,13 @@ int (*func)();
         */
 
        dp = u.u_cdir;
         */
 
        dp = u.u_cdir;
-       if((c=(*func)()) == '/')
+       if ((c=(*func)()) == '/')
                if ((dp = u.u_rdir) == NULL)
                        dp = rootdir;
        (void) iget(dp->i_dev, dp->i_number);
                if ((dp = u.u_rdir) == NULL)
                        dp = rootdir;
        (void) iget(dp->i_dev, dp->i_number);
-       while(c == '/')
+       while (c == '/')
                c = (*func)();
                c = (*func)();
-       if(c == '\0' && flag != 0)
+       if (c == '\0' && flag != 0)
                u.u_error = ENOENT;
 
 cloop:
                u.u_error = ENOENT;
 
 cloop:
@@ -54,24 +54,11 @@ cloop:
         * to last component matched.
         */
 
         * to last component matched.
         */
 
-       if(u.u_error)
+       if (u.u_error)
                goto out;
                goto out;
-       if(c == '\0')
+       if (c == '\0')
                return(dp);
 
                return(dp);
 
-#ifdef CHAOS
-       /*
-        *      If the current node is a character
-        *      special file with the SUID bit set, return anyway.
-        *      This lets the Chaos open decode the rest of the name in its own
-        *      peculiar way.  jrl 3/81
-        */
-       if((dp->i_mode&(IFMT|ISUID)) == (IFCHR|ISUID)) {
-               u.u_dirp--;     /* back up to the slash or null */
-               return(dp);
-       }
-#endif
-
        /*
         * If there is another component,
         * Gather up name into
        /*
         * If there is another component,
         * Gather up name into
@@ -80,8 +67,6 @@ cloop:
 
        cp = &u.u_dbuf[0];
        while (c != '/' && c != '\0' && u.u_error == 0 ) {
 
        cp = &u.u_dbuf[0];
        while (c != '/' && c != '\0' && u.u_error == 0 ) {
-               if (mpxip!=NULL && c=='!')
-                       break;
                if (flag==1 && c == ('/'|0200)) {
                        u.u_error = ENOENT;
                        goto out;
                if (flag==1 && c == ('/'|0200)) {
                        u.u_error = ENOENT;
                        goto out;
@@ -90,16 +75,10 @@ cloop:
                        *cp++ = c;
                c = (*func)();
        }
                        *cp++ = c;
                c = (*func)();
        }
-       while(cp < &u.u_dbuf[DIRSIZ])
+       while (cp < &u.u_dbuf[DIRSIZ])
                *cp++ = '\0';
                *cp++ = '\0';
-       while(c == '/')
+       while (c == '/')
                c = (*func)();
                c = (*func)();
-       if (c == '!' && mpxip != NULL) {
-               iput(dp);
-               plock(mpxip);
-               mpxip->i_count++;
-               return(mpxip);
-       }
 
 seloop:
        /*
 
 seloop:
        /*
@@ -107,10 +86,10 @@ seloop:
         * must have X permission.
         */
 
         * must have X permission.
         */
 
-       if((dp->i_mode&IFMT) != IFDIR)
+       if ((dp->i_mode&IFMT) != IFDIR)
                u.u_error = ENOTDIR;
        (void) access(dp, IEXEC);
                u.u_error = ENOTDIR;
        (void) access(dp, IEXEC);
-       if(u.u_error)
+       if (u.u_error)
                goto out;
 
        /*
                goto out;
 
        /*
@@ -132,14 +111,14 @@ eloop:
         * is appropriate as per flag.
         */
 
         * is appropriate as per flag.
         */
 
-       if(u.u_offset >= dp->i_size) {
-               if(bp != NULL)
+       if (u.u_offset >= dp->i_size) {
+               if (bp != NULL)
                        brelse(bp);
                        brelse(bp);
-               if(flag==1 && c=='\0' && dp->i_nlink) {
-                       if(access(dp, IWRITE))
+               if (flag==1 && c=='\0' && dp->i_nlink) {
+                       if (access(dp, IWRITE))
                                goto out;
                        u.u_pdir = dp;
                                goto out;
                        u.u_pdir = dp;
-                       if(eo)
+                       if (eo)
                                u.u_offset = eo-sizeof(struct direct);
                        else
                                dp->i_flag |= IUPD|ICHG;
                                u.u_offset = eo-sizeof(struct direct);
                        else
                                dp->i_flag |= IUPD|ICHG;
@@ -155,8 +134,8 @@ eloop:
         * Release previous if it exists.
         */
 
         * Release previous if it exists.
         */
 
-       if((u.u_offset&BMASK) == 0) {
-               if(bp != NULL)
+       if ((u.u_offset&BMASK) == 0) {
+               if (bp != NULL)
                        brelse(bp);
                bp = bread(dp->i_dev,
                        bmap(dp, (daddr_t)(u.u_offset>>BSHIFT), B_READ));
                        brelse(bp);
                bp = bread(dp->i_dev,
                        bmap(dp, (daddr_t)(u.u_offset>>BSHIFT), B_READ));
@@ -177,15 +156,15 @@ eloop:
         */
 
        u.u_offset += sizeof(struct direct);
         */
 
        u.u_offset += sizeof(struct direct);
-       if(ep->d_ino == 0) {
-               if(eo == 0)
+       if (ep->d_ino == 0) {
+               if (eo == 0)
                        eo = u.u_offset;
                goto eloop;
        }
        for(i=0; i<DIRSIZ; i++) {
                        eo = u.u_offset;
                goto eloop;
        }
        for(i=0; i<DIRSIZ; i++) {
-               if(u.u_dbuf[i] != ep->d_name[i])
+               if (u.u_dbuf[i] != ep->d_name[i])
                        goto eloop;
                        goto eloop;
-               if(u.u_dbuf[i] == 0)
+               if (u.u_dbuf[i] == 0)
                        break;
        }
 
                        break;
        }
 
@@ -195,29 +174,29 @@ eloop:
         * cloop, otherwise return.
         */
        bcopy((caddr_t)ep, (caddr_t)&u.u_dent, sizeof(struct direct));
         * cloop, otherwise return.
         */
        bcopy((caddr_t)ep, (caddr_t)&u.u_dent, sizeof(struct direct));
-       if(bp != NULL)
+       if (bp != NULL)
                brelse(bp);
                brelse(bp);
-       if(flag==2 && c=='\0') {
-               if(access(dp, IWRITE))
+       if (flag==2 && c=='\0') {
+               if (access(dp, IWRITE))
                        goto out;
                return(dp);
        }
        d = dp->i_dev;
                        goto out;
                return(dp);
        }
        d = dp->i_dev;
-       if(u.u_dent.d_ino == ROOTINO)
-       if(dp->i_number == ROOTINO)
-       if(u.u_dent.d_name[1] == '.')
+       if (u.u_dent.d_ino == ROOTINO)
+       if (dp->i_number == ROOTINO)
+       if (u.u_dent.d_name[1] == '.')
                for(i=1; i<NMOUNT; i++)
                for(i=1; i<NMOUNT; i++)
-                       if(mount[i].m_bufp != NULL)
-                       if(mount[i].m_dev == d) {
+                       if (mount[i].m_bufp != NULL)
+                       if (mount[i].m_dev == d) {
                                iput(dp);
                                dp = mount[i].m_inodp;
                                dp->i_count++;
                                iput(dp);
                                dp = mount[i].m_inodp;
                                dp->i_count++;
-                               plock(dp);
+                               ilock(dp);
                                goto seloop;
                        }
        iput(dp);
        dp = iget(d, u.u_dent.d_ino);
                                goto seloop;
                        }
        iput(dp);
        dp = iget(d, u.u_dent.d_ino);
-       if(dp == NULL)
+       if (dp == NULL)
                return(NULL);
        goto cloop;
 
                return(NULL);
        goto cloop;
 
@@ -245,7 +224,7 @@ uchar()
        register c;
 
        c = fubyte(u.u_dirp++);
        register c;
 
        c = fubyte(u.u_dirp++);
-       if(c == -1)
+       if (c == -1)
                u.u_error = EFAULT;
        return(c);
 }
                u.u_error = EFAULT;
        return(c);
 }
index 2dc81dc..772dba1 100644 (file)
@@ -1,4 +1,4 @@
-/*     ufs_lookup.c    4.7     81/05/18        */
+/*     ufs_lookup.c    4.8     81/11/08        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -22,7 +22,7 @@
  */
 struct inode *
 namei(func, flag)
  */
 struct inode *
 namei(func, flag)
-int (*func)();
+       int (*func)();
 {
        register struct inode *dp;
        register c;
 {
        register struct inode *dp;
        register c;
@@ -39,13 +39,13 @@ int (*func)();
         */
 
        dp = u.u_cdir;
         */
 
        dp = u.u_cdir;
-       if((c=(*func)()) == '/')
+       if ((c=(*func)()) == '/')
                if ((dp = u.u_rdir) == NULL)
                        dp = rootdir;
        (void) iget(dp->i_dev, dp->i_number);
                if ((dp = u.u_rdir) == NULL)
                        dp = rootdir;
        (void) iget(dp->i_dev, dp->i_number);
-       while(c == '/')
+       while (c == '/')
                c = (*func)();
                c = (*func)();
-       if(c == '\0' && flag != 0)
+       if (c == '\0' && flag != 0)
                u.u_error = ENOENT;
 
 cloop:
                u.u_error = ENOENT;
 
 cloop:
@@ -54,24 +54,11 @@ cloop:
         * to last component matched.
         */
 
         * to last component matched.
         */
 
-       if(u.u_error)
+       if (u.u_error)
                goto out;
                goto out;
-       if(c == '\0')
+       if (c == '\0')
                return(dp);
 
                return(dp);
 
-#ifdef CHAOS
-       /*
-        *      If the current node is a character
-        *      special file with the SUID bit set, return anyway.
-        *      This lets the Chaos open decode the rest of the name in its own
-        *      peculiar way.  jrl 3/81
-        */
-       if((dp->i_mode&(IFMT|ISUID)) == (IFCHR|ISUID)) {
-               u.u_dirp--;     /* back up to the slash or null */
-               return(dp);
-       }
-#endif
-
        /*
         * If there is another component,
         * Gather up name into
        /*
         * If there is another component,
         * Gather up name into
@@ -80,8 +67,6 @@ cloop:
 
        cp = &u.u_dbuf[0];
        while (c != '/' && c != '\0' && u.u_error == 0 ) {
 
        cp = &u.u_dbuf[0];
        while (c != '/' && c != '\0' && u.u_error == 0 ) {
-               if (mpxip!=NULL && c=='!')
-                       break;
                if (flag==1 && c == ('/'|0200)) {
                        u.u_error = ENOENT;
                        goto out;
                if (flag==1 && c == ('/'|0200)) {
                        u.u_error = ENOENT;
                        goto out;
@@ -90,16 +75,10 @@ cloop:
                        *cp++ = c;
                c = (*func)();
        }
                        *cp++ = c;
                c = (*func)();
        }
-       while(cp < &u.u_dbuf[DIRSIZ])
+       while (cp < &u.u_dbuf[DIRSIZ])
                *cp++ = '\0';
                *cp++ = '\0';
-       while(c == '/')
+       while (c == '/')
                c = (*func)();
                c = (*func)();
-       if (c == '!' && mpxip != NULL) {
-               iput(dp);
-               plock(mpxip);
-               mpxip->i_count++;
-               return(mpxip);
-       }
 
 seloop:
        /*
 
 seloop:
        /*
@@ -107,10 +86,10 @@ seloop:
         * must have X permission.
         */
 
         * must have X permission.
         */
 
-       if((dp->i_mode&IFMT) != IFDIR)
+       if ((dp->i_mode&IFMT) != IFDIR)
                u.u_error = ENOTDIR;
        (void) access(dp, IEXEC);
                u.u_error = ENOTDIR;
        (void) access(dp, IEXEC);
-       if(u.u_error)
+       if (u.u_error)
                goto out;
 
        /*
                goto out;
 
        /*
@@ -132,14 +111,14 @@ eloop:
         * is appropriate as per flag.
         */
 
         * is appropriate as per flag.
         */
 
-       if(u.u_offset >= dp->i_size) {
-               if(bp != NULL)
+       if (u.u_offset >= dp->i_size) {
+               if (bp != NULL)
                        brelse(bp);
                        brelse(bp);
-               if(flag==1 && c=='\0' && dp->i_nlink) {
-                       if(access(dp, IWRITE))
+               if (flag==1 && c=='\0' && dp->i_nlink) {
+                       if (access(dp, IWRITE))
                                goto out;
                        u.u_pdir = dp;
                                goto out;
                        u.u_pdir = dp;
-                       if(eo)
+                       if (eo)
                                u.u_offset = eo-sizeof(struct direct);
                        else
                                dp->i_flag |= IUPD|ICHG;
                                u.u_offset = eo-sizeof(struct direct);
                        else
                                dp->i_flag |= IUPD|ICHG;
@@ -155,8 +134,8 @@ eloop:
         * Release previous if it exists.
         */
 
         * Release previous if it exists.
         */
 
-       if((u.u_offset&BMASK) == 0) {
-               if(bp != NULL)
+       if ((u.u_offset&BMASK) == 0) {
+               if (bp != NULL)
                        brelse(bp);
                bp = bread(dp->i_dev,
                        bmap(dp, (daddr_t)(u.u_offset>>BSHIFT), B_READ));
                        brelse(bp);
                bp = bread(dp->i_dev,
                        bmap(dp, (daddr_t)(u.u_offset>>BSHIFT), B_READ));
@@ -177,15 +156,15 @@ eloop:
         */
 
        u.u_offset += sizeof(struct direct);
         */
 
        u.u_offset += sizeof(struct direct);
-       if(ep->d_ino == 0) {
-               if(eo == 0)
+       if (ep->d_ino == 0) {
+               if (eo == 0)
                        eo = u.u_offset;
                goto eloop;
        }
        for(i=0; i<DIRSIZ; i++) {
                        eo = u.u_offset;
                goto eloop;
        }
        for(i=0; i<DIRSIZ; i++) {
-               if(u.u_dbuf[i] != ep->d_name[i])
+               if (u.u_dbuf[i] != ep->d_name[i])
                        goto eloop;
                        goto eloop;
-               if(u.u_dbuf[i] == 0)
+               if (u.u_dbuf[i] == 0)
                        break;
        }
 
                        break;
        }
 
@@ -195,29 +174,29 @@ eloop:
         * cloop, otherwise return.
         */
        bcopy((caddr_t)ep, (caddr_t)&u.u_dent, sizeof(struct direct));
         * cloop, otherwise return.
         */
        bcopy((caddr_t)ep, (caddr_t)&u.u_dent, sizeof(struct direct));
-       if(bp != NULL)
+       if (bp != NULL)
                brelse(bp);
                brelse(bp);
-       if(flag==2 && c=='\0') {
-               if(access(dp, IWRITE))
+       if (flag==2 && c=='\0') {
+               if (access(dp, IWRITE))
                        goto out;
                return(dp);
        }
        d = dp->i_dev;
                        goto out;
                return(dp);
        }
        d = dp->i_dev;
-       if(u.u_dent.d_ino == ROOTINO)
-       if(dp->i_number == ROOTINO)
-       if(u.u_dent.d_name[1] == '.')
+       if (u.u_dent.d_ino == ROOTINO)
+       if (dp->i_number == ROOTINO)
+       if (u.u_dent.d_name[1] == '.')
                for(i=1; i<NMOUNT; i++)
                for(i=1; i<NMOUNT; i++)
-                       if(mount[i].m_bufp != NULL)
-                       if(mount[i].m_dev == d) {
+                       if (mount[i].m_bufp != NULL)
+                       if (mount[i].m_dev == d) {
                                iput(dp);
                                dp = mount[i].m_inodp;
                                dp->i_count++;
                                iput(dp);
                                dp = mount[i].m_inodp;
                                dp->i_count++;
-                               plock(dp);
+                               ilock(dp);
                                goto seloop;
                        }
        iput(dp);
        dp = iget(d, u.u_dent.d_ino);
                                goto seloop;
                        }
        iput(dp);
        dp = iget(d, u.u_dent.d_ino);
-       if(dp == NULL)
+       if (dp == NULL)
                return(NULL);
        goto cloop;
 
                return(NULL);
        goto cloop;
 
@@ -245,7 +224,7 @@ uchar()
        register c;
 
        c = fubyte(u.u_dirp++);
        register c;
 
        c = fubyte(u.u_dirp++);
-       if(c == -1)
+       if (c == -1)
                u.u_error = EFAULT;
        return(c);
 }
                u.u_error = EFAULT;
        return(c);
 }
index 2dc81dc..772dba1 100644 (file)
@@ -1,4 +1,4 @@
-/*     ufs_lookup.c    4.7     81/05/18        */
+/*     ufs_lookup.c    4.8     81/11/08        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -22,7 +22,7 @@
  */
 struct inode *
 namei(func, flag)
  */
 struct inode *
 namei(func, flag)
-int (*func)();
+       int (*func)();
 {
        register struct inode *dp;
        register c;
 {
        register struct inode *dp;
        register c;
@@ -39,13 +39,13 @@ int (*func)();
         */
 
        dp = u.u_cdir;
         */
 
        dp = u.u_cdir;
-       if((c=(*func)()) == '/')
+       if ((c=(*func)()) == '/')
                if ((dp = u.u_rdir) == NULL)
                        dp = rootdir;
        (void) iget(dp->i_dev, dp->i_number);
                if ((dp = u.u_rdir) == NULL)
                        dp = rootdir;
        (void) iget(dp->i_dev, dp->i_number);
-       while(c == '/')
+       while (c == '/')
                c = (*func)();
                c = (*func)();
-       if(c == '\0' && flag != 0)
+       if (c == '\0' && flag != 0)
                u.u_error = ENOENT;
 
 cloop:
                u.u_error = ENOENT;
 
 cloop:
@@ -54,24 +54,11 @@ cloop:
         * to last component matched.
         */
 
         * to last component matched.
         */
 
-       if(u.u_error)
+       if (u.u_error)
                goto out;
                goto out;
-       if(c == '\0')
+       if (c == '\0')
                return(dp);
 
                return(dp);
 
-#ifdef CHAOS
-       /*
-        *      If the current node is a character
-        *      special file with the SUID bit set, return anyway.
-        *      This lets the Chaos open decode the rest of the name in its own
-        *      peculiar way.  jrl 3/81
-        */
-       if((dp->i_mode&(IFMT|ISUID)) == (IFCHR|ISUID)) {
-               u.u_dirp--;     /* back up to the slash or null */
-               return(dp);
-       }
-#endif
-
        /*
         * If there is another component,
         * Gather up name into
        /*
         * If there is another component,
         * Gather up name into
@@ -80,8 +67,6 @@ cloop:
 
        cp = &u.u_dbuf[0];
        while (c != '/' && c != '\0' && u.u_error == 0 ) {
 
        cp = &u.u_dbuf[0];
        while (c != '/' && c != '\0' && u.u_error == 0 ) {
-               if (mpxip!=NULL && c=='!')
-                       break;
                if (flag==1 && c == ('/'|0200)) {
                        u.u_error = ENOENT;
                        goto out;
                if (flag==1 && c == ('/'|0200)) {
                        u.u_error = ENOENT;
                        goto out;
@@ -90,16 +75,10 @@ cloop:
                        *cp++ = c;
                c = (*func)();
        }
                        *cp++ = c;
                c = (*func)();
        }
-       while(cp < &u.u_dbuf[DIRSIZ])
+       while (cp < &u.u_dbuf[DIRSIZ])
                *cp++ = '\0';
                *cp++ = '\0';
-       while(c == '/')
+       while (c == '/')
                c = (*func)();
                c = (*func)();
-       if (c == '!' && mpxip != NULL) {
-               iput(dp);
-               plock(mpxip);
-               mpxip->i_count++;
-               return(mpxip);
-       }
 
 seloop:
        /*
 
 seloop:
        /*
@@ -107,10 +86,10 @@ seloop:
         * must have X permission.
         */
 
         * must have X permission.
         */
 
-       if((dp->i_mode&IFMT) != IFDIR)
+       if ((dp->i_mode&IFMT) != IFDIR)
                u.u_error = ENOTDIR;
        (void) access(dp, IEXEC);
                u.u_error = ENOTDIR;
        (void) access(dp, IEXEC);
-       if(u.u_error)
+       if (u.u_error)
                goto out;
 
        /*
                goto out;
 
        /*
@@ -132,14 +111,14 @@ eloop:
         * is appropriate as per flag.
         */
 
         * is appropriate as per flag.
         */
 
-       if(u.u_offset >= dp->i_size) {
-               if(bp != NULL)
+       if (u.u_offset >= dp->i_size) {
+               if (bp != NULL)
                        brelse(bp);
                        brelse(bp);
-               if(flag==1 && c=='\0' && dp->i_nlink) {
-                       if(access(dp, IWRITE))
+               if (flag==1 && c=='\0' && dp->i_nlink) {
+                       if (access(dp, IWRITE))
                                goto out;
                        u.u_pdir = dp;
                                goto out;
                        u.u_pdir = dp;
-                       if(eo)
+                       if (eo)
                                u.u_offset = eo-sizeof(struct direct);
                        else
                                dp->i_flag |= IUPD|ICHG;
                                u.u_offset = eo-sizeof(struct direct);
                        else
                                dp->i_flag |= IUPD|ICHG;
@@ -155,8 +134,8 @@ eloop:
         * Release previous if it exists.
         */
 
         * Release previous if it exists.
         */
 
-       if((u.u_offset&BMASK) == 0) {
-               if(bp != NULL)
+       if ((u.u_offset&BMASK) == 0) {
+               if (bp != NULL)
                        brelse(bp);
                bp = bread(dp->i_dev,
                        bmap(dp, (daddr_t)(u.u_offset>>BSHIFT), B_READ));
                        brelse(bp);
                bp = bread(dp->i_dev,
                        bmap(dp, (daddr_t)(u.u_offset>>BSHIFT), B_READ));
@@ -177,15 +156,15 @@ eloop:
         */
 
        u.u_offset += sizeof(struct direct);
         */
 
        u.u_offset += sizeof(struct direct);
-       if(ep->d_ino == 0) {
-               if(eo == 0)
+       if (ep->d_ino == 0) {
+               if (eo == 0)
                        eo = u.u_offset;
                goto eloop;
        }
        for(i=0; i<DIRSIZ; i++) {
                        eo = u.u_offset;
                goto eloop;
        }
        for(i=0; i<DIRSIZ; i++) {
-               if(u.u_dbuf[i] != ep->d_name[i])
+               if (u.u_dbuf[i] != ep->d_name[i])
                        goto eloop;
                        goto eloop;
-               if(u.u_dbuf[i] == 0)
+               if (u.u_dbuf[i] == 0)
                        break;
        }
 
                        break;
        }
 
@@ -195,29 +174,29 @@ eloop:
         * cloop, otherwise return.
         */
        bcopy((caddr_t)ep, (caddr_t)&u.u_dent, sizeof(struct direct));
         * cloop, otherwise return.
         */
        bcopy((caddr_t)ep, (caddr_t)&u.u_dent, sizeof(struct direct));
-       if(bp != NULL)
+       if (bp != NULL)
                brelse(bp);
                brelse(bp);
-       if(flag==2 && c=='\0') {
-               if(access(dp, IWRITE))
+       if (flag==2 && c=='\0') {
+               if (access(dp, IWRITE))
                        goto out;
                return(dp);
        }
        d = dp->i_dev;
                        goto out;
                return(dp);
        }
        d = dp->i_dev;
-       if(u.u_dent.d_ino == ROOTINO)
-       if(dp->i_number == ROOTINO)
-       if(u.u_dent.d_name[1] == '.')
+       if (u.u_dent.d_ino == ROOTINO)
+       if (dp->i_number == ROOTINO)
+       if (u.u_dent.d_name[1] == '.')
                for(i=1; i<NMOUNT; i++)
                for(i=1; i<NMOUNT; i++)
-                       if(mount[i].m_bufp != NULL)
-                       if(mount[i].m_dev == d) {
+                       if (mount[i].m_bufp != NULL)
+                       if (mount[i].m_dev == d) {
                                iput(dp);
                                dp = mount[i].m_inodp;
                                dp->i_count++;
                                iput(dp);
                                dp = mount[i].m_inodp;
                                dp->i_count++;
-                               plock(dp);
+                               ilock(dp);
                                goto seloop;
                        }
        iput(dp);
        dp = iget(d, u.u_dent.d_ino);
                                goto seloop;
                        }
        iput(dp);
        dp = iget(d, u.u_dent.d_ino);
-       if(dp == NULL)
+       if (dp == NULL)
                return(NULL);
        goto cloop;
 
                return(NULL);
        goto cloop;
 
@@ -245,7 +224,7 @@ uchar()
        register c;
 
        c = fubyte(u.u_dirp++);
        register c;
 
        c = fubyte(u.u_dirp++);
-       if(c == -1)
+       if (c == -1)
                u.u_error = EFAULT;
        return(c);
 }
                u.u_error = EFAULT;
        return(c);
 }