Remove the 'waslocked' parameter to vfs_object_create().
This commit is contained in:
parent
d1fd776a79
commit
fb1167777a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=42315
@ -27,7 +27,7 @@
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/coda/coda_fbsd.cr,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: coda_fbsd.c,v 1.8 1998/11/03 08:55:05 peter Exp $
|
||||
* $Id: coda_fbsd.c,v 1.9 1998/11/15 15:33:49 bde Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -180,7 +180,7 @@ printf("coda_getp: Internally Opening %p\n", vp);
|
||||
return (error);
|
||||
}
|
||||
if (vp->v_type == VREG) {
|
||||
error = vfs_object_create(vp, p, cred, 1);
|
||||
error = vfs_object_create(vp, p, cred);
|
||||
if (error != 0) {
|
||||
printf("coda_getpage: vfs_object_create() returns %d\n", error);
|
||||
vput(vp);
|
||||
|
@ -27,7 +27,7 @@
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/coda/coda_vnops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: coda_vnops.c,v 1.9 1998/11/16 19:48:26 rvb Exp $
|
||||
* $Id: coda_vnops.c,v 1.10 1998/12/04 18:44:21 rvb Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -48,6 +48,9 @@
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: coda_vnops.c,v $
|
||||
* Revision 1.10 1998/12/04 18:44:21 rvb
|
||||
* Don't print diagnostic anymore
|
||||
*
|
||||
* Revision 1.9 1998/11/16 19:48:26 rvb
|
||||
* A few bug fixes for Robert Watson
|
||||
*
|
||||
@ -502,7 +505,7 @@ coda_open(v)
|
||||
}
|
||||
/* grab (above) does this when it calls newvnode unless it's in the cache*/
|
||||
if (vp->v_type == VREG) {
|
||||
error = vfs_object_create(vp, p, cred, 1);
|
||||
error = vfs_object_create(vp, p, cred);
|
||||
if (error != 0) {
|
||||
printf("coda_open: vfs_object_create() returns %d\n", error);
|
||||
vput(vp);
|
||||
@ -662,7 +665,7 @@ printf("coda_rdwr: Internally Opening %p\n", vp);
|
||||
return (error);
|
||||
}
|
||||
if (vp->v_type == VREG) {
|
||||
error = vfs_object_create(vp, p, cred, 1);
|
||||
error = vfs_object_create(vp, p, cred);
|
||||
if (error != 0) {
|
||||
printf("coda_rdwr: vfs_object_create() returns %d\n", error);
|
||||
vput(vp);
|
||||
@ -1885,7 +1888,7 @@ printf("coda_readdir: Internally Opening %p\n", vp);
|
||||
return (error);
|
||||
}
|
||||
if (vp->v_type == VREG) {
|
||||
error = vfs_object_create(vp, p, cred, 1);
|
||||
error = vfs_object_create(vp, p, cred);
|
||||
if (error != 0) {
|
||||
printf("coda_readdir: vfs_object_create() returns %d\n", error);
|
||||
vput(vp);
|
||||
|
@ -27,7 +27,7 @@
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/coda/coda_fbsd.cr,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: coda_fbsd.c,v 1.8 1998/11/03 08:55:05 peter Exp $
|
||||
* $Id: coda_fbsd.c,v 1.9 1998/11/15 15:33:49 bde Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -180,7 +180,7 @@ printf("coda_getp: Internally Opening %p\n", vp);
|
||||
return (error);
|
||||
}
|
||||
if (vp->v_type == VREG) {
|
||||
error = vfs_object_create(vp, p, cred, 1);
|
||||
error = vfs_object_create(vp, p, cred);
|
||||
if (error != 0) {
|
||||
printf("coda_getpage: vfs_object_create() returns %d\n", error);
|
||||
vput(vp);
|
||||
|
@ -27,7 +27,7 @@
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/coda/coda_vnops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: coda_vnops.c,v 1.9 1998/11/16 19:48:26 rvb Exp $
|
||||
* $Id: coda_vnops.c,v 1.10 1998/12/04 18:44:21 rvb Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -48,6 +48,9 @@
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: coda_vnops.c,v $
|
||||
* Revision 1.10 1998/12/04 18:44:21 rvb
|
||||
* Don't print diagnostic anymore
|
||||
*
|
||||
* Revision 1.9 1998/11/16 19:48:26 rvb
|
||||
* A few bug fixes for Robert Watson
|
||||
*
|
||||
@ -502,7 +505,7 @@ coda_open(v)
|
||||
}
|
||||
/* grab (above) does this when it calls newvnode unless it's in the cache*/
|
||||
if (vp->v_type == VREG) {
|
||||
error = vfs_object_create(vp, p, cred, 1);
|
||||
error = vfs_object_create(vp, p, cred);
|
||||
if (error != 0) {
|
||||
printf("coda_open: vfs_object_create() returns %d\n", error);
|
||||
vput(vp);
|
||||
@ -662,7 +665,7 @@ printf("coda_rdwr: Internally Opening %p\n", vp);
|
||||
return (error);
|
||||
}
|
||||
if (vp->v_type == VREG) {
|
||||
error = vfs_object_create(vp, p, cred, 1);
|
||||
error = vfs_object_create(vp, p, cred);
|
||||
if (error != 0) {
|
||||
printf("coda_rdwr: vfs_object_create() returns %d\n", error);
|
||||
vput(vp);
|
||||
@ -1885,7 +1888,7 @@ printf("coda_readdir: Internally Opening %p\n", vp);
|
||||
return (error);
|
||||
}
|
||||
if (vp->v_type == VREG) {
|
||||
error = vfs_object_create(vp, p, cred, 1);
|
||||
error = vfs_object_create(vp, p, cred);
|
||||
if (error != 0) {
|
||||
printf("coda_readdir: vfs_object_create() returns %d\n", error);
|
||||
vput(vp);
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95
|
||||
* $Id: vfs_subr.c,v 1.178 1999/01/02 11:34:55 bde Exp $
|
||||
* $Id: vfs_subr.c,v 1.179 1999/01/05 18:12:29 eivind Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -510,7 +510,7 @@ getnewvnode(tag, mp, vops, vpp)
|
||||
vp->v_data = 0;
|
||||
splx(s);
|
||||
|
||||
vfs_object_create(vp, p, p->p_ucred, TRUE);
|
||||
vfs_object_create(vp, p, p->p_ucred);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@ -2499,27 +2499,20 @@ vfs_msync(struct mount *mp, int flags) {
|
||||
* afford the additional metadata buffering capability of the
|
||||
* VMIO code by making the device node be VMIO mode also.
|
||||
*
|
||||
* If !waslocked, must be called with interlock.
|
||||
* vp must be locked when vfs_object_create is called.
|
||||
*/
|
||||
int
|
||||
vfs_object_create(vp, p, cred, waslocked)
|
||||
vfs_object_create(vp, p, cred)
|
||||
struct vnode *vp;
|
||||
struct proc *p;
|
||||
struct ucred *cred;
|
||||
int waslocked;
|
||||
{
|
||||
struct vattr vat;
|
||||
vm_object_t object;
|
||||
int error = 0;
|
||||
|
||||
if ((vp->v_type != VREG) && (vp->v_type != VBLK)) {
|
||||
if (!waslocked)
|
||||
simple_unlock(&vp->v_interlock);
|
||||
if ((vp->v_type != VREG) && (vp->v_type != VBLK))
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!waslocked)
|
||||
vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK | LK_RETRY, p);
|
||||
|
||||
retry:
|
||||
if ((object = vp->v_object) == NULL) {
|
||||
@ -2547,16 +2540,10 @@ vfs_object_create(vp, p, cred, waslocked)
|
||||
}
|
||||
}
|
||||
|
||||
if (vp->v_object) {
|
||||
if (vp->v_object)
|
||||
vp->v_flag |= VOBJBUF;
|
||||
}
|
||||
|
||||
retn:
|
||||
if (!waslocked) {
|
||||
simple_lock(&vp->v_interlock);
|
||||
VOP_UNLOCK(vp, LK_INTERLOCK, p);
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
|
||||
* $Id: vfs_syscalls.c,v 1.110 1998/11/03 14:29:09 peter Exp $
|
||||
* $Id: vfs_syscalls.c,v 1.111 1998/12/12 21:07:09 dillon Exp $
|
||||
*/
|
||||
|
||||
/* For 4.3 integer FS ID compatibility */
|
||||
@ -976,7 +976,7 @@ open(p, uap)
|
||||
fp->f_flag |= FHASLOCK;
|
||||
}
|
||||
if ((vp->v_type == VREG) && (vp->v_object == NULL))
|
||||
vfs_object_create(vp, p, p->p_ucred, TRUE);
|
||||
vfs_object_create(vp, p, p->p_ucred);
|
||||
VOP_UNLOCK(vp, 0, p);
|
||||
p->p_retval[0] = indx;
|
||||
return (0);
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_lookup.c 8.4 (Berkeley) 2/16/94
|
||||
* $Id: vfs_lookup.c,v 1.27 1998/04/08 18:31:57 wosch Exp $
|
||||
* $Id: vfs_lookup.c,v 1.28 1998/06/07 17:11:45 dfr Exp $
|
||||
*/
|
||||
|
||||
#include "opt_ktrace.h"
|
||||
@ -168,9 +168,11 @@ namei(ndp)
|
||||
|
||||
if (ndp->ni_vp && ndp->ni_vp->v_type == VREG &&
|
||||
(cnp->cn_nameiop != DELETE) &&
|
||||
((cnp->cn_flags & (NOOBJ|LOCKLEAF)) == LOCKLEAF))
|
||||
((cnp->cn_flags & (NOOBJ|LOCKLEAF)) ==
|
||||
LOCKLEAF))
|
||||
vfs_object_create(ndp->ni_vp,
|
||||
ndp->ni_cnd.cn_proc, ndp->ni_cnd.cn_cred, 1);
|
||||
ndp->ni_cnd.cn_proc,
|
||||
ndp->ni_cnd.cn_cred);
|
||||
|
||||
return (0);
|
||||
}
|
||||
@ -698,7 +700,7 @@ relookup(dvp, vpp, cnp)
|
||||
|
||||
if (dp->v_type == VREG &&
|
||||
((cnp->cn_flags & (NOOBJ|LOCKLEAF)) == LOCKLEAF))
|
||||
vfs_object_create(dp, cnp->cn_proc, cnp->cn_cred, 1);
|
||||
vfs_object_create(dp, cnp->cn_proc, cnp->cn_cred);
|
||||
|
||||
if ((cnp->cn_flags & LOCKLEAF) == 0)
|
||||
VOP_UNLOCK(dp, 0, p);
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95
|
||||
* $Id: vfs_subr.c,v 1.178 1999/01/02 11:34:55 bde Exp $
|
||||
* $Id: vfs_subr.c,v 1.179 1999/01/05 18:12:29 eivind Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -510,7 +510,7 @@ getnewvnode(tag, mp, vops, vpp)
|
||||
vp->v_data = 0;
|
||||
splx(s);
|
||||
|
||||
vfs_object_create(vp, p, p->p_ucred, TRUE);
|
||||
vfs_object_create(vp, p, p->p_ucred);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@ -2499,27 +2499,20 @@ vfs_msync(struct mount *mp, int flags) {
|
||||
* afford the additional metadata buffering capability of the
|
||||
* VMIO code by making the device node be VMIO mode also.
|
||||
*
|
||||
* If !waslocked, must be called with interlock.
|
||||
* vp must be locked when vfs_object_create is called.
|
||||
*/
|
||||
int
|
||||
vfs_object_create(vp, p, cred, waslocked)
|
||||
vfs_object_create(vp, p, cred)
|
||||
struct vnode *vp;
|
||||
struct proc *p;
|
||||
struct ucred *cred;
|
||||
int waslocked;
|
||||
{
|
||||
struct vattr vat;
|
||||
vm_object_t object;
|
||||
int error = 0;
|
||||
|
||||
if ((vp->v_type != VREG) && (vp->v_type != VBLK)) {
|
||||
if (!waslocked)
|
||||
simple_unlock(&vp->v_interlock);
|
||||
if ((vp->v_type != VREG) && (vp->v_type != VBLK))
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!waslocked)
|
||||
vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK | LK_RETRY, p);
|
||||
|
||||
retry:
|
||||
if ((object = vp->v_object) == NULL) {
|
||||
@ -2547,16 +2540,10 @@ vfs_object_create(vp, p, cred, waslocked)
|
||||
}
|
||||
}
|
||||
|
||||
if (vp->v_object) {
|
||||
if (vp->v_object)
|
||||
vp->v_flag |= VOBJBUF;
|
||||
}
|
||||
|
||||
retn:
|
||||
if (!waslocked) {
|
||||
simple_lock(&vp->v_interlock);
|
||||
VOP_UNLOCK(vp, LK_INTERLOCK, p);
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
|
||||
* $Id: vfs_syscalls.c,v 1.110 1998/11/03 14:29:09 peter Exp $
|
||||
* $Id: vfs_syscalls.c,v 1.111 1998/12/12 21:07:09 dillon Exp $
|
||||
*/
|
||||
|
||||
/* For 4.3 integer FS ID compatibility */
|
||||
@ -976,7 +976,7 @@ open(p, uap)
|
||||
fp->f_flag |= FHASLOCK;
|
||||
}
|
||||
if ((vp->v_type == VREG) && (vp->v_object == NULL))
|
||||
vfs_object_create(vp, p, p->p_ucred, TRUE);
|
||||
vfs_object_create(vp, p, p->p_ucred);
|
||||
VOP_UNLOCK(vp, 0, p);
|
||||
p->p_retval[0] = indx;
|
||||
return (0);
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_vnops.c 8.2 (Berkeley) 1/21/94
|
||||
* $Id: vfs_vnops.c,v 1.59 1998/06/27 06:43:09 phk Exp $
|
||||
* $Id: vfs_vnops.c,v 1.60 1998/11/02 02:36:16 peter Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -172,7 +172,7 @@ vn_open(ndp, fmode, cmode)
|
||||
* Make sure that a VM object is created for VMIO support.
|
||||
*/
|
||||
if (vp->v_type == VREG) {
|
||||
if ((error = vfs_object_create(vp, p, cred, 1)) != 0)
|
||||
if ((error = vfs_object_create(vp, p, cred)) != 0)
|
||||
goto bad;
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95
|
||||
* $Id: nfs_subs.c,v 1.68 1998/12/07 21:58:44 archie Exp $
|
||||
* $Id: nfs_subs.c,v 1.69 1998/12/14 18:54:03 dt Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -2177,7 +2177,7 @@ nfsrv_object_create(vp)
|
||||
if (vp == NULL || vp->v_type != VREG)
|
||||
return (1);
|
||||
return (vfs_object_create(vp, curproc,
|
||||
curproc ? curproc->p_ucred : NULL, 1));
|
||||
curproc ? curproc->p_ucred : NULL));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95
|
||||
* $Id: nfs_subs.c,v 1.68 1998/12/07 21:58:44 archie Exp $
|
||||
* $Id: nfs_subs.c,v 1.69 1998/12/14 18:54:03 dt Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -2177,7 +2177,7 @@ nfsrv_object_create(vp)
|
||||
if (vp == NULL || vp->v_type != VREG)
|
||||
return (1);
|
||||
return (vfs_object_create(vp, curproc,
|
||||
curproc ? curproc->p_ucred : NULL, 1));
|
||||
curproc ? curproc->p_ucred : NULL));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95
|
||||
* $Id: nfs_subs.c,v 1.68 1998/12/07 21:58:44 archie Exp $
|
||||
* $Id: nfs_subs.c,v 1.69 1998/12/14 18:54:03 dt Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -2177,7 +2177,7 @@ nfsrv_object_create(vp)
|
||||
if (vp == NULL || vp->v_type != VREG)
|
||||
return (1);
|
||||
return (vfs_object_create(vp, curproc,
|
||||
curproc ? curproc->p_ucred : NULL, 1));
|
||||
curproc ? curproc->p_ucred : NULL));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95
|
||||
* $Id: nfs_subs.c,v 1.68 1998/12/07 21:58:44 archie Exp $
|
||||
* $Id: nfs_subs.c,v 1.69 1998/12/14 18:54:03 dt Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -2177,7 +2177,7 @@ nfsrv_object_create(vp)
|
||||
if (vp == NULL || vp->v_type != VREG)
|
||||
return (1);
|
||||
return (vfs_object_create(vp, curproc,
|
||||
curproc ? curproc->p_ucred : NULL, 1));
|
||||
curproc ? curproc->p_ucred : NULL));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vnode.h 8.7 (Berkeley) 2/4/94
|
||||
* $Id: vnode.h,v 1.77 1998/10/31 14:05:11 peter Exp $
|
||||
* $Id: vnode.h,v 1.78 1998/11/10 09:04:09 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_VNODE_H_
|
||||
@ -516,7 +516,7 @@ int vn_stat __P((struct vnode *vp, struct stat *sb, struct proc *p));
|
||||
void vn_syncer_add_to_worklist __P((struct vnode *vp, int delay));
|
||||
int vfs_cache_lookup __P((struct vop_lookup_args *ap));
|
||||
int vfs_object_create __P((struct vnode *vp, struct proc *p,
|
||||
struct ucred *cred, int waslocked));
|
||||
struct ucred *cred));
|
||||
int vn_writechk __P((struct vnode *vp));
|
||||
int vop_stdbwrite __P((struct vop_bwrite_args *ap));
|
||||
int vop_stdislocked __P((struct vop_islocked_args *));
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ffs_vfsops.c 8.31 (Berkeley) 5/20/95
|
||||
* $Id: ffs_vfsops.c,v 1.92 1998/10/31 15:31:27 peter Exp $
|
||||
* $Id: ffs_vfsops.c,v 1.93 1999/01/02 01:32:36 eivind Exp $
|
||||
*/
|
||||
|
||||
#include "opt_quota.h"
|
||||
@ -460,7 +460,7 @@ ffs_reload(mp, cred, p)
|
||||
*/
|
||||
if (devvp->v_tag != VT_MFS && devvp->v_type == VBLK) {
|
||||
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
|
||||
vfs_object_create(devvp, p, p->p_ucred, 1);
|
||||
vfs_object_create(devvp, p, p->p_ucred);
|
||||
simple_lock(&devvp->v_interlock);
|
||||
VOP_UNLOCK(devvp, LK_INTERLOCK, p);
|
||||
}
|
||||
@ -617,7 +617,7 @@ ffs_mountfs(devvp, mp, p, malloctype)
|
||||
*/
|
||||
if (devvp->v_tag != VT_MFS && devvp->v_type == VBLK) {
|
||||
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
|
||||
vfs_object_create(devvp, p, p->p_ucred, 1);
|
||||
vfs_object_create(devvp, p, p->p_ucred);
|
||||
simple_lock(&devvp->v_interlock);
|
||||
VOP_UNLOCK(devvp, LK_INTERLOCK, p);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user