use uio structure in nameidata rather than constructing a new one
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Thu, 8 Jun 1989 07:45:49 +0000 (23:45 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Thu, 8 Jun 1989 07:45:49 +0000 (23:45 -0800)
SCCS-vsn: sys/ufs/ffs/ufs_lookup.c 7.9
SCCS-vsn: sys/ufs/ufs/ufs_lookup.c 7.9
SCCS-vsn: sys/kern/init_main.c 7.12

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

index 9e98838..945a76d 100644 (file)
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)init_main.c 7.11 (Berkeley) %G%
+ *     @(#)init_main.c 7.12 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -106,8 +106,11 @@ main(firstaddr)
         * handled when copying the u. area in newproc().
         */
        u.u_nd.ni_iov = &u.u_nd.ni_nd.nd_iovec;
         * handled when copying the u. area in newproc().
         */
        u.u_nd.ni_iov = &u.u_nd.ni_nd.nd_iovec;
-       u.u_ap = u.u_arg;
        u.u_nd.ni_iovcnt = 1;
        u.u_nd.ni_iovcnt = 1;
+       u.u_nd.ni_base = (caddr_t)&u.u_nd.ni_dent;
+       u.u_nd.ni_rw = UIO_WRITE;
+       u.u_nd.ni_segflg = UIO_SYSSPACE;
+       u.u_ap = u.u_arg;
 
        u.u_cmask = cmask;
        u.u_lastfile = -1;
 
        u.u_cmask = cmask;
        u.u_lastfile = -1;
index 3afadc0..d26049f 100644 (file)
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)ufs_lookup.c        7.8 (Berkeley) %G%
+ *     @(#)ufs_lookup.c        7.9 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -544,9 +544,9 @@ direnter(ip, ndp)
                if (ndp->ni_offset&(DIRBLKSIZ-1))
                        panic("wdir: newblk");
                ndp->ni_dent.d_reclen = DIRBLKSIZ;
                if (ndp->ni_offset&(DIRBLKSIZ-1))
                        panic("wdir: newblk");
                ndp->ni_dent.d_reclen = DIRBLKSIZ;
-               error = rdwri(UIO_WRITE, dp, (caddr_t)&ndp->ni_dent,
-                   newentrysize, ndp->ni_offset, UIO_SYSSPACE, ndp->ni_cred,
-                   (int *)0);
+               ndp->ni_count = newentrysize;
+               ndp->ni_resid = newentrysize;
+               error = writeip(dp, &ndp->ni_uio, ndp->ni_cred);
                if (DIRBLKSIZ > dp->i_fs->fs_fsize)
                        panic("wdir: blksize"); /* XXX - should grow w/balloc */
                else
                if (DIRBLKSIZ > dp->i_fs->fs_fsize)
                        panic("wdir: blksize"); /* XXX - should grow w/balloc */
                else
@@ -629,8 +629,8 @@ direnter(ip, ndp)
 }
 
 /*
 }
 
 /*
- * Remove a directory entry after a call to namei, using the
- * parameters which it left in the u. area.  The u. entry
+ * Remove a directory entry after a call to namei, using
+ * the parameters which it left in nameidata. The entry
  * ni_offset contains the offset into the directory of the
  * entry to be eliminated.  The ni_count field contains the
  * size of the previous record in the directory.  If this
  * ni_offset contains the offset into the directory of the
  * entry to be eliminated.  The ni_count field contains the
  * size of the previous record in the directory.  If this
@@ -653,9 +653,8 @@ dirremove(ndp)
                 * First entry in block: set d_ino to zero.
                 */
                ndp->ni_dent.d_ino = 0;
                 * First entry in block: set d_ino to zero.
                 */
                ndp->ni_dent.d_ino = 0;
-               error = rdwri(UIO_WRITE, dp, (caddr_t)&ndp->ni_dent,
-                   (int)DIRSIZ(&ndp->ni_dent), ndp->ni_offset, UIO_SYSSPACE,
-                   ndp->ni_cred, (int *)0);
+               ndp->ni_count = ndp->ni_resid = DIRSIZ(&ndp->ni_dent);
+               error = writeip(dp, &ndp->ni_uio, ndp->ni_cred);
        } else {
                /*
                 * Collapse new free space into previous entry.
        } else {
                /*
                 * Collapse new free space into previous entry.
@@ -682,9 +681,8 @@ dirrewrite(dp, ip, ndp)
 {
 
        ndp->ni_dent.d_ino = ip->i_number;
 {
 
        ndp->ni_dent.d_ino = ip->i_number;
-       return (rdwri(UIO_WRITE, dp, (caddr_t)&ndp->ni_dent,
-           (int)DIRSIZ(&ndp->ni_dent), ndp->ni_offset, UIO_SYSSPACE,
-           ndp->ni_cred, (int *)0));
+       ndp->ni_count = ndp->ni_resid = DIRSIZ(&ndp->ni_dent);
+       return (writeip(dp, &ndp->ni_uio, ndp->ni_cred));
 }
 
 /*
 }
 
 /*
index 3afadc0..d26049f 100644 (file)
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)ufs_lookup.c        7.8 (Berkeley) %G%
+ *     @(#)ufs_lookup.c        7.9 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -544,9 +544,9 @@ direnter(ip, ndp)
                if (ndp->ni_offset&(DIRBLKSIZ-1))
                        panic("wdir: newblk");
                ndp->ni_dent.d_reclen = DIRBLKSIZ;
                if (ndp->ni_offset&(DIRBLKSIZ-1))
                        panic("wdir: newblk");
                ndp->ni_dent.d_reclen = DIRBLKSIZ;
-               error = rdwri(UIO_WRITE, dp, (caddr_t)&ndp->ni_dent,
-                   newentrysize, ndp->ni_offset, UIO_SYSSPACE, ndp->ni_cred,
-                   (int *)0);
+               ndp->ni_count = newentrysize;
+               ndp->ni_resid = newentrysize;
+               error = writeip(dp, &ndp->ni_uio, ndp->ni_cred);
                if (DIRBLKSIZ > dp->i_fs->fs_fsize)
                        panic("wdir: blksize"); /* XXX - should grow w/balloc */
                else
                if (DIRBLKSIZ > dp->i_fs->fs_fsize)
                        panic("wdir: blksize"); /* XXX - should grow w/balloc */
                else
@@ -629,8 +629,8 @@ direnter(ip, ndp)
 }
 
 /*
 }
 
 /*
- * Remove a directory entry after a call to namei, using the
- * parameters which it left in the u. area.  The u. entry
+ * Remove a directory entry after a call to namei, using
+ * the parameters which it left in nameidata. The entry
  * ni_offset contains the offset into the directory of the
  * entry to be eliminated.  The ni_count field contains the
  * size of the previous record in the directory.  If this
  * ni_offset contains the offset into the directory of the
  * entry to be eliminated.  The ni_count field contains the
  * size of the previous record in the directory.  If this
@@ -653,9 +653,8 @@ dirremove(ndp)
                 * First entry in block: set d_ino to zero.
                 */
                ndp->ni_dent.d_ino = 0;
                 * First entry in block: set d_ino to zero.
                 */
                ndp->ni_dent.d_ino = 0;
-               error = rdwri(UIO_WRITE, dp, (caddr_t)&ndp->ni_dent,
-                   (int)DIRSIZ(&ndp->ni_dent), ndp->ni_offset, UIO_SYSSPACE,
-                   ndp->ni_cred, (int *)0);
+               ndp->ni_count = ndp->ni_resid = DIRSIZ(&ndp->ni_dent);
+               error = writeip(dp, &ndp->ni_uio, ndp->ni_cred);
        } else {
                /*
                 * Collapse new free space into previous entry.
        } else {
                /*
                 * Collapse new free space into previous entry.
@@ -682,9 +681,8 @@ dirrewrite(dp, ip, ndp)
 {
 
        ndp->ni_dent.d_ino = ip->i_number;
 {
 
        ndp->ni_dent.d_ino = ip->i_number;
-       return (rdwri(UIO_WRITE, dp, (caddr_t)&ndp->ni_dent,
-           (int)DIRSIZ(&ndp->ni_dent), ndp->ni_offset, UIO_SYSSPACE,
-           ndp->ni_cred, (int *)0));
+       ndp->ni_count = ndp->ni_resid = DIRSIZ(&ndp->ni_dent);
+       return (writeip(dp, &ndp->ni_uio, ndp->ni_cred));
 }
 
 /*
 }
 
 /*