]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Remove nonsensical bozon-lock defines
authorAndrew Deason <adeason@sinenomine.net>
Fri, 24 Jun 2011 21:23:13 +0000 (16:23 -0500)
committerDerrick Brashear <shadow@dementia.org>
Thu, 30 Jun 2011 14:27:52 +0000 (07:27 -0700)
Currently there are two preprocessor defines related to bozon locks:
AFS_BOZONLOCK_ENV, and AFS_NOBOZO_LOCK. The former creates the pvnLock
member of a struct vcache, and controls calls to e.g. afs_BozonLock in
cross-platform code. The latter, if defined, turns calls to e.g.
afs_BozonLock into no-ops.

It doesn't make any sense to have both of these, since if
AFS_BOZONLOCK_ENV and AFS_NOBOZO_LOCK are defined, the pvnLock member
exists but is never used, since afs_BozonLock &co are no-ops. On
Solaris, the only platform where AFS_NOBOZO_LOCK is currently defined
(DUX used to define it before DUX was dropped), this is the case.

So to make things a bit more clear, get rid of the AFS_NOBOZO_LOCK
define, and just use AFS_BOZONLOCK_ENV to dictate whether we do
anything with bozon locks (ppc_darwin_80 appears to be the only
platform at this time).

Remove AFS_BOZONLOCK_ENV from Solaris param files, since it doesn't
use bozon locks. Remove all references to pvnLock in Solaris-specific
code.

Change-Id: Id72c14ec5485d35b853d38e2ea1a944a385f2b5b
Reviewed-on: http://gerrit.openafs.org/4889
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 files changed:
src/afs/SOLARIS/osi_vcache.c
src/afs/SOLARIS/osi_vm.c
src/afs/SOLARIS/osi_vnodeops.c
src/afs/VNOPS/afs_vnop_attrs.c
src/afs/afs_lock.c
src/afs/afs_prototypes.h
src/afs/lock.h
src/config/param.sun4x_510.h
src/config/param.sun4x_511.h
src/config/param.sun4x_58.h
src/config/param.sun4x_59.h
src/config/param.sunx86_510.h
src/config/param.sunx86_511.h
src/config/param.sunx86_58.h
src/config/param.sunx86_59.h

index 1f19690cb68ea49b76af4ef866d65c851c4e0bc4..e5a98be17275d935f9452b3a689d311955d0af85 100644 (file)
@@ -55,10 +55,6 @@ osi_PrePopulateVCache(struct vcache *avc) {
      ** for the time being, we fill up the v_data field with the
      ** vnode pointer itself. */
     avc->v.v_data = (char *)avc;
-
-#if defined(AFS_BOZONLOCK_ENV)
-    afs_BozonInit(&avc->pvnLock, avc);
-#endif
 }
 
 void
index 4914120a32ca50a5f3c3813608d988817d221f2d..ece7471bfe52de0886d77b5a98114c97c68d79fe 100644 (file)
@@ -80,8 +80,6 @@ osi_VM_FlushVCache(struct vcache *avc, int *slept)
     /* if a lock is held, give up */
     if (CheckLock(&avc->lock))
        return EBUSY;
-    if (afs_CheckBozonLock(&avc->pvnLock))
-       return EBUSY;
 
     AFS_GUNLOCK();
     pvn_vplist_dirty(AFSTOV(avc), 0, NULL, B_TRUNC | B_INVAL, CRED());
index d2ae6948d842a255a07f9c06b11f1d56565696f6..514294e7b5981da0df7ba837760ba71b6434406e 100644 (file)
@@ -162,10 +162,8 @@ afs_getpage(struct vnode *vp, offset_t off, u_int len, u_int *protp,
        ObtainWriteLock(&vcp->vlock, 548);
        vcp->multiPage++;
        ReleaseWriteLock(&vcp->vlock);
-       afs_BozonLock(&vcp->pvnLock, vcp);
        code =
            pvn_getpages(afs_GetOnePage, vp, off, len, protp, pl, plsz, seg, addr, rw, acred);
-       afs_BozonUnlock(&vcp->pvnLock, vcp);
        ObtainWriteLock(&vcp->vlock, 549);
        vcp->multiPage--;
        ReleaseWriteLock(&vcp->vlock);
@@ -291,7 +289,6 @@ afs_GetOnePage(struct vnode *vp, u_offset_t off, u_int alen, u_int *protp,
        return afs_CheckCode(code, &treq, 44);  /* failed to get it */
     }
 
-    afs_BozonLock(&avc->pvnLock, avc);
     ObtainReadLock(&avc->lock);
 
     afs_Trace4(afs_iclSetp, CM_TRACE_PAGEIN, ICL_TYPE_POINTER, (afs_int32) vp,
@@ -307,7 +304,6 @@ afs_GetOnePage(struct vnode *vp, u_offset_t off, u_int alen, u_int *protp,
     if (avc->activeV) {
        ReleaseReadLock(&avc->lock);
        ReleaseWriteLock(&avc->vlock);
-       afs_BozonUnlock(&avc->pvnLock, avc);
        afs_PutDCache(tdc);
        /* Check activeV again, it may have been turned off
         * while we were waiting for a lock in afs_PutDCache */
@@ -331,7 +327,6 @@ afs_GetOnePage(struct vnode *vp, u_offset_t off, u_int alen, u_int *protp,
        || !hsame(avc->f.m.DataVersion, tdc->f.versionNo)) {
        ReleaseReadLock(&tdc->lock);
        ReleaseReadLock(&avc->lock);
-       afs_BozonUnlock(&avc->pvnLock, avc);
        afs_PutDCache(tdc);
        goto retry;
     }
@@ -425,7 +420,6 @@ afs_GetOnePage(struct vnode *vp, u_offset_t off, u_int alen, u_int *protp,
     }
     afs_indexFlags[tdc->index] |= IFAnyPages;
     ReleaseWriteLock(&afs_xdcache);
-    afs_BozonUnlock(&avc->pvnLock, avc);
     afs_PutDCache(tdc);
     afs_Trace3(afs_iclSetp, CM_TRACE_PAGEINDONE, ICL_TYPE_LONG, code,
               ICL_TYPE_LONG, (int)page, ICL_TYPE_LONG, Code);
@@ -439,7 +433,6 @@ afs_GetOnePage(struct vnode *vp, u_offset_t off, u_int alen, u_int *protp,
     if (page)
        pvn_read_done(page, B_ERROR);
     ReleaseReadLock(&avc->lock);
-    afs_BozonUnlock(&avc->pvnLock, avc);
     ReleaseReadLock(&tdc->lock);
     afs_PutDCache(tdc);
     return code;
@@ -470,7 +463,6 @@ afs_putpage(struct vnode *vp, offset_t off, u_int len, int flags,
               (afs_int32) vp, ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(off),
               ICL_TYPE_INT32, (afs_int32) len, ICL_TYPE_LONG, (int)flags);
     avc = VTOAFS(vp);
-    afs_BozonLock(&avc->pvnLock, avc);
     ObtainSharedLock(&avc->lock, 247);
     didWriteLock = 0;
 
@@ -529,7 +521,6 @@ afs_putpage(struct vnode *vp, offset_t off, u_int len, int flags,
        ReleaseWriteLock(&avc->lock);
     else
        ReleaseSharedLock(&avc->lock);
-    afs_BozonUnlock(&avc->pvnLock, avc);
     afs_Trace2(afs_iclSetp, CM_TRACE_PAGEOUTDONE, ICL_TYPE_LONG, code,
               ICL_TYPE_LONG, NPages);
     AFS_GUNLOCK();
@@ -654,8 +645,7 @@ afs_nfsrdwr(struct vcache *avc, struct uio *auio, enum uio_rw arw,
     if (code)
        return afs_CheckCode(code, &treq, 45);
 
-    afs_BozonLock(&avc->pvnLock, avc);
-    osi_FlushPages(avc, acred);        /* hold bozon lock, but not basic vnode lock */
+    osi_FlushPages(avc, acred);
 
     ObtainWriteLock(&avc->lock, 250);
 
@@ -665,14 +655,12 @@ afs_nfsrdwr(struct vcache *avc, struct uio *auio, enum uio_rw arw,
     }
     if (auio->afsio_offset < 0 || (auio->afsio_offset + auio->uio_resid) < 0) {
        ReleaseWriteLock(&avc->lock);
-       afs_BozonUnlock(&avc->pvnLock, avc);
        return EINVAL;
     }
 #ifndef AFS_64BIT_CLIENT
     /* file is larger than 2GB */
     if (AfsLargeFileSize(auio->uio_offset, auio->uio_resid)) {
        ReleaseWriteLock(&avc->lock);
-       afs_BozonUnlock(&avc->pvnLock, avc);
        return EFBIG;
     }
 #endif
@@ -683,7 +671,6 @@ afs_nfsrdwr(struct vcache *avc, struct uio *auio, enum uio_rw arw,
        if (auio->uio_loffset + auio->afsio_resid > auio->uio_llimit) {
            if (auio->uio_loffset >= auio->uio_llimit) {
                ReleaseWriteLock(&avc->lock);
-               afs_BozonUnlock(&avc->pvnLock, avc);
                return EFBIG;
            } else {
                /* track # of bytes we should write, but won't because of
@@ -724,7 +711,6 @@ afs_nfsrdwr(struct vcache *avc, struct uio *auio, enum uio_rw arw,
                (avc, PRSFS_READ, &treq,
                 CHECK_MODE_BITS | CMB_ALLOW_EXEC_AS_READ)) {
                ReleaseWriteLock(&avc->lock);
-               afs_BozonUnlock(&avc->pvnLock, avc);
                return EACCES;
            }
        }
@@ -900,7 +886,6 @@ afs_nfsrdwr(struct vcache *avc, struct uio *auio, enum uio_rw arw,
        code = avc->vc_error;
     }
     ReleaseWriteLock(&avc->lock);
-    afs_BozonUnlock(&avc->pvnLock, avc);
     if (!code) {
        if ((ioflag & FSYNC) && (arw == UIO_WRITE)
            && !AFS_NFSXLATORREQ(acred))
@@ -956,10 +941,8 @@ afs_map(struct vnode *vp, offset_t off, struct as *as, caddr_t *addr, u_int len,
     if (code) {
        goto out;
     }
-    afs_BozonLock(&avc->pvnLock, avc);
     osi_FlushPages(avc, cred); /* ensure old pages are gone */
     avc->f.states |= CMAPPED;  /* flag cleared at afs_inactive */
-    afs_BozonUnlock(&avc->pvnLock, avc);
 
     AFS_GUNLOCK();
     as_rangelock(as);
index 189f5dafd24f71ba725e867707ee221e82436f1f..13708d1d453586ea5e909bb8d4989c3247ca3ee9 100644 (file)
@@ -248,9 +248,11 @@ afs_getattr(OSI_VC_DECL(avc), struct vattr *attrs, afs_ucred_t *acred)
     } else
        code = 0;
 
-#ifdef AFS_BOZONLOCK_ENV
+#if defined(AFS_SUN5_ENV) || defined(AFS_BOZONLOCK_ENV)
     if (code == 0)
        osi_FlushPages(avc, acred);
+#endif
+#ifdef AFS_BOZONLOCK_ENV
     afs_BozonUnlock(&avc->pvnLock, avc);
 #endif
 
index 58a081d6a44ba49989bd616fa94d58002117ef50..f0d43c62c3ce5cc00074b4e1a07b6da1279bd682 100644 (file)
@@ -261,7 +261,7 @@ afs_osi_SleepS(char *addr, struct afs_lock *alock)
 }
 
 
-#ifndef        AFS_NOBOZO_LOCK
+#ifdef AFS_BOZONLOCK_ENV
 /* operations on locks that don't mind if we lock the same thing twice.  I'd like to dedicate
     this function to Sun Microsystems' Version 4.0 virtual memory system, without
     which this wouldn't have been necessary */
@@ -329,7 +329,7 @@ afs_CheckBozonLockBlocking(struct afs_bozoLock *alock)
            return 1;
     return 0;
 }
-#endif
+#endif /* AFS_BOZONLOCK_ENV */
 
 /* Not static - used conditionally if lock tracing is enabled */
 int
index b0e71a0de5464b52d2f18c1e7df1636c16754301..1f1e15f14cd095fb7bc141cb7f0c3dc6ace652b3 100644 (file)
@@ -467,7 +467,7 @@ extern void afs_osi_SleepW(char *addr,
                           struct afs_lock *alock);
 extern void afs_osi_SleepS(char *addr,
                           struct afs_lock *alock);
-#ifndef AFS_NOBOZO_LOCK
+#ifdef AFS_BOZONLOCK_ENV
 extern void afs_BozonLock(struct afs_bozoLock *alock, struct vcache *avc);
 extern void afs_BozonUnlock(struct afs_bozoLock *alock, struct vcache *avc);
 extern void afs_BozonInit(struct afs_bozoLock *alock, struct vcache *avc);
index 04b0abba816c6b28d08aa94c8fdf6b81e314374a..cb17b2b35fa2d2465a88b2588da2de42af2dcf19 100644 (file)
  * LICENSED MATERIALS - PROPERTY OF IBM
  */
 
-#if    (defined(AFS_SUN5_ENV))
-#define        AFS_NOBOZO_LOCK
-#endif
-
 #define INSTRUMENT_LOCKS
 /* This is the max lock number in use. Please update it if you add any new
  * lock numbers.
  */
 #define MAX_LOCK_NUMBER 780
 
+#ifdef AFS_BOZONLOCK_ENV
 struct afs_bozoLock {
     short count;               /* count of excl locks */
     char flags;                        /* bit 1: is anyone waiting? */
     char spare;                        /* for later */
     char *proc;                        /* process holding the lock, really an afs_proc_t * */
 };
-#ifndef        AFS_NOBOZO_LOCK
-typedef struct afs_bozoLock afs_bozoLock_t;
-#else
-#ifdef AFS_SUN5_ENV
-typedef kmutex_t afs_bozoLock_t;
-#else
 typedef struct afs_bozoLock afs_bozoLock_t;
-#endif
-#define afs_BozonLock(lock, avc)
-#define afs_BozonUnlock(lock, avc)
-#define afs_BozonInit(lock, nm)
-#define        afs_CheckBozonLock(lock)                0
-#define afs_CheckBozonLockBlocking(lock)       0
-#endif
 
 #define        AFS_BOZONWAITING    1   /* someone is waiting for this lock */
+#endif
 
 #define        AFS_RWLOCK_INIT(lock, nm)       Lock_Init(lock)
 #undef LOCK_INIT
index dae0241658bf358148e995e9c107d8d2d88672a6..7225b56e7d53bb2fa56ad720fc5d74df76c3f7b7 100644 (file)
@@ -14,7 +14,6 @@
 #define AFS_SUN5_ENV           1
 #define AFS_SUN59_ENV          1
 #define AFS_SUN510_ENV         1
-#define AFS_BOZONLOCK_ENV       1
 
 #define AFS_64BIT_CLIENT       1
 
index a7c13272b054e4d63238e5efb4d803636ebd95a5..d5a4a283a580e0de36f9a450a6efa49492fd790d 100644 (file)
@@ -15,7 +15,6 @@
 #define AFS_SUN59_ENV          1
 #define AFS_SUN510_ENV         1
 #define AFS_SUN511_ENV         1
-#define AFS_BOZONLOCK_ENV       1
 
 #define AFS_64BIT_CLIENT       1
 
index 8acc4aed7b0d5af001c33a2c707ec1a7e0d2db92..fff3b841cf929859fd9fc89f0fd8aa49c0175d26 100644 (file)
@@ -12,7 +12,6 @@
 #define AFS_ENV                        1
 #define AFS_SUN_ENV            1
 #define AFS_SUN5_ENV           1
-#define AFS_BOZONLOCK_ENV       1
 
 #define AFS_64BIT_CLIENT       1
 
index fa6697c446e8564d2fe60246806bcebfd3bff02c..a80573c21e318bb8e540976dcdb39d2830302517 100644 (file)
@@ -13,7 +13,6 @@
 #define AFS_SUN_ENV            1
 #define AFS_SUN5_ENV           1
 #define AFS_SUN59_ENV          1
-#define AFS_BOZONLOCK_ENV       1
 
 #define AFS_64BIT_CLIENT       1
 
index 0f5c17f209483a07eefeec558d4c4d68e9b436a7..af43b1e3dcdd608f441c857bf27b4a8ce6778444 100644 (file)
@@ -23,7 +23,6 @@
 #define AFS_SUN5_ENV           1
 #define AFS_SUN59_ENV          1
 #define AFS_SUN510_ENV         1
-#define AFS_BOZONLOCK_ENV       1
 #define AFS_X86_ENV            1
 
 #define AFS_64BIT_CLIENT       1
index b4d8509572615416b9c3586bbb647212c09679fa..5ebc56e06f28e2ca47e5b6d9e71dc8671d743760 100644 (file)
@@ -24,7 +24,6 @@
 #define AFS_SUN59_ENV          1
 #define AFS_SUN510_ENV         1
 #define AFS_SUN511_ENV         1
-#define AFS_BOZONLOCK_ENV       1
 #define AFS_X86_ENV            1
 
 #define AFS_64BIT_CLIENT       1
index c134333e9600f4ff727927ae2b2cd26c05afe735..246e99d05daf504dfca2db85c977f050009a4689 100644 (file)
@@ -21,7 +21,6 @@
 #define AFS_ENV                        1
 #define AFS_SUN_ENV            1
 #define AFS_SUN5_ENV           1
-#define AFS_BOZONLOCK_ENV       1
 
 #define AFS_X86_ENV            1
 
index 34c35839c02da0677350662818a3f9742afd4289..8eb9a15e2f766cb5f70e0d15f3a266dc2f4064f0 100644 (file)
@@ -22,7 +22,6 @@
 #define AFS_SUN_ENV            1
 #define AFS_SUN5_ENV           1
 #define AFS_SUN59_ENV          1
-#define AFS_BOZONLOCK_ENV       1
 
 #define AFS_X86_ENV            1