LEASE_CHECK -> VOP_LEASE
This commit is contained in:
parent
2f8ea29cdb
commit
a18ec3cb1b
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kern_acct.c,v 1.35 1994/12/11 18:06:07 mycroft Exp $ */
|
||||
/* $NetBSD: kern_acct.c,v 1.36 1994/12/13 21:52:35 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1994 Christopher G. Demetriou
|
||||
@ -215,7 +215,7 @@ acct_process(p)
|
||||
/*
|
||||
* Now, just write the accounting information to the file.
|
||||
*/
|
||||
LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
return (vn_rdwr(UIO_WRITE, vp, (caddr_t)&acct, sizeof (acct),
|
||||
(off_t)0, UIO_SYSSPACE, IO_APPEND|IO_UNIT, p->p_ucred,
|
||||
(int *)0, p));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kern_sig.c,v 1.36 1994/12/07 21:31:11 cgd Exp $ */
|
||||
/* $NetBSD: kern_sig.c,v 1.37 1994/12/13 21:52:37 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1989, 1991, 1993
|
||||
@ -1184,7 +1184,7 @@ coredump(p)
|
||||
}
|
||||
VATTR_NULL(&vattr);
|
||||
vattr.va_size = 0;
|
||||
LEASE_CHECK(vp, p, cred, LEASE_WRITE);
|
||||
VOP_LEASE(vp, p, cred, LEASE_WRITE);
|
||||
VOP_SETATTR(vp, &vattr, cred, p);
|
||||
p->p_acflag |= ACORE;
|
||||
bcopy(p, &p->p_addr->u_kproc.kp_proc, sizeof(struct proc));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: uipc_usrreq.c,v 1.11 1994/08/30 03:06:10 mycroft Exp $ */
|
||||
/* $NetBSD: uipc_usrreq.c,v 1.12 1994/12/13 22:11:25 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1989, 1991, 1993
|
||||
@ -418,7 +418,7 @@ unp_bind(unp, nam, p)
|
||||
VATTR_NULL(&vattr);
|
||||
vattr.va_type = VSOCK;
|
||||
vattr.va_mode = ACCESSPERMS;
|
||||
LEASE_CHECK(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
|
||||
if (error = VOP_CREATE(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr))
|
||||
return (error);
|
||||
vp = nd.ni_vp;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vfs_syscalls.c,v 1.41 1994/12/13 09:49:13 mycroft Exp $ */
|
||||
/* $NetBSD: vfs_syscalls.c,v 1.42 1994/12/13 21:52:42 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
@ -751,7 +751,7 @@ mknod(p, uap, retval)
|
||||
error = EINVAL;
|
||||
goto bad;
|
||||
}
|
||||
LEASE_CHECK(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
|
||||
return (VOP_MKNOD(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr));
|
||||
bad:
|
||||
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
|
||||
@ -798,7 +798,7 @@ mkfifo(p, uap, retval)
|
||||
VATTR_NULL(&vattr);
|
||||
vattr.va_type = VFIFO;
|
||||
vattr.va_mode = (SCARG(uap, mode) & ALLPERMS) &~ p->p_fd->fd_cmask;
|
||||
LEASE_CHECK(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
|
||||
return (VOP_MKNOD(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr));
|
||||
#endif /* FIFO */
|
||||
}
|
||||
@ -835,8 +835,8 @@ link(p, uap, retval)
|
||||
error = EEXIST;
|
||||
goto bad2;
|
||||
}
|
||||
LEASE_CHECK(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
|
||||
LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd);
|
||||
vrele(vp);
|
||||
return (error);
|
||||
@ -888,7 +888,7 @@ symlink(p, uap, retval)
|
||||
}
|
||||
VATTR_NULL(&vattr);
|
||||
vattr.va_mode = ACCESSPERMS &~ p->p_fd->fd_cmask;
|
||||
LEASE_CHECK(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
|
||||
error = VOP_SYMLINK(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr, path);
|
||||
bad:
|
||||
FREE(path, M_NAMEI);
|
||||
@ -914,7 +914,7 @@ unlink(p, uap, retval)
|
||||
if (error = namei(&nd))
|
||||
return (error);
|
||||
vp = nd.ni_vp;
|
||||
LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LOCK(vp);
|
||||
|
||||
if (vp->v_type == VDIR &&
|
||||
@ -928,7 +928,7 @@ unlink(p, uap, retval)
|
||||
goto bad;
|
||||
}
|
||||
(void)vnode_pager_uncache(vp);
|
||||
LEASE_CHECK(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
|
||||
return (VOP_REMOVE(nd.ni_dvp, nd.ni_vp, &nd.ni_cnd));
|
||||
bad:
|
||||
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
|
||||
@ -1323,7 +1323,7 @@ chflags(p, uap, retval)
|
||||
if (error = namei(&nd))
|
||||
return (error);
|
||||
vp = nd.ni_vp;
|
||||
LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LOCK(vp);
|
||||
if (vp->v_mount->mnt_flag & MNT_RDONLY)
|
||||
error = EROFS;
|
||||
@ -1356,7 +1356,7 @@ fchflags(p, uap, retval)
|
||||
if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
|
||||
return (error);
|
||||
vp = (struct vnode *)fp->f_data;
|
||||
LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LOCK(vp);
|
||||
if (vp->v_mount->mnt_flag & MNT_RDONLY)
|
||||
error = EROFS;
|
||||
@ -1390,7 +1390,7 @@ chmod(p, uap, retval)
|
||||
if (error = namei(&nd))
|
||||
return (error);
|
||||
vp = nd.ni_vp;
|
||||
LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LOCK(vp);
|
||||
if (vp->v_mount->mnt_flag & MNT_RDONLY)
|
||||
error = EROFS;
|
||||
@ -1423,7 +1423,7 @@ fchmod(p, uap, retval)
|
||||
if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
|
||||
return (error);
|
||||
vp = (struct vnode *)fp->f_data;
|
||||
LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LOCK(vp);
|
||||
if (vp->v_mount->mnt_flag & MNT_RDONLY)
|
||||
error = EROFS;
|
||||
@ -1458,7 +1458,7 @@ chown(p, uap, retval)
|
||||
if (error = namei(&nd))
|
||||
return (error);
|
||||
vp = nd.ni_vp;
|
||||
LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LOCK(vp);
|
||||
if (vp->v_mount->mnt_flag & MNT_RDONLY)
|
||||
error = EROFS;
|
||||
@ -1493,7 +1493,7 @@ fchown(p, uap, retval)
|
||||
if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
|
||||
return (error);
|
||||
vp = (struct vnode *)fp->f_data;
|
||||
LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LOCK(vp);
|
||||
if (vp->v_mount->mnt_flag & MNT_RDONLY)
|
||||
error = EROFS;
|
||||
@ -1537,7 +1537,7 @@ utimes(p, uap, retval)
|
||||
if (error = namei(&nd))
|
||||
return (error);
|
||||
vp = nd.ni_vp;
|
||||
LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LOCK(vp);
|
||||
if (vp->v_mount->mnt_flag & MNT_RDONLY)
|
||||
error = EROFS;
|
||||
@ -1574,7 +1574,7 @@ truncate(p, uap, retval)
|
||||
if (error = namei(&nd))
|
||||
return (error);
|
||||
vp = nd.ni_vp;
|
||||
LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LOCK(vp);
|
||||
if (vp->v_type == VDIR)
|
||||
error = EISDIR;
|
||||
@ -1611,7 +1611,7 @@ ftruncate(p, uap, retval)
|
||||
if ((fp->f_flag & FWRITE) == 0)
|
||||
return (EINVAL);
|
||||
vp = (struct vnode *)fp->f_data;
|
||||
LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LOCK(vp);
|
||||
if (vp->v_type == VDIR)
|
||||
error = EISDIR;
|
||||
@ -1743,11 +1743,11 @@ rename(p, uap, retval)
|
||||
error = -1;
|
||||
out:
|
||||
if (!error) {
|
||||
LEASE_CHECK(tdvp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(tdvp, p, p->p_ucred, LEASE_WRITE);
|
||||
if (fromnd.ni_dvp != tdvp)
|
||||
LEASE_CHECK(fromnd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(fromnd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
|
||||
if (tvp)
|
||||
LEASE_CHECK(tvp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(tvp, p, p->p_ucred, LEASE_WRITE);
|
||||
error = VOP_RENAME(fromnd.ni_dvp, fromnd.ni_vp, &fromnd.ni_cnd,
|
||||
tond.ni_dvp, tond.ni_vp, &tond.ni_cnd);
|
||||
} else {
|
||||
@ -1806,7 +1806,7 @@ mkdir(p, uap, retval)
|
||||
VATTR_NULL(&vattr);
|
||||
vattr.va_type = VDIR;
|
||||
vattr.va_mode = (SCARG(uap, mode) & ACCESSPERMS) &~ p->p_fd->fd_cmask;
|
||||
LEASE_CHECK(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
|
||||
error = VOP_MKDIR(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr);
|
||||
if (!error)
|
||||
vput(nd.ni_vp);
|
||||
@ -1851,8 +1851,8 @@ rmdir(p, uap, retval)
|
||||
error = EBUSY;
|
||||
out:
|
||||
if (!error) {
|
||||
LEASE_CHECK(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
|
||||
LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
|
||||
VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE);
|
||||
error = VOP_RMDIR(nd.ni_dvp, nd.ni_vp, &nd.ni_cnd);
|
||||
} else {
|
||||
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vfs_vnops.c,v 1.16 1994/11/14 06:01:24 christos Exp $ */
|
||||
/* $NetBSD: vfs_vnops.c,v 1.17 1994/12/13 21:52:45 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1989, 1993
|
||||
@ -37,7 +37,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_vnops.c 8.2 (Berkeley) 1/21/94
|
||||
* @(#)vfs_vnops.c 8.5 (Berkeley) 12/8/94
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -85,7 +85,7 @@ vn_open(ndp, fmode, cmode, fp)
|
||||
VATTR_NULL(vap);
|
||||
vap->va_type = VREG;
|
||||
vap->va_mode = cmode;
|
||||
LEASE_CHECK(ndp->ni_dvp, p, cred, LEASE_WRITE);
|
||||
VOP_LEASE(ndp->ni_dvp, p, cred, LEASE_WRITE);
|
||||
if (error = VOP_CREATE(ndp->ni_dvp, &ndp->ni_vp,
|
||||
&ndp->ni_cnd, vap))
|
||||
return (error);
|
||||
@ -133,7 +133,7 @@ vn_open(ndp, fmode, cmode, fp)
|
||||
}
|
||||
if (fmode & O_TRUNC) {
|
||||
VOP_UNLOCK(vp); /* XXX */
|
||||
LEASE_CHECK(vp, p, cred, LEASE_WRITE);
|
||||
VOP_LEASE(vp, p, cred, LEASE_WRITE);
|
||||
VOP_LOCK(vp); /* XXX */
|
||||
VATTR_NULL(vap);
|
||||
vap->va_size = 0;
|
||||
@ -254,7 +254,7 @@ vn_read(fp, uio, cred)
|
||||
register struct vnode *vp = (struct vnode *)fp->f_data;
|
||||
int count, error;
|
||||
|
||||
LEASE_CHECK(vp, uio->uio_procp, cred, LEASE_READ);
|
||||
VOP_LEASE(vp, uio->uio_procp, cred, LEASE_READ);
|
||||
VOP_LOCK(vp);
|
||||
uio->uio_offset = fp->f_offset;
|
||||
count = uio->uio_resid;
|
||||
@ -274,13 +274,13 @@ vn_write(fp, uio, cred)
|
||||
struct ucred *cred;
|
||||
{
|
||||
register struct vnode *vp = (struct vnode *)fp->f_data;
|
||||
int count, error, ioflag = 0;
|
||||
int count, error, ioflag = IO_UNIT;
|
||||
|
||||
if (vp->v_type == VREG && (fp->f_flag & O_APPEND))
|
||||
ioflag |= IO_APPEND;
|
||||
if (fp->f_flag & FNONBLOCK)
|
||||
ioflag |= IO_NDELAY;
|
||||
LEASE_CHECK(vp, uio->uio_procp, cred, LEASE_WRITE);
|
||||
VOP_LEASE(vp, uio->uio_procp, cred, LEASE_WRITE);
|
||||
VOP_LOCK(vp);
|
||||
uio->uio_offset = fp->f_offset;
|
||||
count = uio->uio_resid;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: union_subr.c,v 1.4 1994/06/29 06:35:22 cgd Exp $ */
|
||||
/* $NetBSD: union_subr.c,v 1.5 1994/12/13 21:59:25 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Jan-Simon Pendry
|
||||
@ -567,10 +567,10 @@ union_copyfile(fvp, tvp, cred, p)
|
||||
uio.uio_offset = 0;
|
||||
|
||||
VOP_UNLOCK(fvp); /* XXX */
|
||||
LEASE_CHECK(fvp, p, cred, LEASE_READ);
|
||||
VOP_LEASE(fvp, p, cred, LEASE_READ);
|
||||
VOP_LOCK(fvp); /* XXX */
|
||||
VOP_UNLOCK(tvp); /* XXX */
|
||||
LEASE_CHECK(tvp, p, cred, LEASE_WRITE);
|
||||
VOP_LEASE(tvp, p, cred, LEASE_WRITE);
|
||||
VOP_LOCK(tvp); /* XXX */
|
||||
|
||||
buf = malloc(MAXBSIZE, M_TEMP, M_WAITOK);
|
||||
@ -756,8 +756,8 @@ union_mkshadow(um, dvp, cnp, vpp)
|
||||
va.va_type = VDIR;
|
||||
va.va_mode = um->um_cmode;
|
||||
|
||||
/* LEASE_CHECK: dvp is locked */
|
||||
LEASE_CHECK(dvp, p, p->p_ucred, LEASE_WRITE);
|
||||
/* VOP_LEASE: dvp is locked */
|
||||
VOP_LEASE(dvp, p, p->p_ucred, LEASE_WRITE);
|
||||
|
||||
error = VOP_MKDIR(dvp, vpp, &cn, &va);
|
||||
return (error);
|
||||
@ -837,7 +837,7 @@ union_vn_create(vpp, un, p)
|
||||
VATTR_NULL(vap);
|
||||
vap->va_type = VREG;
|
||||
vap->va_mode = cmode;
|
||||
LEASE_CHECK(un->un_dirvp, p, cred, LEASE_WRITE);
|
||||
VOP_LEASE(un->un_dirvp, p, cred, LEASE_WRITE);
|
||||
if (error = VOP_CREATE(un->un_dirvp, &vp, &cn, vap))
|
||||
return (error);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user