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:
*
* %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 "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();
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 */
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 */
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) {
*
* %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 "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
*
* %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 "proc.h"
#include "file.h"
#include "buf.h"
#include "proc.h"
#include "file.h"
#include "buf.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))
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;
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;
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;
*
* %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 "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.
*/
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_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_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))
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))
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) {
*
* %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 "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
spec_select(),
ufsspec_close(),
spec_advlock(),
spec_select(),
ufsspec_close(),
spec_advlock(),
- spec_badop(),
- nullop();
struct vnodeops spec_inodeops = {
spec_lookup, /* lookup */
struct vnodeops spec_inodeops = {
spec_lookup, /* lookup */
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;
* 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)
}
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;
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;
* Change the mode on a file.
* Inode must be locked before calling.
*/
* Change the mode on a file.
* Inode must be locked before calling.
*/
register struct vnode *vp;
register int mode;
register struct vnode *vp;
register int mode;
+ 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))
* 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)
register struct vnode *vp;
uid_t uid;
gid_t gid;
register struct vnode *vp;
uid_t uid;
gid_t gid;
{
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;
*/
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;
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;
*/
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;
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;
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)
*/
fndp->ni_nameiop &= ~(MODMASK | OPMASK);
fndp->ni_nameiop |= DELETE | LOCKPARENT | LOCKLEAF;
*/
fndp->ni_nameiop &= ~(MODMASK | OPMASK);
fndp->ni_nameiop |= DELETE | LOCKPARENT | LOCKLEAF;
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);
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;
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;
if (!error) {
iput(dp);
dp = VTOI(ndp->ni_vp);
if (!error) {
iput(dp);
dp = VTOI(ndp->ni_vp);
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ufs_disksubr.c 7.14 (Berkeley) %G%
+ * @(#)ufs_disksubr.c 7.15 (Berkeley) %G%
#include "buf.h"
#include "disklabel.h"
#include "syslog.h"
#include "buf.h"
#include "disklabel.h"
#include "syslog.h"
/*
* Seek sort for disks. We depend on the driver
/*
* Seek sort for disks. We depend on the driver
*
* %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 "proc.h"
#include "file.h"
#include "buf.h"
#include "proc.h"
#include "file.h"
#include "buf.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))
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;
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;
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;
*
* %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 "kernel.h"
#include "file.h"
#include "proc.h"
#include "kernel.h"
#include "file.h"
#include "proc.h"
-#include "socketvar.h"
-#include "socket.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
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ufs_lookup.c 7.27 (Berkeley) %G%
+ * @(#)ufs_lookup.c 7.28 (Berkeley) %G%
#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;
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ufs_quota.c 7.6 (Berkeley) %G%
+ * @(#)ufs_quota.c 7.7 (Berkeley) %G%
#include "kernel.h"
#include "systm.h"
#include "kernel.h"
#include "systm.h"
#include "malloc.h"
#include "file.h"
#include "malloc.h"
#include "file.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.
/*
* 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;
struct vnode *nextvp;
struct dquot *dq;
int error;
struct vnode *nextvp;
struct dquot *dq;
int error;
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))
if (vp->v_type != VREG) {
vrele(vp);
return (EACCES);
if (vp->v_type != VREG) {
vrele(vp);
return (EACCES);
* 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) {
*
* %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 "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.
*/
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_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_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))
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))
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) {
*
* %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 "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
spec_select(),
ufsspec_close(),
spec_advlock(),
spec_select(),
ufsspec_close(),
spec_advlock(),
- spec_badop(),
- nullop();
struct vnodeops spec_inodeops = {
spec_lookup, /* lookup */
struct vnodeops spec_inodeops = {
spec_lookup, /* lookup */
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;
* 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)
}
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;
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;
* Change the mode on a file.
* Inode must be locked before calling.
*/
* Change the mode on a file.
* Inode must be locked before calling.
*/
register struct vnode *vp;
register int mode;
register struct vnode *vp;
register int mode;
+ 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))
* 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)
register struct vnode *vp;
uid_t uid;
gid_t gid;
register struct vnode *vp;
uid_t uid;
gid_t gid;
{
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;
*/
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;
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;
*/
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;
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;
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)
*/
fndp->ni_nameiop &= ~(MODMASK | OPMASK);
fndp->ni_nameiop |= DELETE | LOCKPARENT | LOCKLEAF;
*/
fndp->ni_nameiop &= ~(MODMASK | OPMASK);
fndp->ni_nameiop |= DELETE | LOCKPARENT | LOCKLEAF;
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);
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;
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;
if (!error) {
iput(dp);
dp = VTOI(ndp->ni_vp);
if (!error) {
iput(dp);
dp = VTOI(ndp->ni_vp);
*
* %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 "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();
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 */
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 */
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) {
*
* %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 "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
*
* %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 "proc.h"
#include "file.h"
#include "buf.h"
#include "proc.h"
#include "file.h"
#include "buf.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))
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;
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;
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;
*
* %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 "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.
*/
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_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_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))
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))
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) {
*
* %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 "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
spec_select(),
ufsspec_close(),
spec_advlock(),
spec_select(),
ufsspec_close(),
spec_advlock(),
- spec_badop(),
- nullop();
struct vnodeops spec_inodeops = {
spec_lookup, /* lookup */
struct vnodeops spec_inodeops = {
spec_lookup, /* lookup */
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;
* 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)
}
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;
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;
* Change the mode on a file.
* Inode must be locked before calling.
*/
* Change the mode on a file.
* Inode must be locked before calling.
*/
register struct vnode *vp;
register int mode;
register struct vnode *vp;
register int mode;
+ 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))
* 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)
register struct vnode *vp;
uid_t uid;
gid_t gid;
register struct vnode *vp;
uid_t uid;
gid_t gid;
{
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;
*/
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;
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;
*/
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;
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;
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)
*/
fndp->ni_nameiop &= ~(MODMASK | OPMASK);
fndp->ni_nameiop |= DELETE | LOCKPARENT | LOCKLEAF;
*/
fndp->ni_nameiop &= ~(MODMASK | OPMASK);
fndp->ni_nameiop |= DELETE | LOCKPARENT | LOCKLEAF;
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);
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;
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;
if (!error) {
iput(dp);
dp = VTOI(ndp->ni_vp);
if (!error) {
iput(dp);
dp = VTOI(ndp->ni_vp);
*
* %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 "proc.h"
#include "buf.h"
#include "mount.h"
#include "proc.h"
#include "buf.h"
#include "mount.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;
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;
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;
*
* %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 "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"
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;
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ufs_disksubr.c 7.14 (Berkeley) %G%
+ * @(#)ufs_disksubr.c 7.15 (Berkeley) %G%
#include "buf.h"
#include "disklabel.h"
#include "syslog.h"
#include "buf.h"
#include "disklabel.h"
#include "syslog.h"
/*
* Seek sort for disks. We depend on the driver
/*
* Seek sort for disks. We depend on the driver
*
* %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 "proc.h"
#include "file.h"
#include "buf.h"
#include "proc.h"
#include "file.h"
#include "buf.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))
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;
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;
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;
*
* %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 "kernel.h"
#include "file.h"
#include "proc.h"
#include "kernel.h"
#include "file.h"
#include "proc.h"
-#include "socketvar.h"
-#include "socket.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
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ufs_lookup.c 7.27 (Berkeley) %G%
+ * @(#)ufs_lookup.c 7.28 (Berkeley) %G%
#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;
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ufs_quota.c 7.6 (Berkeley) %G%
+ * @(#)ufs_quota.c 7.7 (Berkeley) %G%
#include "kernel.h"
#include "systm.h"
#include "kernel.h"
#include "systm.h"
#include "malloc.h"
#include "file.h"
#include "malloc.h"
#include "file.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.
/*
* 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;
struct vnode *nextvp;
struct dquot *dq;
int error;
struct vnode *nextvp;
struct dquot *dq;
int error;
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))
if (vp->v_type != VREG) {
vrele(vp);
return (EACCES);
if (vp->v_type != VREG) {
vrele(vp);
return (EACCES);
* 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) {
*
* %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 "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.
*/
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_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_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))
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))
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) {
*
* %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 "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
spec_select(),
ufsspec_close(),
spec_advlock(),
spec_select(),
ufsspec_close(),
spec_advlock(),
- spec_badop(),
- nullop();
struct vnodeops spec_inodeops = {
spec_lookup, /* lookup */
struct vnodeops spec_inodeops = {
spec_lookup, /* lookup */
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;
* 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)
}
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;
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;
* Change the mode on a file.
* Inode must be locked before calling.
*/
* Change the mode on a file.
* Inode must be locked before calling.
*/
register struct vnode *vp;
register int mode;
register struct vnode *vp;
register int mode;
+ 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))
* 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)
register struct vnode *vp;
uid_t uid;
gid_t gid;
register struct vnode *vp;
uid_t uid;
gid_t gid;
{
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;
*/
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;
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;
*/
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;
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;
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)
*/
fndp->ni_nameiop &= ~(MODMASK | OPMASK);
fndp->ni_nameiop |= DELETE | LOCKPARENT | LOCKLEAF;
*/
fndp->ni_nameiop &= ~(MODMASK | OPMASK);
fndp->ni_nameiop |= DELETE | LOCKPARENT | LOCKLEAF;
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);
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;
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;
if (!error) {
iput(dp);
dp = VTOI(ndp->ni_vp);
if (!error) {
iput(dp);
dp = VTOI(ndp->ni_vp);