first cut for new proc & user structs (still need to put in new vnode calling
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Wed, 20 Mar 1991 02:30:44 +0000 (18:30 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Wed, 20 Mar 1991 02:30:44 +0000 (18:30 -0800)
convention): get credentials, etc, via proc; u.u_nd, u.u_spare are gone;
purge user.h; remove ../ufs/ from includes; consolidate *nullops();
chown/fchmod use proc's credentials, not file's

SCCS-vsn: sys/ufs/mfs/mfs_vfsops.c 7.18
SCCS-vsn: sys/ufs/mfs/mfs_vnops.c 7.21
SCCS-vsn: sys/ufs/ffs/ffs_alloc.c 7.24
SCCS-vsn: sys/ufs/lfs/lfs_alloc.c 7.24
SCCS-vsn: sys/ufs/ffs/ffs_balloc.c 7.12
SCCS-vsn: sys/ufs/lfs/lfs_balloc.c 7.12
SCCS-vsn: sys/ufs/ffs/ufs_disksubr.c 7.15
SCCS-vsn: sys/ufs/ufs/ufs_disksubr.c 7.15
SCCS-vsn: sys/ufs/ffs/ffs_inode.c 7.38
SCCS-vsn: sys/ufs/ffs/ufs_inode.c 7.38
SCCS-vsn: sys/ufs/lfs/lfs_inode.c 7.38
SCCS-vsn: sys/ufs/ufs/ufs_inode.c 7.38
SCCS-vsn: sys/ufs/ffs/ufs_lockf.c 7.3
SCCS-vsn: sys/ufs/ufs/ufs_lockf.c 7.3
SCCS-vsn: sys/ufs/ffs/ufs_lookup.c 7.28
SCCS-vsn: sys/ufs/ufs/ufs_lookup.c 7.28
SCCS-vsn: sys/ufs/ffs/ufs_quota.c 7.7
SCCS-vsn: sys/ufs/ufs/ufs_quota.c 7.7
SCCS-vsn: sys/ufs/ffs/ffs_vfsops.c 7.51
SCCS-vsn: sys/ufs/ffs/ufs_vfsops.c 7.51
SCCS-vsn: sys/ufs/lfs/lfs_vfsops.c 7.51
SCCS-vsn: sys/ufs/ufs/ufs_vfsops.c 7.51
SCCS-vsn: sys/ufs/ffs/ffs_vnops.c 7.58
SCCS-vsn: sys/ufs/ffs/ufs_vnops.c 7.58
SCCS-vsn: sys/ufs/lfs/lfs_vnops.c 7.58
SCCS-vsn: sys/ufs/ufs/ufs_vnops.c 7.58

26 files changed:
usr/src/sys/ufs/ffs/ffs_alloc.c
usr/src/sys/ufs/ffs/ffs_balloc.c
usr/src/sys/ufs/ffs/ffs_inode.c
usr/src/sys/ufs/ffs/ffs_vfsops.c
usr/src/sys/ufs/ffs/ffs_vnops.c
usr/src/sys/ufs/ffs/ufs_disksubr.c
usr/src/sys/ufs/ffs/ufs_inode.c
usr/src/sys/ufs/ffs/ufs_lockf.c
usr/src/sys/ufs/ffs/ufs_lookup.c
usr/src/sys/ufs/ffs/ufs_quota.c
usr/src/sys/ufs/ffs/ufs_vfsops.c
usr/src/sys/ufs/ffs/ufs_vnops.c
usr/src/sys/ufs/lfs/lfs_alloc.c
usr/src/sys/ufs/lfs/lfs_balloc.c
usr/src/sys/ufs/lfs/lfs_inode.c
usr/src/sys/ufs/lfs/lfs_vfsops.c
usr/src/sys/ufs/lfs/lfs_vnops.c
usr/src/sys/ufs/mfs/mfs_vfsops.c
usr/src/sys/ufs/mfs/mfs_vnops.c
usr/src/sys/ufs/ufs/ufs_disksubr.c
usr/src/sys/ufs/ufs/ufs_inode.c
usr/src/sys/ufs/ufs/ufs_lockf.c
usr/src/sys/ufs/ufs/ufs_lookup.c
usr/src/sys/ufs/ufs/ufs_quota.c
usr/src/sys/ufs/ufs/ufs_vfsops.c
usr/src/sys/ufs/ufs/ufs_vnops.c

index d56a0c3..c666be2 100644 (file)
@@ -4,20 +4,20 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ffs_alloc.c 7.23 (Berkeley) %G%
+ *     @(#)ffs_alloc.c 7.24 (Berkeley) %G%
  */
 
 #include "param.h"
 #include "systm.h"
 #include "buf.h"
  */
 
 #include "param.h"
 #include "systm.h"
 #include "buf.h"
-#include "user.h"
+#include "proc.h"
 #include "vnode.h"
 #include "kernel.h"
 #include "syslog.h"
 #include "vnode.h"
 #include "kernel.h"
 #include "syslog.h"
-#include "cmap.h"
-#include "../ufs/quota.h"
-#include "../ufs/inode.h"
-#include "../ufs/fs.h"
+
+#include "quota.h"
+#include "inode.h"
+#include "fs.h"
 
 extern u_long          hashalloc();
 extern ino_t           ialloccg();
 
 extern u_long          hashalloc();
 extern ino_t           ialloccg();
@@ -58,7 +58,7 @@ alloc(ip, lbn, bpref, size, bnp)
        register struct fs *fs;
        register struct buf *bp;
        int cg, error;
        register struct fs *fs;
        register struct buf *bp;
        int cg, error;
-       struct ucred *cred = u.u_cred;          /* XXX */
+       struct ucred *cred = curproc->p_ucred;          /* XXX */
        
        *bnp = 0;
        fs = ip->i_fs;
        
        *bnp = 0;
        fs = ip->i_fs;
@@ -120,7 +120,7 @@ realloccg(ip, lbprev, bpref, osize, nsize, bpp)
        struct buf *bp, *obp;
        int cg, request, error;
        daddr_t bprev, bno;
        struct buf *bp, *obp;
        int cg, request, error;
        daddr_t bprev, bno;
-       struct ucred *cred = u.u_cred;          /* XXX */
+       struct ucred *cred = curproc->p_ucred;          /* XXX */
        
        *bpp = 0;
        fs = ip->i_fs;
        
        *bpp = 0;
        fs = ip->i_fs;
@@ -872,7 +872,7 @@ blkfree(ip, bno, size)
        struct buf *bp;
        int error, cg, blk, frags, bbase;
        register int i;
        struct buf *bp;
        int error, cg, blk, frags, bbase;
        register int i;
-       struct ucred *cred = u.u_cred;  /* XXX */
+       struct ucred *cred = curproc->p_ucred;  /* XXX */
 
        fs = ip->i_fs;
        if ((unsigned)size > fs->fs_bsize || fragoff(fs, size) != 0) {
 
        fs = ip->i_fs;
        if ((unsigned)size > fs->fs_bsize || fragoff(fs, size) != 0) {
index a703b1d..914483e 100644 (file)
@@ -4,19 +4,19 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ffs_balloc.c        7.11 (Berkeley) %G%
+ *     @(#)ffs_balloc.c        7.12 (Berkeley) %G%
  */
 
 #include "param.h"
 #include "systm.h"
  */
 
 #include "param.h"
 #include "systm.h"
-#include "user.h"
 #include "buf.h"
 #include "proc.h"
 #include "file.h"
 #include "vnode.h"
 #include "buf.h"
 #include "proc.h"
 #include "file.h"
 #include "vnode.h"
-#include "../ufs/quota.h"
-#include "../ufs/inode.h"
-#include "../ufs/fs.h"
+
+#include "quota.h"
+#include "inode.h"
+#include "fs.h"
 
 /*
  * Bmap defines the structure of file system storage
 
 /*
  * Bmap defines the structure of file system storage
index e4f7941..a7bc96a 100644 (file)
@@ -4,25 +4,24 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ffs_inode.c 7.37 (Berkeley) %G%
+ *     @(#)ffs_inode.c 7.38 (Berkeley) %G%
  */
 
 #include "param.h"
 #include "systm.h"
 #include "mount.h"
  */
 
 #include "param.h"
 #include "systm.h"
 #include "mount.h"
-#include "user.h"
 #include "proc.h"
 #include "file.h"
 #include "buf.h"
 #include "proc.h"
 #include "file.h"
 #include "buf.h"
-#include "cmap.h"
 #include "vnode.h"
 #include "vnode.h"
-#include "../ufs/quota.h"
-#include "../ufs/inode.h"
-#include "../ufs/fs.h"
-#include "../ufs/ufsmount.h"
 #include "kernel.h"
 #include "malloc.h"
 
 #include "kernel.h"
 #include "malloc.h"
 
+#include "quota.h"
+#include "inode.h"
+#include "fs.h"
+#include "ufsmount.h"
+
 #define        INOHSZ  512
 #if    ((INOHSZ&(INOHSZ-1)) == 0)
 #define        INOHASH(dev,ino)        (((dev)+(ino))&(INOHSZ-1))
 #define        INOHSZ  512
 #if    ((INOHSZ&(INOHSZ-1)) == 0)
 #define        INOHASH(dev,ino)        (((dev)+(ino))&(INOHSZ-1))
@@ -646,14 +645,13 @@ ilock(ip)
 
        while (ip->i_flag & ILOCKED) {
                ip->i_flag |= IWANT;
 
        while (ip->i_flag & ILOCKED) {
                ip->i_flag |= IWANT;
-               if (ip->i_spare0 == u.u_procp->p_pid)
+               if (ip->i_spare0 == curproc->p_pid)
                        panic("locking against myself");
                        panic("locking against myself");
-               ip->i_spare1 = u.u_procp->p_pid;
+               ip->i_spare1 = curproc->p_pid;
                (void) sleep((caddr_t)ip, PINOD);
        }
        ip->i_spare1 = 0;
                (void) sleep((caddr_t)ip, PINOD);
        }
        ip->i_spare1 = 0;
-       ip->i_spare0 = u.u_procp->p_pid;
-       u.u_spare[0]++;
+       ip->i_spare0 = curproc->p_pid;
        ip->i_flag |= ILOCKED;
 }
 
        ip->i_flag |= ILOCKED;
 }
 
@@ -667,7 +665,6 @@ iunlock(ip)
        if ((ip->i_flag & ILOCKED) == 0)
                vprint("iunlock: unlocked inode", ITOV(ip));
        ip->i_spare0 = 0;
        if ((ip->i_flag & ILOCKED) == 0)
                vprint("iunlock: unlocked inode", ITOV(ip));
        ip->i_spare0 = 0;
-       u.u_spare[0]--;
        ip->i_flag &= ~ILOCKED;
        if (ip->i_flag&IWANT) {
                ip->i_flag &= ~IWANT;
        ip->i_flag &= ~ILOCKED;
        if (ip->i_flag&IWANT) {
                ip->i_flag &= ~IWANT;
index cd0bafb..09f7b4f 100644 (file)
@@ -4,12 +4,12 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ffs_vfsops.c        7.50 (Berkeley) %G%
+ *     @(#)ffs_vfsops.c        7.51 (Berkeley) %G%
  */
 
 #include "param.h"
 #include "systm.h"
  */
 
 #include "param.h"
 #include "systm.h"
-#include "user.h"
+#include "namei.h"
 #include "proc.h"
 #include "kernel.h"
 #include "vnode.h"
 #include "proc.h"
 #include "kernel.h"
 #include "vnode.h"
 #include "ioctl.h"
 #include "errno.h"
 #include "malloc.h"
 #include "ioctl.h"
 #include "errno.h"
 #include "malloc.h"
-#include "../ufs/quota.h"
-#include "../ufs/fs.h"
-#include "../ufs/ufsmount.h"
-#include "../ufs/inode.h"
 #include "ioctl.h"
 #include "disklabel.h"
 #include "stat.h"
 
 #include "ioctl.h"
 #include "disklabel.h"
 #include "stat.h"
 
+#include "quota.h"
+#include "fs.h"
+#include "ufsmount.h"
+#include "inode.h"
+
 /*
  * ufs vfs operations.
  */
 /*
  * ufs vfs operations.
  */
@@ -402,26 +403,25 @@ ufs_quotactl(mp, cmds, uid, arg)
        uid_t uid;
        caddr_t arg;
 {
        uid_t uid;
        caddr_t arg;
 {
-       register struct nameidata *ndp = &u.u_nd;
        struct ufsmount *ump = VFSTOUFS(mp);
        struct ufsmount *ump = VFSTOUFS(mp);
-       struct proc *p = u.u_procp;     /* XXX */
+       struct proc *p = curproc;       /* XXX */
        int cmd, type, error;
 
 #ifndef QUOTA
        return (EOPNOTSUPP);
 #else
        if (uid == -1)
        int cmd, type, error;
 
 #ifndef QUOTA
        return (EOPNOTSUPP);
 #else
        if (uid == -1)
-               uid = p->p_ruid;
+               uid = p->p_cred->p_ruid;
        cmd = cmds >> SUBCMDSHIFT;
 
        switch (cmd) {
        case Q_GETQUOTA:
        case Q_SYNC:
        cmd = cmds >> SUBCMDSHIFT;
 
        switch (cmd) {
        case Q_GETQUOTA:
        case Q_SYNC:
-               if (uid == p->p_ruid)
+               if (uid == p->p_cred->p_ruid)
                        break;
                /* fall through */
        default:
                        break;
                /* fall through */
        default:
-               if (error = suser(ndp->ni_cred, &u.u_acflag))
+               if (error = suser(p->p_ucred, &p->p_acflag))
                        return (error);
        }
 
                        return (error);
        }
 
@@ -432,7 +432,7 @@ ufs_quotactl(mp, cmds, uid, arg)
        switch (cmd) {
 
        case Q_QUOTAON:
        switch (cmd) {
 
        case Q_QUOTAON:
-               return (quotaon(ndp, mp, type, arg));
+               return (quotaon(p, mp, type, arg));
 
        case Q_QUOTAOFF:
                if (vfs_busy(mp))
 
        case Q_QUOTAOFF:
                if (vfs_busy(mp))
@@ -737,7 +737,7 @@ getmdev(devvpp, fname, ndp)
        ndp->ni_nameiop = LOOKUP | FOLLOW;
        ndp->ni_segflg = UIO_USERSPACE;
        ndp->ni_dirp = fname;
        ndp->ni_nameiop = LOOKUP | FOLLOW;
        ndp->ni_segflg = UIO_USERSPACE;
        ndp->ni_dirp = fname;
-       if (error = namei(ndp))
+       if (error = namei(ndp, curproc))                /* XXX */
                return (error);
        vp = ndp->ni_vp;
        if (vp->v_type != VBLK) {
                return (error);
        vp = ndp->ni_vp;
        if (vp->v_type != VBLK) {
index 7045483..c2aa999 100644 (file)
@@ -4,29 +4,29 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ffs_vnops.c 7.57 (Berkeley) %G%
+ *     @(#)ffs_vnops.c 7.58 (Berkeley) %G%
  */
 
 #include "param.h"
 #include "systm.h"
  */
 
 #include "param.h"
 #include "systm.h"
-#include "user.h"
+#include "namei.h"
+#include "resourcevar.h"
 #include "kernel.h"
 #include "file.h"
 #include "stat.h"
 #include "buf.h"
 #include "proc.h"
 #include "kernel.h"
 #include "file.h"
 #include "stat.h"
 #include "buf.h"
 #include "proc.h"
-#include "socket.h"
-#include "socketvar.h"
 #include "conf.h"
 #include "mount.h"
 #include "vnode.h"
 #include "specdev.h"
 #include "fcntl.h"
 #include "malloc.h"
 #include "conf.h"
 #include "mount.h"
 #include "vnode.h"
 #include "specdev.h"
 #include "fcntl.h"
 #include "malloc.h"
-#include "../ufs/lockf.h"
-#include "../ufs/quota.h"
-#include "../ufs/inode.h"
-#include "../ufs/fs.h"
+
+#include "lockf.h"
+#include "quota.h"
+#include "inode.h"
+#include "fs.h"
 
 /*
  * Global vfs data structures for ufs
 
 /*
  * Global vfs data structures for ufs
@@ -112,8 +112,7 @@ int spec_lookup(),
        spec_select(),
        ufsspec_close(),
        spec_advlock(),
        spec_select(),
        ufsspec_close(),
        spec_advlock(),
-       spec_badop(),
-       nullop();
+       spec_badop();
 
 struct vnodeops spec_inodeops = {
        spec_lookup,            /* lookup */
 
 struct vnodeops spec_inodeops = {
        spec_lookup,            /* lookup */
@@ -401,6 +400,7 @@ ufs_setattr(vp, vap, cred)
        register struct vattr *vap;
        register struct ucred *cred;
 {
        register struct vattr *vap;
        register struct ucred *cred;
 {
+       struct proc *p = curproc;               /* XXX */
        register struct inode *ip = VTOI(vp);
        int error = 0;
 
        register struct inode *ip = VTOI(vp);
        int error = 0;
 
@@ -417,7 +417,7 @@ ufs_setattr(vp, vap, cred)
         * Go through the fields and update iff not VNOVAL.
         */
        if (vap->va_uid != (u_short)VNOVAL || vap->va_gid != (u_short)VNOVAL)
         * Go through the fields and update iff not VNOVAL.
         */
        if (vap->va_uid != (u_short)VNOVAL || vap->va_gid != (u_short)VNOVAL)
-               if (error = chown1(vp, vap->va_uid, vap->va_gid, cred))
+               if (error = chown1(vp, vap->va_uid, vap->va_gid, p))
                        return (error);
        if (vap->va_size != VNOVAL) {
                if (vp->v_type == VDIR)
                        return (error);
        if (vap->va_size != VNOVAL) {
                if (vp->v_type == VDIR)
@@ -427,7 +427,7 @@ ufs_setattr(vp, vap, cred)
        }
        if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) {
                if (cred->cr_uid != ip->i_uid &&
        }
        if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) {
                if (cred->cr_uid != ip->i_uid &&
-                   (error = suser(cred, &u.u_acflag)))
+                   (error = suser(cred, &p->p_acflag)))
                        return (error);
                if (vap->va_atime.tv_sec != VNOVAL)
                        ip->i_flag |= IACC;
                        return (error);
                if (vap->va_atime.tv_sec != VNOVAL)
                        ip->i_flag |= IACC;
@@ -438,10 +438,10 @@ ufs_setattr(vp, vap, cred)
                        return (error);
        }
        if (vap->va_mode != (u_short)VNOVAL)
                        return (error);
        }
        if (vap->va_mode != (u_short)VNOVAL)
-               error = chmod1(vp, (int)vap->va_mode, cred);
+               error = chmod1(vp, (int)vap->va_mode, p);
        if (vap->va_flags != VNOVAL) {
                if (cred->cr_uid != ip->i_uid &&
        if (vap->va_flags != VNOVAL) {
                if (cred->cr_uid != ip->i_uid &&
-                   (error = suser(cred, &u.u_acflag)))
+                   (error = suser(cred, &p->p_acflag)))
                        return (error);
                if (cred->cr_uid == 0) {
                        ip->i_flags = vap->va_flags;
                        return (error);
                if (cred->cr_uid == 0) {
                        ip->i_flags = vap->va_flags;
@@ -458,16 +458,17 @@ ufs_setattr(vp, vap, cred)
  * Change the mode on a file.
  * Inode must be locked before calling.
  */
  * Change the mode on a file.
  * Inode must be locked before calling.
  */
-chmod1(vp, mode, cred)
+chmod1(vp, mode, p)
        register struct vnode *vp;
        register int mode;
        register struct vnode *vp;
        register int mode;
-       struct ucred *cred;
+       struct proc *p;
 {
 {
+       register struct ucred *cred = p->p_ucred;
        register struct inode *ip = VTOI(vp);
        int error;
 
        if (cred->cr_uid != ip->i_uid &&
        register struct inode *ip = VTOI(vp);
        int error;
 
        if (cred->cr_uid != ip->i_uid &&
-           (error = suser(cred, &u.u_acflag)))
+           (error = suser(cred, &p->p_acflag)))
                return (error);
        if (cred->cr_uid) {
                if (vp->v_type != VDIR && (mode & ISVTX))
                return (error);
        if (cred->cr_uid) {
                if (vp->v_type != VDIR && (mode & ISVTX))
@@ -487,13 +488,14 @@ chmod1(vp, mode, cred)
  * Perform chown operation on inode ip;
  * inode must be locked prior to call.
  */
  * Perform chown operation on inode ip;
  * inode must be locked prior to call.
  */
-chown1(vp, uid, gid, cred)
+chown1(vp, uid, gid, p)
        register struct vnode *vp;
        uid_t uid;
        gid_t gid;
        register struct vnode *vp;
        uid_t uid;
        gid_t gid;
-       struct ucred *cred;
+       struct proc *p;
 {
        register struct inode *ip = VTOI(vp);
 {
        register struct inode *ip = VTOI(vp);
+       register struct ucred *cred = p->p_ucred;
        uid_t ouid;
        gid_t ogid;
        int error = 0;
        uid_t ouid;
        gid_t ogid;
        int error = 0;
@@ -513,7 +515,7 @@ chown1(vp, uid, gid, cred)
         */
        if ((cred->cr_uid != ip->i_uid || uid != ip->i_uid ||
            !groupmember((gid_t)gid, cred)) &&
         */
        if ((cred->cr_uid != ip->i_uid || uid != ip->i_uid ||
            !groupmember((gid_t)gid, cred)) &&
-           (error = suser(cred, &u.u_acflag)))
+           (error = suser(cred, &p->p_acflag)))
                return (error);
        ouid = ip->i_uid;
        ogid = ip->i_gid;
                return (error);
        ouid = ip->i_uid;
        ogid = ip->i_gid;
@@ -656,6 +658,7 @@ ufs_write(vp, uio, ioflag, cred)
        int ioflag;
        struct ucred *cred;
 {
        int ioflag;
        struct ucred *cred;
 {
+       struct proc *p = curproc;               /* XXX */
        register struct inode *ip = VTOI(vp);
        register struct fs *fs;
        struct buf *bp;
        register struct inode *ip = VTOI(vp);
        register struct fs *fs;
        struct buf *bp;
@@ -692,8 +695,8 @@ ufs_write(vp, uio, ioflag, cred)
         */
        if (vp->v_type == VREG &&
            uio->uio_offset + uio->uio_resid >
         */
        if (vp->v_type == VREG &&
            uio->uio_offset + uio->uio_resid >
-             u.u_rlimit[RLIMIT_FSIZE].rlim_cur) {
-               psignal(u.u_procp, SIGXFSZ);
+             p->p_rlimit[RLIMIT_FSIZE].rlim_cur) {
+               psignal(p, SIGXFSZ);
                return (EFBIG);
        }
        resid = uio->uio_resid;
                return (EFBIG);
        }
        resid = uio->uio_resid;
@@ -894,6 +897,7 @@ ufs_link(vp, ndp)
 ufs_rename(fndp, tndp)
        register struct nameidata *fndp, *tndp;
 {
 ufs_rename(fndp, tndp)
        register struct nameidata *fndp, *tndp;
 {
+       struct proc *p = curproc;               /* XXX */
        register struct inode *ip, *xp, *dp;
        struct dirtemplate dirbuf;
        int doingdirectory = 0, oldparent = 0, newparent = 0;
        register struct inode *ip, *xp, *dp;
        struct dirtemplate dirbuf;
        int doingdirectory = 0, oldparent = 0, newparent = 0;
@@ -970,7 +974,7 @@ ufs_rename(fndp, tndp)
                                iput(xp);
                        if (error = checkpath(ip, dp, tndp->ni_cred))
                                goto out;
                                iput(xp);
                        if (error = checkpath(ip, dp, tndp->ni_cred))
                                goto out;
-                       if (error = namei(tndp))
+                       if (error = namei(tndp, p))
                                goto out;
                        xp = NULL;
                        if (tndp->ni_vp)
                                goto out;
                        xp = NULL;
                        if (tndp->ni_vp)
@@ -1092,7 +1096,7 @@ ufs_rename(fndp, tndp)
         */
        fndp->ni_nameiop &= ~(MODMASK | OPMASK);
        fndp->ni_nameiop |= DELETE | LOCKPARENT | LOCKLEAF;
         */
        fndp->ni_nameiop &= ~(MODMASK | OPMASK);
        fndp->ni_nameiop |= DELETE | LOCKPARENT | LOCKLEAF;
-       (void)namei(fndp);
+       (void)namei(fndp, p);
        if (fndp->ni_vp != NULL) {
                xp = VTOI(fndp->ni_vp);
                dp = VTOI(fndp->ni_dvp);
        if (fndp->ni_vp != NULL) {
                xp = VTOI(fndp->ni_vp);
                dp = VTOI(fndp->ni_dvp);
@@ -1189,6 +1193,7 @@ ufs_mkdir(ndp, vap)
        struct nameidata *ndp;
        struct vattr *vap;
 {
        struct nameidata *ndp;
        struct vattr *vap;
 {
+       struct proc *p = curproc;               /* XXX */
        register struct inode *ip, *dp;
        struct inode *tip;
        struct vnode *dvp;
        register struct inode *ip, *dp;
        struct inode *tip;
        struct vnode *dvp;
@@ -1273,7 +1278,7 @@ ufs_mkdir(ndp, vap)
        if (error = direnter(ip, ndp)) {
                ndp->ni_nameiop &= ~(MODMASK | OPMASK);
                ndp->ni_nameiop |= LOOKUP | LOCKLEAF | NOCACHE;
        if (error = direnter(ip, ndp)) {
                ndp->ni_nameiop &= ~(MODMASK | OPMASK);
                ndp->ni_nameiop |= LOOKUP | LOCKLEAF | NOCACHE;
-               error = namei(ndp);
+               error = namei(ndp, p);
                if (!error) {
                        iput(dp);
                        dp = VTOI(ndp->ni_vp);
                if (!error) {
                        iput(dp);
                        dp = VTOI(ndp->ni_vp);
index fb22543..4df589c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_disksubr.c      7.14 (Berkeley) %G%
+ *     @(#)ufs_disksubr.c      7.15 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -12,7 +12,6 @@
 #include "buf.h"
 #include "disklabel.h"
 #include "syslog.h"
 #include "buf.h"
 #include "disklabel.h"
 #include "syslog.h"
-#include "user.h"
 
 /*
  * Seek sort for disks.  We depend on the driver
 
 /*
  * Seek sort for disks.  We depend on the driver
index 3b8c137..ded8aff 100644 (file)
@@ -4,25 +4,24 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_inode.c 7.37 (Berkeley) %G%
+ *     @(#)ufs_inode.c 7.38 (Berkeley) %G%
  */
 
 #include "param.h"
 #include "systm.h"
 #include "mount.h"
  */
 
 #include "param.h"
 #include "systm.h"
 #include "mount.h"
-#include "user.h"
 #include "proc.h"
 #include "file.h"
 #include "buf.h"
 #include "proc.h"
 #include "file.h"
 #include "buf.h"
-#include "cmap.h"
 #include "vnode.h"
 #include "vnode.h"
-#include "../ufs/quota.h"
-#include "../ufs/inode.h"
-#include "../ufs/fs.h"
-#include "../ufs/ufsmount.h"
 #include "kernel.h"
 #include "malloc.h"
 
 #include "kernel.h"
 #include "malloc.h"
 
+#include "quota.h"
+#include "inode.h"
+#include "fs.h"
+#include "ufsmount.h"
+
 #define        INOHSZ  512
 #if    ((INOHSZ&(INOHSZ-1)) == 0)
 #define        INOHASH(dev,ino)        (((dev)+(ino))&(INOHSZ-1))
 #define        INOHSZ  512
 #if    ((INOHSZ&(INOHSZ-1)) == 0)
 #define        INOHASH(dev,ino)        (((dev)+(ino))&(INOHSZ-1))
@@ -646,14 +645,13 @@ ilock(ip)
 
        while (ip->i_flag & ILOCKED) {
                ip->i_flag |= IWANT;
 
        while (ip->i_flag & ILOCKED) {
                ip->i_flag |= IWANT;
-               if (ip->i_spare0 == u.u_procp->p_pid)
+               if (ip->i_spare0 == curproc->p_pid)
                        panic("locking against myself");
                        panic("locking against myself");
-               ip->i_spare1 = u.u_procp->p_pid;
+               ip->i_spare1 = curproc->p_pid;
                (void) sleep((caddr_t)ip, PINOD);
        }
        ip->i_spare1 = 0;
                (void) sleep((caddr_t)ip, PINOD);
        }
        ip->i_spare1 = 0;
-       ip->i_spare0 = u.u_procp->p_pid;
-       u.u_spare[0]++;
+       ip->i_spare0 = curproc->p_pid;
        ip->i_flag |= ILOCKED;
 }
 
        ip->i_flag |= ILOCKED;
 }
 
@@ -667,7 +665,6 @@ iunlock(ip)
        if ((ip->i_flag & ILOCKED) == 0)
                vprint("iunlock: unlocked inode", ITOV(ip));
        ip->i_spare0 = 0;
        if ((ip->i_flag & ILOCKED) == 0)
                vprint("iunlock: unlocked inode", ITOV(ip));
        ip->i_spare0 = 0;
-       u.u_spare[0]--;
        ip->i_flag &= ~ILOCKED;
        if (ip->i_flag&IWANT) {
                ip->i_flag &= ~IWANT;
        ip->i_flag &= ~ILOCKED;
        if (ip->i_flag&IWANT) {
                ip->i_flag &= ~IWANT;
index 4dcab13..36725fa 100644 (file)
@@ -7,25 +7,21 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_lockf.c 7.2 (Berkeley) %G%
+ *     @(#)ufs_lockf.c 7.3 (Berkeley) %G%
  */
 
 #include "param.h"
 #include "systm.h"
  */
 
 #include "param.h"
 #include "systm.h"
-#include "user.h"
 #include "kernel.h"
 #include "file.h"
 #include "proc.h"
 #include "kernel.h"
 #include "file.h"
 #include "proc.h"
-#include "socketvar.h"
-#include "socket.h"
 #include "vnode.h"
 #include "vnode.h"
-#include "ioctl.h"
-#include "tty.h"
 #include "malloc.h"
 #include "fcntl.h"
 #include "malloc.h"
 #include "fcntl.h"
-#include "../ufs/lockf.h"
-#include "../ufs/quota.h"
-#include "../ufs/inode.h"
+
+#include "lockf.h"
+#include "quota.h"
+#include "inode.h"
 
 /*
  * This variable controls the maximum number of processes that will
 
 /*
  * This variable controls the maximum number of processes that will
index f57879a..4b225fd 100644 (file)
@@ -4,17 +4,18 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_lookup.c        7.27 (Berkeley) %G%
+ *     @(#)ufs_lookup.c        7.28 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
-#include "user.h"
+#include "namei.h"
 #include "buf.h"
 #include "file.h"
 #include "vnode.h"
 #include "buf.h"
 #include "file.h"
 #include "vnode.h"
-#include "../ufs/quota.h"
-#include "../ufs/inode.h"
-#include "../ufs/fs.h"
+
+#include "quota.h"
+#include "inode.h"
+#include "fs.h"
 
 struct nchstats nchstats;
 int    dirchk = 1;
 
 struct nchstats nchstats;
 int    dirchk = 1;
index 074ef60..d5b5ec3 100644 (file)
@@ -7,23 +7,22 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_quota.c 7.6 (Berkeley) %G%
+ *     @(#)ufs_quota.c 7.7 (Berkeley) %G%
  */
 #include "param.h"
  */
 #include "param.h"
-#include "time.h"
 #include "kernel.h"
 #include "systm.h"
 #include "kernel.h"
 #include "systm.h"
-#include "ucred.h"
 #include "namei.h"
 #include "namei.h"
-#include "errno.h"
 #include "malloc.h"
 #include "file.h"
 #include "malloc.h"
 #include "file.h"
+#include "proc.h"
 #include "vnode.h"
 #include "mount.h"
 #include "vnode.h"
 #include "mount.h"
-#include "../ufs/fs.h"
-#include "../ufs/quota.h"
-#include "../ufs/inode.h"
-#include "../ufs/ufsmount.h"
+
+#include "fs.h"
+#include "quota.h"
+#include "inode.h"
+#include "ufsmount.h"
 
 /*
  * Quota name to error message mapping.
 
 /*
  * Quota name to error message mapping.
@@ -320,8 +319,8 @@ chkdquot(ip)
 /*
  * Q_QUOTAON - set up a quota file for a particular file system.
  */
 /*
  * Q_QUOTAON - set up a quota file for a particular file system.
  */
-quotaon(ndp, mp, type, fname)
-       register struct nameidata *ndp;
+quotaon(p, mp, type, fname)
+       struct proc *p;
        struct mount *mp;
        register int type;
        caddr_t fname;
        struct mount *mp;
        register int type;
        caddr_t fname;
@@ -331,13 +330,14 @@ quotaon(ndp, mp, type, fname)
        struct vnode *nextvp;
        struct dquot *dq;
        int error;
        struct vnode *nextvp;
        struct dquot *dq;
        int error;
-       
+       struct nameidata nd;
+
        vpp = &ump->um_quotas[type];
        vpp = &ump->um_quotas[type];
-       ndp->ni_segflg = UIO_USERSPACE;
-       ndp->ni_dirp = fname;
-       if (error = vn_open(ndp, FREAD|FWRITE, 0))
+       nd.ni_segflg = UIO_USERSPACE;
+       nd.ni_dirp = fname;
+       if (error = vn_open(&nd, p, FREAD|FWRITE, 0))
                return (error);
                return (error);
-       vp = ndp->ni_vp;
+       vp = nd.ni_vp;
        if (vp->v_type != VREG) {
                vrele(vp);
                return (EACCES);
        if (vp->v_type != VREG) {
                vrele(vp);
                return (EACCES);
@@ -356,8 +356,8 @@ quotaon(ndp, mp, type, fname)
         * Save the credential of the process that turned on quotas.
         * Set up the time limits for this quota.
         */
         * Save the credential of the process that turned on quotas.
         * Set up the time limits for this quota.
         */
-       crhold(ndp->ni_cred);
-       ump->um_cred[type] = ndp->ni_cred;
+       crhold(p->p_ucred);
+       ump->um_cred[type] = p->p_ucred;
        ump->um_btime[type] = MAX_DQ_TIME;
        ump->um_itime[type] = MAX_IQ_TIME;
        if (dqget(NULLVP, 0, ump, type, &dq) == 0) {
        ump->um_btime[type] = MAX_DQ_TIME;
        ump->um_itime[type] = MAX_IQ_TIME;
        if (dqget(NULLVP, 0, ump, type, &dq) == 0) {
index 73d8ccc..e8174fa 100644 (file)
@@ -4,12 +4,12 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_vfsops.c        7.50 (Berkeley) %G%
+ *     @(#)ufs_vfsops.c        7.51 (Berkeley) %G%
  */
 
 #include "param.h"
 #include "systm.h"
  */
 
 #include "param.h"
 #include "systm.h"
-#include "user.h"
+#include "namei.h"
 #include "proc.h"
 #include "kernel.h"
 #include "vnode.h"
 #include "proc.h"
 #include "kernel.h"
 #include "vnode.h"
 #include "ioctl.h"
 #include "errno.h"
 #include "malloc.h"
 #include "ioctl.h"
 #include "errno.h"
 #include "malloc.h"
-#include "../ufs/quota.h"
-#include "../ufs/fs.h"
-#include "../ufs/ufsmount.h"
-#include "../ufs/inode.h"
 #include "ioctl.h"
 #include "disklabel.h"
 #include "stat.h"
 
 #include "ioctl.h"
 #include "disklabel.h"
 #include "stat.h"
 
+#include "quota.h"
+#include "fs.h"
+#include "ufsmount.h"
+#include "inode.h"
+
 /*
  * ufs vfs operations.
  */
 /*
  * ufs vfs operations.
  */
@@ -402,26 +403,25 @@ ufs_quotactl(mp, cmds, uid, arg)
        uid_t uid;
        caddr_t arg;
 {
        uid_t uid;
        caddr_t arg;
 {
-       register struct nameidata *ndp = &u.u_nd;
        struct ufsmount *ump = VFSTOUFS(mp);
        struct ufsmount *ump = VFSTOUFS(mp);
-       struct proc *p = u.u_procp;     /* XXX */
+       struct proc *p = curproc;       /* XXX */
        int cmd, type, error;
 
 #ifndef QUOTA
        return (EOPNOTSUPP);
 #else
        if (uid == -1)
        int cmd, type, error;
 
 #ifndef QUOTA
        return (EOPNOTSUPP);
 #else
        if (uid == -1)
-               uid = p->p_ruid;
+               uid = p->p_cred->p_ruid;
        cmd = cmds >> SUBCMDSHIFT;
 
        switch (cmd) {
        case Q_GETQUOTA:
        case Q_SYNC:
        cmd = cmds >> SUBCMDSHIFT;
 
        switch (cmd) {
        case Q_GETQUOTA:
        case Q_SYNC:
-               if (uid == p->p_ruid)
+               if (uid == p->p_cred->p_ruid)
                        break;
                /* fall through */
        default:
                        break;
                /* fall through */
        default:
-               if (error = suser(ndp->ni_cred, &u.u_acflag))
+               if (error = suser(p->p_ucred, &p->p_acflag))
                        return (error);
        }
 
                        return (error);
        }
 
@@ -432,7 +432,7 @@ ufs_quotactl(mp, cmds, uid, arg)
        switch (cmd) {
 
        case Q_QUOTAON:
        switch (cmd) {
 
        case Q_QUOTAON:
-               return (quotaon(ndp, mp, type, arg));
+               return (quotaon(p, mp, type, arg));
 
        case Q_QUOTAOFF:
                if (vfs_busy(mp))
 
        case Q_QUOTAOFF:
                if (vfs_busy(mp))
@@ -737,7 +737,7 @@ getmdev(devvpp, fname, ndp)
        ndp->ni_nameiop = LOOKUP | FOLLOW;
        ndp->ni_segflg = UIO_USERSPACE;
        ndp->ni_dirp = fname;
        ndp->ni_nameiop = LOOKUP | FOLLOW;
        ndp->ni_segflg = UIO_USERSPACE;
        ndp->ni_dirp = fname;
-       if (error = namei(ndp))
+       if (error = namei(ndp, curproc))                /* XXX */
                return (error);
        vp = ndp->ni_vp;
        if (vp->v_type != VBLK) {
                return (error);
        vp = ndp->ni_vp;
        if (vp->v_type != VBLK) {
index 85a6f50..9f535ba 100644 (file)
@@ -4,29 +4,29 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_vnops.c 7.57 (Berkeley) %G%
+ *     @(#)ufs_vnops.c 7.58 (Berkeley) %G%
  */
 
 #include "param.h"
 #include "systm.h"
  */
 
 #include "param.h"
 #include "systm.h"
-#include "user.h"
+#include "namei.h"
+#include "resourcevar.h"
 #include "kernel.h"
 #include "file.h"
 #include "stat.h"
 #include "buf.h"
 #include "proc.h"
 #include "kernel.h"
 #include "file.h"
 #include "stat.h"
 #include "buf.h"
 #include "proc.h"
-#include "socket.h"
-#include "socketvar.h"
 #include "conf.h"
 #include "mount.h"
 #include "vnode.h"
 #include "specdev.h"
 #include "fcntl.h"
 #include "malloc.h"
 #include "conf.h"
 #include "mount.h"
 #include "vnode.h"
 #include "specdev.h"
 #include "fcntl.h"
 #include "malloc.h"
-#include "../ufs/lockf.h"
-#include "../ufs/quota.h"
-#include "../ufs/inode.h"
-#include "../ufs/fs.h"
+
+#include "lockf.h"
+#include "quota.h"
+#include "inode.h"
+#include "fs.h"
 
 /*
  * Global vfs data structures for ufs
 
 /*
  * Global vfs data structures for ufs
@@ -112,8 +112,7 @@ int spec_lookup(),
        spec_select(),
        ufsspec_close(),
        spec_advlock(),
        spec_select(),
        ufsspec_close(),
        spec_advlock(),
-       spec_badop(),
-       nullop();
+       spec_badop();
 
 struct vnodeops spec_inodeops = {
        spec_lookup,            /* lookup */
 
 struct vnodeops spec_inodeops = {
        spec_lookup,            /* lookup */
@@ -401,6 +400,7 @@ ufs_setattr(vp, vap, cred)
        register struct vattr *vap;
        register struct ucred *cred;
 {
        register struct vattr *vap;
        register struct ucred *cred;
 {
+       struct proc *p = curproc;               /* XXX */
        register struct inode *ip = VTOI(vp);
        int error = 0;
 
        register struct inode *ip = VTOI(vp);
        int error = 0;
 
@@ -417,7 +417,7 @@ ufs_setattr(vp, vap, cred)
         * Go through the fields and update iff not VNOVAL.
         */
        if (vap->va_uid != (u_short)VNOVAL || vap->va_gid != (u_short)VNOVAL)
         * Go through the fields and update iff not VNOVAL.
         */
        if (vap->va_uid != (u_short)VNOVAL || vap->va_gid != (u_short)VNOVAL)
-               if (error = chown1(vp, vap->va_uid, vap->va_gid, cred))
+               if (error = chown1(vp, vap->va_uid, vap->va_gid, p))
                        return (error);
        if (vap->va_size != VNOVAL) {
                if (vp->v_type == VDIR)
                        return (error);
        if (vap->va_size != VNOVAL) {
                if (vp->v_type == VDIR)
@@ -427,7 +427,7 @@ ufs_setattr(vp, vap, cred)
        }
        if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) {
                if (cred->cr_uid != ip->i_uid &&
        }
        if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) {
                if (cred->cr_uid != ip->i_uid &&
-                   (error = suser(cred, &u.u_acflag)))
+                   (error = suser(cred, &p->p_acflag)))
                        return (error);
                if (vap->va_atime.tv_sec != VNOVAL)
                        ip->i_flag |= IACC;
                        return (error);
                if (vap->va_atime.tv_sec != VNOVAL)
                        ip->i_flag |= IACC;
@@ -438,10 +438,10 @@ ufs_setattr(vp, vap, cred)
                        return (error);
        }
        if (vap->va_mode != (u_short)VNOVAL)
                        return (error);
        }
        if (vap->va_mode != (u_short)VNOVAL)
-               error = chmod1(vp, (int)vap->va_mode, cred);
+               error = chmod1(vp, (int)vap->va_mode, p);
        if (vap->va_flags != VNOVAL) {
                if (cred->cr_uid != ip->i_uid &&
        if (vap->va_flags != VNOVAL) {
                if (cred->cr_uid != ip->i_uid &&
-                   (error = suser(cred, &u.u_acflag)))
+                   (error = suser(cred, &p->p_acflag)))
                        return (error);
                if (cred->cr_uid == 0) {
                        ip->i_flags = vap->va_flags;
                        return (error);
                if (cred->cr_uid == 0) {
                        ip->i_flags = vap->va_flags;
@@ -458,16 +458,17 @@ ufs_setattr(vp, vap, cred)
  * Change the mode on a file.
  * Inode must be locked before calling.
  */
  * Change the mode on a file.
  * Inode must be locked before calling.
  */
-chmod1(vp, mode, cred)
+chmod1(vp, mode, p)
        register struct vnode *vp;
        register int mode;
        register struct vnode *vp;
        register int mode;
-       struct ucred *cred;
+       struct proc *p;
 {
 {
+       register struct ucred *cred = p->p_ucred;
        register struct inode *ip = VTOI(vp);
        int error;
 
        if (cred->cr_uid != ip->i_uid &&
        register struct inode *ip = VTOI(vp);
        int error;
 
        if (cred->cr_uid != ip->i_uid &&
-           (error = suser(cred, &u.u_acflag)))
+           (error = suser(cred, &p->p_acflag)))
                return (error);
        if (cred->cr_uid) {
                if (vp->v_type != VDIR && (mode & ISVTX))
                return (error);
        if (cred->cr_uid) {
                if (vp->v_type != VDIR && (mode & ISVTX))
@@ -487,13 +488,14 @@ chmod1(vp, mode, cred)
  * Perform chown operation on inode ip;
  * inode must be locked prior to call.
  */
  * Perform chown operation on inode ip;
  * inode must be locked prior to call.
  */
-chown1(vp, uid, gid, cred)
+chown1(vp, uid, gid, p)
        register struct vnode *vp;
        uid_t uid;
        gid_t gid;
        register struct vnode *vp;
        uid_t uid;
        gid_t gid;
-       struct ucred *cred;
+       struct proc *p;
 {
        register struct inode *ip = VTOI(vp);
 {
        register struct inode *ip = VTOI(vp);
+       register struct ucred *cred = p->p_ucred;
        uid_t ouid;
        gid_t ogid;
        int error = 0;
        uid_t ouid;
        gid_t ogid;
        int error = 0;
@@ -513,7 +515,7 @@ chown1(vp, uid, gid, cred)
         */
        if ((cred->cr_uid != ip->i_uid || uid != ip->i_uid ||
            !groupmember((gid_t)gid, cred)) &&
         */
        if ((cred->cr_uid != ip->i_uid || uid != ip->i_uid ||
            !groupmember((gid_t)gid, cred)) &&
-           (error = suser(cred, &u.u_acflag)))
+           (error = suser(cred, &p->p_acflag)))
                return (error);
        ouid = ip->i_uid;
        ogid = ip->i_gid;
                return (error);
        ouid = ip->i_uid;
        ogid = ip->i_gid;
@@ -656,6 +658,7 @@ ufs_write(vp, uio, ioflag, cred)
        int ioflag;
        struct ucred *cred;
 {
        int ioflag;
        struct ucred *cred;
 {
+       struct proc *p = curproc;               /* XXX */
        register struct inode *ip = VTOI(vp);
        register struct fs *fs;
        struct buf *bp;
        register struct inode *ip = VTOI(vp);
        register struct fs *fs;
        struct buf *bp;
@@ -692,8 +695,8 @@ ufs_write(vp, uio, ioflag, cred)
         */
        if (vp->v_type == VREG &&
            uio->uio_offset + uio->uio_resid >
         */
        if (vp->v_type == VREG &&
            uio->uio_offset + uio->uio_resid >
-             u.u_rlimit[RLIMIT_FSIZE].rlim_cur) {
-               psignal(u.u_procp, SIGXFSZ);
+             p->p_rlimit[RLIMIT_FSIZE].rlim_cur) {
+               psignal(p, SIGXFSZ);
                return (EFBIG);
        }
        resid = uio->uio_resid;
                return (EFBIG);
        }
        resid = uio->uio_resid;
@@ -894,6 +897,7 @@ ufs_link(vp, ndp)
 ufs_rename(fndp, tndp)
        register struct nameidata *fndp, *tndp;
 {
 ufs_rename(fndp, tndp)
        register struct nameidata *fndp, *tndp;
 {
+       struct proc *p = curproc;               /* XXX */
        register struct inode *ip, *xp, *dp;
        struct dirtemplate dirbuf;
        int doingdirectory = 0, oldparent = 0, newparent = 0;
        register struct inode *ip, *xp, *dp;
        struct dirtemplate dirbuf;
        int doingdirectory = 0, oldparent = 0, newparent = 0;
@@ -970,7 +974,7 @@ ufs_rename(fndp, tndp)
                                iput(xp);
                        if (error = checkpath(ip, dp, tndp->ni_cred))
                                goto out;
                                iput(xp);
                        if (error = checkpath(ip, dp, tndp->ni_cred))
                                goto out;
-                       if (error = namei(tndp))
+                       if (error = namei(tndp, p))
                                goto out;
                        xp = NULL;
                        if (tndp->ni_vp)
                                goto out;
                        xp = NULL;
                        if (tndp->ni_vp)
@@ -1092,7 +1096,7 @@ ufs_rename(fndp, tndp)
         */
        fndp->ni_nameiop &= ~(MODMASK | OPMASK);
        fndp->ni_nameiop |= DELETE | LOCKPARENT | LOCKLEAF;
         */
        fndp->ni_nameiop &= ~(MODMASK | OPMASK);
        fndp->ni_nameiop |= DELETE | LOCKPARENT | LOCKLEAF;
-       (void)namei(fndp);
+       (void)namei(fndp, p);
        if (fndp->ni_vp != NULL) {
                xp = VTOI(fndp->ni_vp);
                dp = VTOI(fndp->ni_dvp);
        if (fndp->ni_vp != NULL) {
                xp = VTOI(fndp->ni_vp);
                dp = VTOI(fndp->ni_dvp);
@@ -1189,6 +1193,7 @@ ufs_mkdir(ndp, vap)
        struct nameidata *ndp;
        struct vattr *vap;
 {
        struct nameidata *ndp;
        struct vattr *vap;
 {
+       struct proc *p = curproc;               /* XXX */
        register struct inode *ip, *dp;
        struct inode *tip;
        struct vnode *dvp;
        register struct inode *ip, *dp;
        struct inode *tip;
        struct vnode *dvp;
@@ -1273,7 +1278,7 @@ ufs_mkdir(ndp, vap)
        if (error = direnter(ip, ndp)) {
                ndp->ni_nameiop &= ~(MODMASK | OPMASK);
                ndp->ni_nameiop |= LOOKUP | LOCKLEAF | NOCACHE;
        if (error = direnter(ip, ndp)) {
                ndp->ni_nameiop &= ~(MODMASK | OPMASK);
                ndp->ni_nameiop |= LOOKUP | LOCKLEAF | NOCACHE;
-               error = namei(ndp);
+               error = namei(ndp, p);
                if (!error) {
                        iput(dp);
                        dp = VTOI(ndp->ni_vp);
                if (!error) {
                        iput(dp);
                        dp = VTOI(ndp->ni_vp);
index 084687a..19e9524 100644 (file)
@@ -4,20 +4,20 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)lfs_alloc.c 7.23 (Berkeley) %G%
+ *     @(#)lfs_alloc.c 7.24 (Berkeley) %G%
  */
 
 #include "param.h"
 #include "systm.h"
 #include "buf.h"
  */
 
 #include "param.h"
 #include "systm.h"
 #include "buf.h"
-#include "user.h"
+#include "proc.h"
 #include "vnode.h"
 #include "kernel.h"
 #include "syslog.h"
 #include "vnode.h"
 #include "kernel.h"
 #include "syslog.h"
-#include "cmap.h"
-#include "../ufs/quota.h"
-#include "../ufs/inode.h"
-#include "../ufs/fs.h"
+
+#include "quota.h"
+#include "inode.h"
+#include "fs.h"
 
 extern u_long          hashalloc();
 extern ino_t           ialloccg();
 
 extern u_long          hashalloc();
 extern ino_t           ialloccg();
@@ -58,7 +58,7 @@ alloc(ip, lbn, bpref, size, bnp)
        register struct fs *fs;
        register struct buf *bp;
        int cg, error;
        register struct fs *fs;
        register struct buf *bp;
        int cg, error;
-       struct ucred *cred = u.u_cred;          /* XXX */
+       struct ucred *cred = curproc->p_ucred;          /* XXX */
        
        *bnp = 0;
        fs = ip->i_fs;
        
        *bnp = 0;
        fs = ip->i_fs;
@@ -120,7 +120,7 @@ realloccg(ip, lbprev, bpref, osize, nsize, bpp)
        struct buf *bp, *obp;
        int cg, request, error;
        daddr_t bprev, bno;
        struct buf *bp, *obp;
        int cg, request, error;
        daddr_t bprev, bno;
-       struct ucred *cred = u.u_cred;          /* XXX */
+       struct ucred *cred = curproc->p_ucred;          /* XXX */
        
        *bpp = 0;
        fs = ip->i_fs;
        
        *bpp = 0;
        fs = ip->i_fs;
@@ -872,7 +872,7 @@ blkfree(ip, bno, size)
        struct buf *bp;
        int error, cg, blk, frags, bbase;
        register int i;
        struct buf *bp;
        int error, cg, blk, frags, bbase;
        register int i;
-       struct ucred *cred = u.u_cred;  /* XXX */
+       struct ucred *cred = curproc->p_ucred;  /* XXX */
 
        fs = ip->i_fs;
        if ((unsigned)size > fs->fs_bsize || fragoff(fs, size) != 0) {
 
        fs = ip->i_fs;
        if ((unsigned)size > fs->fs_bsize || fragoff(fs, size) != 0) {
index 44110e5..2af6341 100644 (file)
@@ -4,19 +4,19 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)lfs_balloc.c        7.11 (Berkeley) %G%
+ *     @(#)lfs_balloc.c        7.12 (Berkeley) %G%
  */
 
 #include "param.h"
 #include "systm.h"
  */
 
 #include "param.h"
 #include "systm.h"
-#include "user.h"
 #include "buf.h"
 #include "proc.h"
 #include "file.h"
 #include "vnode.h"
 #include "buf.h"
 #include "proc.h"
 #include "file.h"
 #include "vnode.h"
-#include "../ufs/quota.h"
-#include "../ufs/inode.h"
-#include "../ufs/fs.h"
+
+#include "quota.h"
+#include "inode.h"
+#include "fs.h"
 
 /*
  * Bmap defines the structure of file system storage
 
 /*
  * Bmap defines the structure of file system storage
index 6b0bb1e..3b442e7 100644 (file)
@@ -4,25 +4,24 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)lfs_inode.c 7.37 (Berkeley) %G%
+ *     @(#)lfs_inode.c 7.38 (Berkeley) %G%
  */
 
 #include "param.h"
 #include "systm.h"
 #include "mount.h"
  */
 
 #include "param.h"
 #include "systm.h"
 #include "mount.h"
-#include "user.h"
 #include "proc.h"
 #include "file.h"
 #include "buf.h"
 #include "proc.h"
 #include "file.h"
 #include "buf.h"
-#include "cmap.h"
 #include "vnode.h"
 #include "vnode.h"
-#include "../ufs/quota.h"
-#include "../ufs/inode.h"
-#include "../ufs/fs.h"
-#include "../ufs/ufsmount.h"
 #include "kernel.h"
 #include "malloc.h"
 
 #include "kernel.h"
 #include "malloc.h"
 
+#include "quota.h"
+#include "inode.h"
+#include "fs.h"
+#include "ufsmount.h"
+
 #define        INOHSZ  512
 #if    ((INOHSZ&(INOHSZ-1)) == 0)
 #define        INOHASH(dev,ino)        (((dev)+(ino))&(INOHSZ-1))
 #define        INOHSZ  512
 #if    ((INOHSZ&(INOHSZ-1)) == 0)
 #define        INOHASH(dev,ino)        (((dev)+(ino))&(INOHSZ-1))
@@ -646,14 +645,13 @@ ilock(ip)
 
        while (ip->i_flag & ILOCKED) {
                ip->i_flag |= IWANT;
 
        while (ip->i_flag & ILOCKED) {
                ip->i_flag |= IWANT;
-               if (ip->i_spare0 == u.u_procp->p_pid)
+               if (ip->i_spare0 == curproc->p_pid)
                        panic("locking against myself");
                        panic("locking against myself");
-               ip->i_spare1 = u.u_procp->p_pid;
+               ip->i_spare1 = curproc->p_pid;
                (void) sleep((caddr_t)ip, PINOD);
        }
        ip->i_spare1 = 0;
                (void) sleep((caddr_t)ip, PINOD);
        }
        ip->i_spare1 = 0;
-       ip->i_spare0 = u.u_procp->p_pid;
-       u.u_spare[0]++;
+       ip->i_spare0 = curproc->p_pid;
        ip->i_flag |= ILOCKED;
 }
 
        ip->i_flag |= ILOCKED;
 }
 
@@ -667,7 +665,6 @@ iunlock(ip)
        if ((ip->i_flag & ILOCKED) == 0)
                vprint("iunlock: unlocked inode", ITOV(ip));
        ip->i_spare0 = 0;
        if ((ip->i_flag & ILOCKED) == 0)
                vprint("iunlock: unlocked inode", ITOV(ip));
        ip->i_spare0 = 0;
-       u.u_spare[0]--;
        ip->i_flag &= ~ILOCKED;
        if (ip->i_flag&IWANT) {
                ip->i_flag &= ~IWANT;
        ip->i_flag &= ~ILOCKED;
        if (ip->i_flag&IWANT) {
                ip->i_flag &= ~IWANT;
index c264471..cf02d15 100644 (file)
@@ -4,12 +4,12 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)lfs_vfsops.c        7.50 (Berkeley) %G%
+ *     @(#)lfs_vfsops.c        7.51 (Berkeley) %G%
  */
 
 #include "param.h"
 #include "systm.h"
  */
 
 #include "param.h"
 #include "systm.h"
-#include "user.h"
+#include "namei.h"
 #include "proc.h"
 #include "kernel.h"
 #include "vnode.h"
 #include "proc.h"
 #include "kernel.h"
 #include "vnode.h"
 #include "ioctl.h"
 #include "errno.h"
 #include "malloc.h"
 #include "ioctl.h"
 #include "errno.h"
 #include "malloc.h"
-#include "../ufs/quota.h"
-#include "../ufs/fs.h"
-#include "../ufs/ufsmount.h"
-#include "../ufs/inode.h"
 #include "ioctl.h"
 #include "disklabel.h"
 #include "stat.h"
 
 #include "ioctl.h"
 #include "disklabel.h"
 #include "stat.h"
 
+#include "quota.h"
+#include "fs.h"
+#include "ufsmount.h"
+#include "inode.h"
+
 /*
  * ufs vfs operations.
  */
 /*
  * ufs vfs operations.
  */
@@ -402,26 +403,25 @@ ufs_quotactl(mp, cmds, uid, arg)
        uid_t uid;
        caddr_t arg;
 {
        uid_t uid;
        caddr_t arg;
 {
-       register struct nameidata *ndp = &u.u_nd;
        struct ufsmount *ump = VFSTOUFS(mp);
        struct ufsmount *ump = VFSTOUFS(mp);
-       struct proc *p = u.u_procp;     /* XXX */
+       struct proc *p = curproc;       /* XXX */
        int cmd, type, error;
 
 #ifndef QUOTA
        return (EOPNOTSUPP);
 #else
        if (uid == -1)
        int cmd, type, error;
 
 #ifndef QUOTA
        return (EOPNOTSUPP);
 #else
        if (uid == -1)
-               uid = p->p_ruid;
+               uid = p->p_cred->p_ruid;
        cmd = cmds >> SUBCMDSHIFT;
 
        switch (cmd) {
        case Q_GETQUOTA:
        case Q_SYNC:
        cmd = cmds >> SUBCMDSHIFT;
 
        switch (cmd) {
        case Q_GETQUOTA:
        case Q_SYNC:
-               if (uid == p->p_ruid)
+               if (uid == p->p_cred->p_ruid)
                        break;
                /* fall through */
        default:
                        break;
                /* fall through */
        default:
-               if (error = suser(ndp->ni_cred, &u.u_acflag))
+               if (error = suser(p->p_ucred, &p->p_acflag))
                        return (error);
        }
 
                        return (error);
        }
 
@@ -432,7 +432,7 @@ ufs_quotactl(mp, cmds, uid, arg)
        switch (cmd) {
 
        case Q_QUOTAON:
        switch (cmd) {
 
        case Q_QUOTAON:
-               return (quotaon(ndp, mp, type, arg));
+               return (quotaon(p, mp, type, arg));
 
        case Q_QUOTAOFF:
                if (vfs_busy(mp))
 
        case Q_QUOTAOFF:
                if (vfs_busy(mp))
@@ -737,7 +737,7 @@ getmdev(devvpp, fname, ndp)
        ndp->ni_nameiop = LOOKUP | FOLLOW;
        ndp->ni_segflg = UIO_USERSPACE;
        ndp->ni_dirp = fname;
        ndp->ni_nameiop = LOOKUP | FOLLOW;
        ndp->ni_segflg = UIO_USERSPACE;
        ndp->ni_dirp = fname;
-       if (error = namei(ndp))
+       if (error = namei(ndp, curproc))                /* XXX */
                return (error);
        vp = ndp->ni_vp;
        if (vp->v_type != VBLK) {
                return (error);
        vp = ndp->ni_vp;
        if (vp->v_type != VBLK) {
index 2747d25..e50d7a6 100644 (file)
@@ -4,29 +4,29 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)lfs_vnops.c 7.57 (Berkeley) %G%
+ *     @(#)lfs_vnops.c 7.58 (Berkeley) %G%
  */
 
 #include "param.h"
 #include "systm.h"
  */
 
 #include "param.h"
 #include "systm.h"
-#include "user.h"
+#include "namei.h"
+#include "resourcevar.h"
 #include "kernel.h"
 #include "file.h"
 #include "stat.h"
 #include "buf.h"
 #include "proc.h"
 #include "kernel.h"
 #include "file.h"
 #include "stat.h"
 #include "buf.h"
 #include "proc.h"
-#include "socket.h"
-#include "socketvar.h"
 #include "conf.h"
 #include "mount.h"
 #include "vnode.h"
 #include "specdev.h"
 #include "fcntl.h"
 #include "malloc.h"
 #include "conf.h"
 #include "mount.h"
 #include "vnode.h"
 #include "specdev.h"
 #include "fcntl.h"
 #include "malloc.h"
-#include "../ufs/lockf.h"
-#include "../ufs/quota.h"
-#include "../ufs/inode.h"
-#include "../ufs/fs.h"
+
+#include "lockf.h"
+#include "quota.h"
+#include "inode.h"
+#include "fs.h"
 
 /*
  * Global vfs data structures for ufs
 
 /*
  * Global vfs data structures for ufs
@@ -112,8 +112,7 @@ int spec_lookup(),
        spec_select(),
        ufsspec_close(),
        spec_advlock(),
        spec_select(),
        ufsspec_close(),
        spec_advlock(),
-       spec_badop(),
-       nullop();
+       spec_badop();
 
 struct vnodeops spec_inodeops = {
        spec_lookup,            /* lookup */
 
 struct vnodeops spec_inodeops = {
        spec_lookup,            /* lookup */
@@ -401,6 +400,7 @@ ufs_setattr(vp, vap, cred)
        register struct vattr *vap;
        register struct ucred *cred;
 {
        register struct vattr *vap;
        register struct ucred *cred;
 {
+       struct proc *p = curproc;               /* XXX */
        register struct inode *ip = VTOI(vp);
        int error = 0;
 
        register struct inode *ip = VTOI(vp);
        int error = 0;
 
@@ -417,7 +417,7 @@ ufs_setattr(vp, vap, cred)
         * Go through the fields and update iff not VNOVAL.
         */
        if (vap->va_uid != (u_short)VNOVAL || vap->va_gid != (u_short)VNOVAL)
         * Go through the fields and update iff not VNOVAL.
         */
        if (vap->va_uid != (u_short)VNOVAL || vap->va_gid != (u_short)VNOVAL)
-               if (error = chown1(vp, vap->va_uid, vap->va_gid, cred))
+               if (error = chown1(vp, vap->va_uid, vap->va_gid, p))
                        return (error);
        if (vap->va_size != VNOVAL) {
                if (vp->v_type == VDIR)
                        return (error);
        if (vap->va_size != VNOVAL) {
                if (vp->v_type == VDIR)
@@ -427,7 +427,7 @@ ufs_setattr(vp, vap, cred)
        }
        if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) {
                if (cred->cr_uid != ip->i_uid &&
        }
        if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) {
                if (cred->cr_uid != ip->i_uid &&
-                   (error = suser(cred, &u.u_acflag)))
+                   (error = suser(cred, &p->p_acflag)))
                        return (error);
                if (vap->va_atime.tv_sec != VNOVAL)
                        ip->i_flag |= IACC;
                        return (error);
                if (vap->va_atime.tv_sec != VNOVAL)
                        ip->i_flag |= IACC;
@@ -438,10 +438,10 @@ ufs_setattr(vp, vap, cred)
                        return (error);
        }
        if (vap->va_mode != (u_short)VNOVAL)
                        return (error);
        }
        if (vap->va_mode != (u_short)VNOVAL)
-               error = chmod1(vp, (int)vap->va_mode, cred);
+               error = chmod1(vp, (int)vap->va_mode, p);
        if (vap->va_flags != VNOVAL) {
                if (cred->cr_uid != ip->i_uid &&
        if (vap->va_flags != VNOVAL) {
                if (cred->cr_uid != ip->i_uid &&
-                   (error = suser(cred, &u.u_acflag)))
+                   (error = suser(cred, &p->p_acflag)))
                        return (error);
                if (cred->cr_uid == 0) {
                        ip->i_flags = vap->va_flags;
                        return (error);
                if (cred->cr_uid == 0) {
                        ip->i_flags = vap->va_flags;
@@ -458,16 +458,17 @@ ufs_setattr(vp, vap, cred)
  * Change the mode on a file.
  * Inode must be locked before calling.
  */
  * Change the mode on a file.
  * Inode must be locked before calling.
  */
-chmod1(vp, mode, cred)
+chmod1(vp, mode, p)
        register struct vnode *vp;
        register int mode;
        register struct vnode *vp;
        register int mode;
-       struct ucred *cred;
+       struct proc *p;
 {
 {
+       register struct ucred *cred = p->p_ucred;
        register struct inode *ip = VTOI(vp);
        int error;
 
        if (cred->cr_uid != ip->i_uid &&
        register struct inode *ip = VTOI(vp);
        int error;
 
        if (cred->cr_uid != ip->i_uid &&
-           (error = suser(cred, &u.u_acflag)))
+           (error = suser(cred, &p->p_acflag)))
                return (error);
        if (cred->cr_uid) {
                if (vp->v_type != VDIR && (mode & ISVTX))
                return (error);
        if (cred->cr_uid) {
                if (vp->v_type != VDIR && (mode & ISVTX))
@@ -487,13 +488,14 @@ chmod1(vp, mode, cred)
  * Perform chown operation on inode ip;
  * inode must be locked prior to call.
  */
  * Perform chown operation on inode ip;
  * inode must be locked prior to call.
  */
-chown1(vp, uid, gid, cred)
+chown1(vp, uid, gid, p)
        register struct vnode *vp;
        uid_t uid;
        gid_t gid;
        register struct vnode *vp;
        uid_t uid;
        gid_t gid;
-       struct ucred *cred;
+       struct proc *p;
 {
        register struct inode *ip = VTOI(vp);
 {
        register struct inode *ip = VTOI(vp);
+       register struct ucred *cred = p->p_ucred;
        uid_t ouid;
        gid_t ogid;
        int error = 0;
        uid_t ouid;
        gid_t ogid;
        int error = 0;
@@ -513,7 +515,7 @@ chown1(vp, uid, gid, cred)
         */
        if ((cred->cr_uid != ip->i_uid || uid != ip->i_uid ||
            !groupmember((gid_t)gid, cred)) &&
         */
        if ((cred->cr_uid != ip->i_uid || uid != ip->i_uid ||
            !groupmember((gid_t)gid, cred)) &&
-           (error = suser(cred, &u.u_acflag)))
+           (error = suser(cred, &p->p_acflag)))
                return (error);
        ouid = ip->i_uid;
        ogid = ip->i_gid;
                return (error);
        ouid = ip->i_uid;
        ogid = ip->i_gid;
@@ -656,6 +658,7 @@ ufs_write(vp, uio, ioflag, cred)
        int ioflag;
        struct ucred *cred;
 {
        int ioflag;
        struct ucred *cred;
 {
+       struct proc *p = curproc;               /* XXX */
        register struct inode *ip = VTOI(vp);
        register struct fs *fs;
        struct buf *bp;
        register struct inode *ip = VTOI(vp);
        register struct fs *fs;
        struct buf *bp;
@@ -692,8 +695,8 @@ ufs_write(vp, uio, ioflag, cred)
         */
        if (vp->v_type == VREG &&
            uio->uio_offset + uio->uio_resid >
         */
        if (vp->v_type == VREG &&
            uio->uio_offset + uio->uio_resid >
-             u.u_rlimit[RLIMIT_FSIZE].rlim_cur) {
-               psignal(u.u_procp, SIGXFSZ);
+             p->p_rlimit[RLIMIT_FSIZE].rlim_cur) {
+               psignal(p, SIGXFSZ);
                return (EFBIG);
        }
        resid = uio->uio_resid;
                return (EFBIG);
        }
        resid = uio->uio_resid;
@@ -894,6 +897,7 @@ ufs_link(vp, ndp)
 ufs_rename(fndp, tndp)
        register struct nameidata *fndp, *tndp;
 {
 ufs_rename(fndp, tndp)
        register struct nameidata *fndp, *tndp;
 {
+       struct proc *p = curproc;               /* XXX */
        register struct inode *ip, *xp, *dp;
        struct dirtemplate dirbuf;
        int doingdirectory = 0, oldparent = 0, newparent = 0;
        register struct inode *ip, *xp, *dp;
        struct dirtemplate dirbuf;
        int doingdirectory = 0, oldparent = 0, newparent = 0;
@@ -970,7 +974,7 @@ ufs_rename(fndp, tndp)
                                iput(xp);
                        if (error = checkpath(ip, dp, tndp->ni_cred))
                                goto out;
                                iput(xp);
                        if (error = checkpath(ip, dp, tndp->ni_cred))
                                goto out;
-                       if (error = namei(tndp))
+                       if (error = namei(tndp, p))
                                goto out;
                        xp = NULL;
                        if (tndp->ni_vp)
                                goto out;
                        xp = NULL;
                        if (tndp->ni_vp)
@@ -1092,7 +1096,7 @@ ufs_rename(fndp, tndp)
         */
        fndp->ni_nameiop &= ~(MODMASK | OPMASK);
        fndp->ni_nameiop |= DELETE | LOCKPARENT | LOCKLEAF;
         */
        fndp->ni_nameiop &= ~(MODMASK | OPMASK);
        fndp->ni_nameiop |= DELETE | LOCKPARENT | LOCKLEAF;
-       (void)namei(fndp);
+       (void)namei(fndp, p);
        if (fndp->ni_vp != NULL) {
                xp = VTOI(fndp->ni_vp);
                dp = VTOI(fndp->ni_dvp);
        if (fndp->ni_vp != NULL) {
                xp = VTOI(fndp->ni_vp);
                dp = VTOI(fndp->ni_dvp);
@@ -1189,6 +1193,7 @@ ufs_mkdir(ndp, vap)
        struct nameidata *ndp;
        struct vattr *vap;
 {
        struct nameidata *ndp;
        struct vattr *vap;
 {
+       struct proc *p = curproc;               /* XXX */
        register struct inode *ip, *dp;
        struct inode *tip;
        struct vnode *dvp;
        register struct inode *ip, *dp;
        struct inode *tip;
        struct vnode *dvp;
@@ -1273,7 +1278,7 @@ ufs_mkdir(ndp, vap)
        if (error = direnter(ip, ndp)) {
                ndp->ni_nameiop &= ~(MODMASK | OPMASK);
                ndp->ni_nameiop |= LOOKUP | LOCKLEAF | NOCACHE;
        if (error = direnter(ip, ndp)) {
                ndp->ni_nameiop &= ~(MODMASK | OPMASK);
                ndp->ni_nameiop |= LOOKUP | LOCKLEAF | NOCACHE;
-               error = namei(ndp);
+               error = namei(ndp, p);
                if (!error) {
                        iput(dp);
                        dp = VTOI(ndp->ni_vp);
                if (!error) {
                        iput(dp);
                        dp = VTOI(ndp->ni_vp);
index 6f2306a..b6decc8 100644 (file)
@@ -4,22 +4,23 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)mfs_vfsops.c        7.17 (Berkeley) %G%
+ *     @(#)mfs_vfsops.c        7.18 (Berkeley) %G%
  */
 
 #include "param.h"
 #include "time.h"
 #include "kernel.h"
  */
 
 #include "param.h"
 #include "time.h"
 #include "kernel.h"
-#include "user.h"
 #include "proc.h"
 #include "buf.h"
 #include "mount.h"
 #include "proc.h"
 #include "buf.h"
 #include "mount.h"
+#include "signalvar.h"
 #include "vnode.h"
 #include "vnode.h"
-#include "../ufs/quota.h"
-#include "../ufs/inode.h"
-#include "../ufs/ufsmount.h"
-#include "../ufs/mfsnode.h"
-#include "../ufs/fs.h"
+
+#include "quota.h"
+#include "inode.h"
+#include "ufsmount.h"
+#include "mfsnode.h"
+#include "fs.h"
 
 extern struct vnodeops mfs_vnodeops;
 
 
 extern struct vnodeops mfs_vnodeops;
 
@@ -90,7 +91,7 @@ mfs_mount(mp, path, data, ndp)
        mfsp->mfs_baseoff = args.base;
        mfsp->mfs_size = args.size;
        mfsp->mfs_vnode = devvp;
        mfsp->mfs_baseoff = args.base;
        mfsp->mfs_size = args.size;
        mfsp->mfs_vnode = devvp;
-       mfsp->mfs_pid = u.u_procp->p_pid;
+       mfsp->mfs_pid = curproc->p_pid;
        mfsp->mfs_buflist = (struct buf *)0;
        if (error = mountfs(devvp, mp)) {
                mfsp->mfs_buflist = (struct buf *)-1;
        mfsp->mfs_buflist = (struct buf *)0;
        if (error = mountfs(devvp, mp)) {
                mfsp->mfs_buflist = (struct buf *)-1;
@@ -129,7 +130,7 @@ mfs_start(mp, flags)
        register struct mfsnode *mfsp = VTOMFS(vp);
        register struct buf *bp;
        register caddr_t base;
        register struct mfsnode *mfsp = VTOMFS(vp);
        register struct buf *bp;
        register caddr_t base;
-       struct proc *p = u.u_procp;
+       struct proc *p = curproc;
        int error = 0;
 
        base = mfsp->mfs_baseoff;
        int error = 0;
 
        base = mfsp->mfs_baseoff;
index fe291a8..600a318 100644 (file)
@@ -4,20 +4,20 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)mfs_vnops.c 7.20 (Berkeley) %G%
+ *     @(#)mfs_vnops.c 7.21 (Berkeley) %G%
  */
 
 #include "param.h"
 #include "time.h"
 #include "kernel.h"
 #include "proc.h"
  */
 
 #include "param.h"
 #include "time.h"
 #include "kernel.h"
 #include "proc.h"
-#include "user.h"
 #include "buf.h"
 #include "buf.h"
-#include "errno.h"
 #include "map.h"
 #include "vnode.h"
 #include "map.h"
 #include "vnode.h"
-#include "../ufs/mfsnode.h"
-#include "../ufs/mfsiom.h"
+
+#include "mfsnode.h"
+#include "mfsiom.h"
+
 #include "machine/vmparam.h"
 #include "machine/mtpr.h"
 
 #include "machine/vmparam.h"
 #include "machine/mtpr.h"
 
@@ -124,7 +124,7 @@ mfs_strategy(bp)
        if (vfinddev(bp->b_dev, VBLK, &vp) || vp->v_usecount == 0)
                panic("mfs_strategy: bad dev");
        mfsp = VTOMFS(vp);
        if (vfinddev(bp->b_dev, VBLK, &vp) || vp->v_usecount == 0)
                panic("mfs_strategy: bad dev");
        mfsp = VTOMFS(vp);
-       if (mfsp->mfs_pid == u.u_procp->p_pid) {
+       if (mfsp->mfs_pid == curproc->p_pid) {
                mfs_doio(bp, mfsp->mfs_baseoff);
        } else {
                bp->av_forw = mfsp->mfs_buflist;
                mfs_doio(bp, mfsp->mfs_baseoff);
        } else {
                bp->av_forw = mfsp->mfs_buflist;
index fb22543..4df589c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_disksubr.c      7.14 (Berkeley) %G%
+ *     @(#)ufs_disksubr.c      7.15 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -12,7 +12,6 @@
 #include "buf.h"
 #include "disklabel.h"
 #include "syslog.h"
 #include "buf.h"
 #include "disklabel.h"
 #include "syslog.h"
-#include "user.h"
 
 /*
  * Seek sort for disks.  We depend on the driver
 
 /*
  * Seek sort for disks.  We depend on the driver
index 3b8c137..ded8aff 100644 (file)
@@ -4,25 +4,24 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_inode.c 7.37 (Berkeley) %G%
+ *     @(#)ufs_inode.c 7.38 (Berkeley) %G%
  */
 
 #include "param.h"
 #include "systm.h"
 #include "mount.h"
  */
 
 #include "param.h"
 #include "systm.h"
 #include "mount.h"
-#include "user.h"
 #include "proc.h"
 #include "file.h"
 #include "buf.h"
 #include "proc.h"
 #include "file.h"
 #include "buf.h"
-#include "cmap.h"
 #include "vnode.h"
 #include "vnode.h"
-#include "../ufs/quota.h"
-#include "../ufs/inode.h"
-#include "../ufs/fs.h"
-#include "../ufs/ufsmount.h"
 #include "kernel.h"
 #include "malloc.h"
 
 #include "kernel.h"
 #include "malloc.h"
 
+#include "quota.h"
+#include "inode.h"
+#include "fs.h"
+#include "ufsmount.h"
+
 #define        INOHSZ  512
 #if    ((INOHSZ&(INOHSZ-1)) == 0)
 #define        INOHASH(dev,ino)        (((dev)+(ino))&(INOHSZ-1))
 #define        INOHSZ  512
 #if    ((INOHSZ&(INOHSZ-1)) == 0)
 #define        INOHASH(dev,ino)        (((dev)+(ino))&(INOHSZ-1))
@@ -646,14 +645,13 @@ ilock(ip)
 
        while (ip->i_flag & ILOCKED) {
                ip->i_flag |= IWANT;
 
        while (ip->i_flag & ILOCKED) {
                ip->i_flag |= IWANT;
-               if (ip->i_spare0 == u.u_procp->p_pid)
+               if (ip->i_spare0 == curproc->p_pid)
                        panic("locking against myself");
                        panic("locking against myself");
-               ip->i_spare1 = u.u_procp->p_pid;
+               ip->i_spare1 = curproc->p_pid;
                (void) sleep((caddr_t)ip, PINOD);
        }
        ip->i_spare1 = 0;
                (void) sleep((caddr_t)ip, PINOD);
        }
        ip->i_spare1 = 0;
-       ip->i_spare0 = u.u_procp->p_pid;
-       u.u_spare[0]++;
+       ip->i_spare0 = curproc->p_pid;
        ip->i_flag |= ILOCKED;
 }
 
        ip->i_flag |= ILOCKED;
 }
 
@@ -667,7 +665,6 @@ iunlock(ip)
        if ((ip->i_flag & ILOCKED) == 0)
                vprint("iunlock: unlocked inode", ITOV(ip));
        ip->i_spare0 = 0;
        if ((ip->i_flag & ILOCKED) == 0)
                vprint("iunlock: unlocked inode", ITOV(ip));
        ip->i_spare0 = 0;
-       u.u_spare[0]--;
        ip->i_flag &= ~ILOCKED;
        if (ip->i_flag&IWANT) {
                ip->i_flag &= ~IWANT;
        ip->i_flag &= ~ILOCKED;
        if (ip->i_flag&IWANT) {
                ip->i_flag &= ~IWANT;
index 4dcab13..36725fa 100644 (file)
@@ -7,25 +7,21 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_lockf.c 7.2 (Berkeley) %G%
+ *     @(#)ufs_lockf.c 7.3 (Berkeley) %G%
  */
 
 #include "param.h"
 #include "systm.h"
  */
 
 #include "param.h"
 #include "systm.h"
-#include "user.h"
 #include "kernel.h"
 #include "file.h"
 #include "proc.h"
 #include "kernel.h"
 #include "file.h"
 #include "proc.h"
-#include "socketvar.h"
-#include "socket.h"
 #include "vnode.h"
 #include "vnode.h"
-#include "ioctl.h"
-#include "tty.h"
 #include "malloc.h"
 #include "fcntl.h"
 #include "malloc.h"
 #include "fcntl.h"
-#include "../ufs/lockf.h"
-#include "../ufs/quota.h"
-#include "../ufs/inode.h"
+
+#include "lockf.h"
+#include "quota.h"
+#include "inode.h"
 
 /*
  * This variable controls the maximum number of processes that will
 
 /*
  * This variable controls the maximum number of processes that will
index f57879a..4b225fd 100644 (file)
@@ -4,17 +4,18 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_lookup.c        7.27 (Berkeley) %G%
+ *     @(#)ufs_lookup.c        7.28 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
-#include "user.h"
+#include "namei.h"
 #include "buf.h"
 #include "file.h"
 #include "vnode.h"
 #include "buf.h"
 #include "file.h"
 #include "vnode.h"
-#include "../ufs/quota.h"
-#include "../ufs/inode.h"
-#include "../ufs/fs.h"
+
+#include "quota.h"
+#include "inode.h"
+#include "fs.h"
 
 struct nchstats nchstats;
 int    dirchk = 1;
 
 struct nchstats nchstats;
 int    dirchk = 1;
index 074ef60..d5b5ec3 100644 (file)
@@ -7,23 +7,22 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_quota.c 7.6 (Berkeley) %G%
+ *     @(#)ufs_quota.c 7.7 (Berkeley) %G%
  */
 #include "param.h"
  */
 #include "param.h"
-#include "time.h"
 #include "kernel.h"
 #include "systm.h"
 #include "kernel.h"
 #include "systm.h"
-#include "ucred.h"
 #include "namei.h"
 #include "namei.h"
-#include "errno.h"
 #include "malloc.h"
 #include "file.h"
 #include "malloc.h"
 #include "file.h"
+#include "proc.h"
 #include "vnode.h"
 #include "mount.h"
 #include "vnode.h"
 #include "mount.h"
-#include "../ufs/fs.h"
-#include "../ufs/quota.h"
-#include "../ufs/inode.h"
-#include "../ufs/ufsmount.h"
+
+#include "fs.h"
+#include "quota.h"
+#include "inode.h"
+#include "ufsmount.h"
 
 /*
  * Quota name to error message mapping.
 
 /*
  * Quota name to error message mapping.
@@ -320,8 +319,8 @@ chkdquot(ip)
 /*
  * Q_QUOTAON - set up a quota file for a particular file system.
  */
 /*
  * Q_QUOTAON - set up a quota file for a particular file system.
  */
-quotaon(ndp, mp, type, fname)
-       register struct nameidata *ndp;
+quotaon(p, mp, type, fname)
+       struct proc *p;
        struct mount *mp;
        register int type;
        caddr_t fname;
        struct mount *mp;
        register int type;
        caddr_t fname;
@@ -331,13 +330,14 @@ quotaon(ndp, mp, type, fname)
        struct vnode *nextvp;
        struct dquot *dq;
        int error;
        struct vnode *nextvp;
        struct dquot *dq;
        int error;
-       
+       struct nameidata nd;
+
        vpp = &ump->um_quotas[type];
        vpp = &ump->um_quotas[type];
-       ndp->ni_segflg = UIO_USERSPACE;
-       ndp->ni_dirp = fname;
-       if (error = vn_open(ndp, FREAD|FWRITE, 0))
+       nd.ni_segflg = UIO_USERSPACE;
+       nd.ni_dirp = fname;
+       if (error = vn_open(&nd, p, FREAD|FWRITE, 0))
                return (error);
                return (error);
-       vp = ndp->ni_vp;
+       vp = nd.ni_vp;
        if (vp->v_type != VREG) {
                vrele(vp);
                return (EACCES);
        if (vp->v_type != VREG) {
                vrele(vp);
                return (EACCES);
@@ -356,8 +356,8 @@ quotaon(ndp, mp, type, fname)
         * Save the credential of the process that turned on quotas.
         * Set up the time limits for this quota.
         */
         * Save the credential of the process that turned on quotas.
         * Set up the time limits for this quota.
         */
-       crhold(ndp->ni_cred);
-       ump->um_cred[type] = ndp->ni_cred;
+       crhold(p->p_ucred);
+       ump->um_cred[type] = p->p_ucred;
        ump->um_btime[type] = MAX_DQ_TIME;
        ump->um_itime[type] = MAX_IQ_TIME;
        if (dqget(NULLVP, 0, ump, type, &dq) == 0) {
        ump->um_btime[type] = MAX_DQ_TIME;
        ump->um_itime[type] = MAX_IQ_TIME;
        if (dqget(NULLVP, 0, ump, type, &dq) == 0) {
index 73d8ccc..e8174fa 100644 (file)
@@ -4,12 +4,12 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_vfsops.c        7.50 (Berkeley) %G%
+ *     @(#)ufs_vfsops.c        7.51 (Berkeley) %G%
  */
 
 #include "param.h"
 #include "systm.h"
  */
 
 #include "param.h"
 #include "systm.h"
-#include "user.h"
+#include "namei.h"
 #include "proc.h"
 #include "kernel.h"
 #include "vnode.h"
 #include "proc.h"
 #include "kernel.h"
 #include "vnode.h"
 #include "ioctl.h"
 #include "errno.h"
 #include "malloc.h"
 #include "ioctl.h"
 #include "errno.h"
 #include "malloc.h"
-#include "../ufs/quota.h"
-#include "../ufs/fs.h"
-#include "../ufs/ufsmount.h"
-#include "../ufs/inode.h"
 #include "ioctl.h"
 #include "disklabel.h"
 #include "stat.h"
 
 #include "ioctl.h"
 #include "disklabel.h"
 #include "stat.h"
 
+#include "quota.h"
+#include "fs.h"
+#include "ufsmount.h"
+#include "inode.h"
+
 /*
  * ufs vfs operations.
  */
 /*
  * ufs vfs operations.
  */
@@ -402,26 +403,25 @@ ufs_quotactl(mp, cmds, uid, arg)
        uid_t uid;
        caddr_t arg;
 {
        uid_t uid;
        caddr_t arg;
 {
-       register struct nameidata *ndp = &u.u_nd;
        struct ufsmount *ump = VFSTOUFS(mp);
        struct ufsmount *ump = VFSTOUFS(mp);
-       struct proc *p = u.u_procp;     /* XXX */
+       struct proc *p = curproc;       /* XXX */
        int cmd, type, error;
 
 #ifndef QUOTA
        return (EOPNOTSUPP);
 #else
        if (uid == -1)
        int cmd, type, error;
 
 #ifndef QUOTA
        return (EOPNOTSUPP);
 #else
        if (uid == -1)
-               uid = p->p_ruid;
+               uid = p->p_cred->p_ruid;
        cmd = cmds >> SUBCMDSHIFT;
 
        switch (cmd) {
        case Q_GETQUOTA:
        case Q_SYNC:
        cmd = cmds >> SUBCMDSHIFT;
 
        switch (cmd) {
        case Q_GETQUOTA:
        case Q_SYNC:
-               if (uid == p->p_ruid)
+               if (uid == p->p_cred->p_ruid)
                        break;
                /* fall through */
        default:
                        break;
                /* fall through */
        default:
-               if (error = suser(ndp->ni_cred, &u.u_acflag))
+               if (error = suser(p->p_ucred, &p->p_acflag))
                        return (error);
        }
 
                        return (error);
        }
 
@@ -432,7 +432,7 @@ ufs_quotactl(mp, cmds, uid, arg)
        switch (cmd) {
 
        case Q_QUOTAON:
        switch (cmd) {
 
        case Q_QUOTAON:
-               return (quotaon(ndp, mp, type, arg));
+               return (quotaon(p, mp, type, arg));
 
        case Q_QUOTAOFF:
                if (vfs_busy(mp))
 
        case Q_QUOTAOFF:
                if (vfs_busy(mp))
@@ -737,7 +737,7 @@ getmdev(devvpp, fname, ndp)
        ndp->ni_nameiop = LOOKUP | FOLLOW;
        ndp->ni_segflg = UIO_USERSPACE;
        ndp->ni_dirp = fname;
        ndp->ni_nameiop = LOOKUP | FOLLOW;
        ndp->ni_segflg = UIO_USERSPACE;
        ndp->ni_dirp = fname;
-       if (error = namei(ndp))
+       if (error = namei(ndp, curproc))                /* XXX */
                return (error);
        vp = ndp->ni_vp;
        if (vp->v_type != VBLK) {
                return (error);
        vp = ndp->ni_vp;
        if (vp->v_type != VBLK) {
index 85a6f50..9f535ba 100644 (file)
@@ -4,29 +4,29 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_vnops.c 7.57 (Berkeley) %G%
+ *     @(#)ufs_vnops.c 7.58 (Berkeley) %G%
  */
 
 #include "param.h"
 #include "systm.h"
  */
 
 #include "param.h"
 #include "systm.h"
-#include "user.h"
+#include "namei.h"
+#include "resourcevar.h"
 #include "kernel.h"
 #include "file.h"
 #include "stat.h"
 #include "buf.h"
 #include "proc.h"
 #include "kernel.h"
 #include "file.h"
 #include "stat.h"
 #include "buf.h"
 #include "proc.h"
-#include "socket.h"
-#include "socketvar.h"
 #include "conf.h"
 #include "mount.h"
 #include "vnode.h"
 #include "specdev.h"
 #include "fcntl.h"
 #include "malloc.h"
 #include "conf.h"
 #include "mount.h"
 #include "vnode.h"
 #include "specdev.h"
 #include "fcntl.h"
 #include "malloc.h"
-#include "../ufs/lockf.h"
-#include "../ufs/quota.h"
-#include "../ufs/inode.h"
-#include "../ufs/fs.h"
+
+#include "lockf.h"
+#include "quota.h"
+#include "inode.h"
+#include "fs.h"
 
 /*
  * Global vfs data structures for ufs
 
 /*
  * Global vfs data structures for ufs
@@ -112,8 +112,7 @@ int spec_lookup(),
        spec_select(),
        ufsspec_close(),
        spec_advlock(),
        spec_select(),
        ufsspec_close(),
        spec_advlock(),
-       spec_badop(),
-       nullop();
+       spec_badop();
 
 struct vnodeops spec_inodeops = {
        spec_lookup,            /* lookup */
 
 struct vnodeops spec_inodeops = {
        spec_lookup,            /* lookup */
@@ -401,6 +400,7 @@ ufs_setattr(vp, vap, cred)
        register struct vattr *vap;
        register struct ucred *cred;
 {
        register struct vattr *vap;
        register struct ucred *cred;
 {
+       struct proc *p = curproc;               /* XXX */
        register struct inode *ip = VTOI(vp);
        int error = 0;
 
        register struct inode *ip = VTOI(vp);
        int error = 0;
 
@@ -417,7 +417,7 @@ ufs_setattr(vp, vap, cred)
         * Go through the fields and update iff not VNOVAL.
         */
        if (vap->va_uid != (u_short)VNOVAL || vap->va_gid != (u_short)VNOVAL)
         * Go through the fields and update iff not VNOVAL.
         */
        if (vap->va_uid != (u_short)VNOVAL || vap->va_gid != (u_short)VNOVAL)
-               if (error = chown1(vp, vap->va_uid, vap->va_gid, cred))
+               if (error = chown1(vp, vap->va_uid, vap->va_gid, p))
                        return (error);
        if (vap->va_size != VNOVAL) {
                if (vp->v_type == VDIR)
                        return (error);
        if (vap->va_size != VNOVAL) {
                if (vp->v_type == VDIR)
@@ -427,7 +427,7 @@ ufs_setattr(vp, vap, cred)
        }
        if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) {
                if (cred->cr_uid != ip->i_uid &&
        }
        if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) {
                if (cred->cr_uid != ip->i_uid &&
-                   (error = suser(cred, &u.u_acflag)))
+                   (error = suser(cred, &p->p_acflag)))
                        return (error);
                if (vap->va_atime.tv_sec != VNOVAL)
                        ip->i_flag |= IACC;
                        return (error);
                if (vap->va_atime.tv_sec != VNOVAL)
                        ip->i_flag |= IACC;
@@ -438,10 +438,10 @@ ufs_setattr(vp, vap, cred)
                        return (error);
        }
        if (vap->va_mode != (u_short)VNOVAL)
                        return (error);
        }
        if (vap->va_mode != (u_short)VNOVAL)
-               error = chmod1(vp, (int)vap->va_mode, cred);
+               error = chmod1(vp, (int)vap->va_mode, p);
        if (vap->va_flags != VNOVAL) {
                if (cred->cr_uid != ip->i_uid &&
        if (vap->va_flags != VNOVAL) {
                if (cred->cr_uid != ip->i_uid &&
-                   (error = suser(cred, &u.u_acflag)))
+                   (error = suser(cred, &p->p_acflag)))
                        return (error);
                if (cred->cr_uid == 0) {
                        ip->i_flags = vap->va_flags;
                        return (error);
                if (cred->cr_uid == 0) {
                        ip->i_flags = vap->va_flags;
@@ -458,16 +458,17 @@ ufs_setattr(vp, vap, cred)
  * Change the mode on a file.
  * Inode must be locked before calling.
  */
  * Change the mode on a file.
  * Inode must be locked before calling.
  */
-chmod1(vp, mode, cred)
+chmod1(vp, mode, p)
        register struct vnode *vp;
        register int mode;
        register struct vnode *vp;
        register int mode;
-       struct ucred *cred;
+       struct proc *p;
 {
 {
+       register struct ucred *cred = p->p_ucred;
        register struct inode *ip = VTOI(vp);
        int error;
 
        if (cred->cr_uid != ip->i_uid &&
        register struct inode *ip = VTOI(vp);
        int error;
 
        if (cred->cr_uid != ip->i_uid &&
-           (error = suser(cred, &u.u_acflag)))
+           (error = suser(cred, &p->p_acflag)))
                return (error);
        if (cred->cr_uid) {
                if (vp->v_type != VDIR && (mode & ISVTX))
                return (error);
        if (cred->cr_uid) {
                if (vp->v_type != VDIR && (mode & ISVTX))
@@ -487,13 +488,14 @@ chmod1(vp, mode, cred)
  * Perform chown operation on inode ip;
  * inode must be locked prior to call.
  */
  * Perform chown operation on inode ip;
  * inode must be locked prior to call.
  */
-chown1(vp, uid, gid, cred)
+chown1(vp, uid, gid, p)
        register struct vnode *vp;
        uid_t uid;
        gid_t gid;
        register struct vnode *vp;
        uid_t uid;
        gid_t gid;
-       struct ucred *cred;
+       struct proc *p;
 {
        register struct inode *ip = VTOI(vp);
 {
        register struct inode *ip = VTOI(vp);
+       register struct ucred *cred = p->p_ucred;
        uid_t ouid;
        gid_t ogid;
        int error = 0;
        uid_t ouid;
        gid_t ogid;
        int error = 0;
@@ -513,7 +515,7 @@ chown1(vp, uid, gid, cred)
         */
        if ((cred->cr_uid != ip->i_uid || uid != ip->i_uid ||
            !groupmember((gid_t)gid, cred)) &&
         */
        if ((cred->cr_uid != ip->i_uid || uid != ip->i_uid ||
            !groupmember((gid_t)gid, cred)) &&
-           (error = suser(cred, &u.u_acflag)))
+           (error = suser(cred, &p->p_acflag)))
                return (error);
        ouid = ip->i_uid;
        ogid = ip->i_gid;
                return (error);
        ouid = ip->i_uid;
        ogid = ip->i_gid;
@@ -656,6 +658,7 @@ ufs_write(vp, uio, ioflag, cred)
        int ioflag;
        struct ucred *cred;
 {
        int ioflag;
        struct ucred *cred;
 {
+       struct proc *p = curproc;               /* XXX */
        register struct inode *ip = VTOI(vp);
        register struct fs *fs;
        struct buf *bp;
        register struct inode *ip = VTOI(vp);
        register struct fs *fs;
        struct buf *bp;
@@ -692,8 +695,8 @@ ufs_write(vp, uio, ioflag, cred)
         */
        if (vp->v_type == VREG &&
            uio->uio_offset + uio->uio_resid >
         */
        if (vp->v_type == VREG &&
            uio->uio_offset + uio->uio_resid >
-             u.u_rlimit[RLIMIT_FSIZE].rlim_cur) {
-               psignal(u.u_procp, SIGXFSZ);
+             p->p_rlimit[RLIMIT_FSIZE].rlim_cur) {
+               psignal(p, SIGXFSZ);
                return (EFBIG);
        }
        resid = uio->uio_resid;
                return (EFBIG);
        }
        resid = uio->uio_resid;
@@ -894,6 +897,7 @@ ufs_link(vp, ndp)
 ufs_rename(fndp, tndp)
        register struct nameidata *fndp, *tndp;
 {
 ufs_rename(fndp, tndp)
        register struct nameidata *fndp, *tndp;
 {
+       struct proc *p = curproc;               /* XXX */
        register struct inode *ip, *xp, *dp;
        struct dirtemplate dirbuf;
        int doingdirectory = 0, oldparent = 0, newparent = 0;
        register struct inode *ip, *xp, *dp;
        struct dirtemplate dirbuf;
        int doingdirectory = 0, oldparent = 0, newparent = 0;
@@ -970,7 +974,7 @@ ufs_rename(fndp, tndp)
                                iput(xp);
                        if (error = checkpath(ip, dp, tndp->ni_cred))
                                goto out;
                                iput(xp);
                        if (error = checkpath(ip, dp, tndp->ni_cred))
                                goto out;
-                       if (error = namei(tndp))
+                       if (error = namei(tndp, p))
                                goto out;
                        xp = NULL;
                        if (tndp->ni_vp)
                                goto out;
                        xp = NULL;
                        if (tndp->ni_vp)
@@ -1092,7 +1096,7 @@ ufs_rename(fndp, tndp)
         */
        fndp->ni_nameiop &= ~(MODMASK | OPMASK);
        fndp->ni_nameiop |= DELETE | LOCKPARENT | LOCKLEAF;
         */
        fndp->ni_nameiop &= ~(MODMASK | OPMASK);
        fndp->ni_nameiop |= DELETE | LOCKPARENT | LOCKLEAF;
-       (void)namei(fndp);
+       (void)namei(fndp, p);
        if (fndp->ni_vp != NULL) {
                xp = VTOI(fndp->ni_vp);
                dp = VTOI(fndp->ni_dvp);
        if (fndp->ni_vp != NULL) {
                xp = VTOI(fndp->ni_vp);
                dp = VTOI(fndp->ni_dvp);
@@ -1189,6 +1193,7 @@ ufs_mkdir(ndp, vap)
        struct nameidata *ndp;
        struct vattr *vap;
 {
        struct nameidata *ndp;
        struct vattr *vap;
 {
+       struct proc *p = curproc;               /* XXX */
        register struct inode *ip, *dp;
        struct inode *tip;
        struct vnode *dvp;
        register struct inode *ip, *dp;
        struct inode *tip;
        struct vnode *dvp;
@@ -1273,7 +1278,7 @@ ufs_mkdir(ndp, vap)
        if (error = direnter(ip, ndp)) {
                ndp->ni_nameiop &= ~(MODMASK | OPMASK);
                ndp->ni_nameiop |= LOOKUP | LOCKLEAF | NOCACHE;
        if (error = direnter(ip, ndp)) {
                ndp->ni_nameiop &= ~(MODMASK | OPMASK);
                ndp->ni_nameiop |= LOOKUP | LOCKLEAF | NOCACHE;
-               error = namei(ndp);
+               error = namei(ndp, p);
                if (!error) {
                        iput(dp);
                        dp = VTOI(ndp->ni_vp);
                if (!error) {
                        iput(dp);
                        dp = VTOI(ndp->ni_vp);