mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
Turn #ifdef LOOKUP_SHARED into #ifndef LOOKUP_EXCLUSIVE to enable this
behavior by default. Also, change the options line to reflect this. If there are no problems reported this will become the only behavior and the knob will be removed in a month or so. Demanded by: obrien
This commit is contained in:
parent
1de038230a
commit
a59f8b9e6c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=94262
@ -383,7 +383,7 @@ BLKDEV_IOSIZE opt_global.h
|
||||
DEBUG opt_global.h
|
||||
DEBUG_LOCKS opt_global.h
|
||||
DEBUG_VFS_LOCKS opt_global.h
|
||||
LOOKUP_SHARED opt_global.h
|
||||
LOOKUP_EXCLUSIVE opt_global.h
|
||||
DIAGNOSTIC opt_global.h
|
||||
ENABLE_VFS_IOOPT opt_global.h
|
||||
INVARIANT_SUPPORT opt_global.h
|
||||
@ -397,6 +397,7 @@ VM_KMEM_SIZE opt_vm.h
|
||||
VM_KMEM_SIZE_SCALE opt_vm.h
|
||||
VM_KMEM_SIZE_MAX opt_vm.h
|
||||
NO_SWAPPING opt_vm.h
|
||||
MALLOC_PROFILE opt_vm.h
|
||||
PQ_NOOPT opt_vmpage.h
|
||||
PQ_NORMALCACHE opt_vmpage.h
|
||||
PQ_MEDIUMCACHE opt_vmpage.h
|
||||
|
@ -566,7 +566,7 @@ vfs_cache_lookup(ap)
|
||||
|
||||
error = cache_lookup(dvp, vpp, cnp);
|
||||
|
||||
#ifdef LOOKUP_SHARED
|
||||
#ifndef LOOKUP_EXCLUSIVE
|
||||
if (!error) {
|
||||
/* We do this because the rest of the system now expects to get
|
||||
* a shared lock, which is later upgraded if LOCKSHARED is not
|
||||
@ -608,7 +608,7 @@ vfs_cache_lookup(ap)
|
||||
} else if (flags & ISDOTDOT) {
|
||||
VOP_UNLOCK(dvp, 0, td);
|
||||
cnp->cn_flags |= PDIRUNLOCK;
|
||||
#ifdef LOOKUP_SHARED
|
||||
#ifndef LOOKUP_EXCLUSIVE
|
||||
if ((flags & ISLASTCN) && (flags & LOCKSHARED))
|
||||
error = vget(vp, LK_SHARED, td);
|
||||
else
|
||||
@ -622,7 +622,7 @@ vfs_cache_lookup(ap)
|
||||
cnp->cn_flags &= ~PDIRUNLOCK;
|
||||
}
|
||||
} else {
|
||||
#ifdef LOOKUP_SHARED
|
||||
#ifndef LOOKUP_EXCLUSIVE
|
||||
if ((flags & ISLASTCN) && (flags & LOCKSHARED))
|
||||
error = vget(vp, LK_SHARED, td);
|
||||
else
|
||||
@ -654,7 +654,7 @@ vfs_cache_lookup(ap)
|
||||
return (error);
|
||||
cnp->cn_flags &= ~PDIRUNLOCK;
|
||||
}
|
||||
#ifdef LOOKUP_SHARED
|
||||
#ifndef LOOKUP_EXCLUSIVE
|
||||
error = VOP_CACHEDLOOKUP(dvp, vpp, cnp);
|
||||
|
||||
if (!error) {
|
||||
|
@ -2577,7 +2577,7 @@ stat(td, uap)
|
||||
int error;
|
||||
struct nameidata nd;
|
||||
|
||||
#ifdef LOOKUP_SHARED
|
||||
#ifndef LOOKUP_EXCLUSIVE
|
||||
NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | NOOBJ,
|
||||
UIO_USERSPACE, SCARG(uap, path), td);
|
||||
#else
|
||||
|
@ -2577,7 +2577,7 @@ stat(td, uap)
|
||||
int error;
|
||||
struct nameidata nd;
|
||||
|
||||
#ifdef LOOKUP_SHARED
|
||||
#ifndef LOOKUP_EXCLUSIVE
|
||||
NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | NOOBJ,
|
||||
UIO_USERSPACE, SCARG(uap, path), td);
|
||||
#else
|
||||
|
@ -106,7 +106,7 @@ vn_open_cred(ndp, flagp, cmode, cred)
|
||||
struct vattr vat;
|
||||
struct vattr *vap = &vat;
|
||||
int mode, fmode, error;
|
||||
#ifdef LOOKUP_SHARED
|
||||
#ifndef LOOKUP_EXCLUSIVE
|
||||
int exclusive; /* The current intended lock state */
|
||||
|
||||
exclusive = 0;
|
||||
@ -149,7 +149,7 @@ vn_open_cred(ndp, flagp, cmode, cred)
|
||||
ASSERT_VOP_LOCKED(ndp->ni_vp, "create");
|
||||
fmode &= ~O_TRUNC;
|
||||
vp = ndp->ni_vp;
|
||||
#ifdef LOOKUP_SHARED
|
||||
#ifndef LOOKUP_EXCLUSIVE
|
||||
exclusive = 1;
|
||||
#endif
|
||||
} else {
|
||||
@ -167,7 +167,7 @@ vn_open_cred(ndp, flagp, cmode, cred)
|
||||
}
|
||||
} else {
|
||||
ndp->ni_cnd.cn_nameiop = LOOKUP;
|
||||
#ifdef LOOKUP_SHARED
|
||||
#ifndef LOOKUP_EXCLUSIVE
|
||||
ndp->ni_cnd.cn_flags =
|
||||
((fmode & O_NOFOLLOW) ? NOFOLLOW : FOLLOW) |
|
||||
LOCKSHARED | LOCKLEAF;
|
||||
@ -213,7 +213,7 @@ vn_open_cred(ndp, flagp, cmode, cred)
|
||||
* Make sure that a VM object is created for VMIO support.
|
||||
*/
|
||||
if (vn_canvmio(vp) == TRUE) {
|
||||
#ifdef LOOKUP_SHARED
|
||||
#ifndef LOOKUP_EXCLUSIVE
|
||||
int flock;
|
||||
|
||||
if (!exclusive && vp->v_object == NULL)
|
||||
@ -236,7 +236,7 @@ vn_open_cred(ndp, flagp, cmode, cred)
|
||||
*flagp = fmode;
|
||||
return (error);
|
||||
}
|
||||
#ifdef LOOKUP_SHARED
|
||||
#ifndef LOOKUP_EXCLUSIVE
|
||||
flock = VOP_ISLOCKED(vp, td);
|
||||
if (!exclusive && flock == LK_EXCLUSIVE)
|
||||
VOP_LOCK(vp, LK_DOWNGRADE, td);
|
||||
|
Loading…
Reference in New Issue
Block a user