aix vnode hold simplification
authorDerrick Brashear <shadow@dementia.org>
Mon, 15 Mar 2010 17:15:34 +0000 (13:15 -0400)
committerDerrick Brashear <shadow@dementia.org>
Thu, 18 Mar 2010 03:04:18 +0000 (20:04 -0700)
instead of special-casing aix's AFS_FAST_xxx *and* calling
VREFCOUNT_INC for AIX, make it all consistent; side effect, remove
now-superfluous AIX ifdef'd code

Change-Id: Ic6a91429aad26e17fd9e12884ba0eba86564c377
Reviewed-on: http://gerrit.openafs.org/1572
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/afs/AIX/osi_machdep.h
src/afs/afs_callback.c
src/afs/afs_osi.h
src/afs/afs_pioctl.c

index 1cc84a8..27f1e51 100644 (file)
@@ -32,10 +32,6 @@ typedef struct proc afs_proc_t;
 #define afs_bufferpages v.v_bufhw
 
 #define osi_vnhold(avc, r) do { (avc)->vrefCount++; } while (0)
-#undef AFS_FAST_HOLD
-#define AFS_FAST_HOLD(vp) (vp)->vrefCount++
-#undef AFS_FAST_RELE
-#define AFS_FAST_RELE(vp) (vp)->vrefCount--
 
 #undef gop_lookupname
 #define        gop_lookupname(fnamep,segflg,followlink,compvpp) \
index ed67542..f13436a 100644 (file)
@@ -481,11 +481,7 @@ loop1:
                            AFS_GLOCK();
                        }
 #else
-#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
-                       osi_vnhold(tvc, 0);
-#else
-                       VREFCOUNT_INC(tvc); /* AIX, apparently */
-#endif
+                       AFS_FAST_HOLD(tvc);
 #endif
 #endif
                        ReleaseReadLock(&afs_xvcache);
@@ -580,11 +576,7 @@ loop2:
                        AFS_GLOCK();
                    }
 #else
-#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
-                   osi_vnhold(tvc, 0);
-#else
-                   VREFCOUNT_INC(tvc); /* AIX, apparently */
-#endif
+                   AFS_FAST_HOLD(tvc);
 #endif
 #endif
                    ReleaseReadLock(&afs_xvcache);
index 2daff36..b83f1d6 100644 (file)
@@ -246,10 +246,16 @@ typedef struct timeval osi_timeval_t;
 /* Bare refcount manipulation would probably work on this platform, but just
    calling VREF does not */
 #define AFS_FAST_HOLD(vp) osi_vnhold((vp),0)
+#elif defined(AFS_AIX_ENV)
+#define AFS_FAST_HOLD(vp) VREFCOUNT_INC(vp)
 #else
 #define AFS_FAST_HOLD(vp) VN_HOLD(AFSTOV(vp))
 #endif
+#ifdef AFS_AIX_ENV
+#define AFS_FAST_RELE(vp) VREFCOUNT_DEC(vp)
+#else
 #define AFS_FAST_RELE(vp) AFS_RELE(AFSTOV(vp))
+#endif
 
 /*
  * MP safe versions of routines to copy memory between user space
index 76ffba9..b0d690f 100644 (file)
@@ -3428,10 +3428,8 @@ DECL_PIOCTL(PFlushVolumeData)
                    vnode_recycle(AFSTOV(tvc));
                    AFS_GLOCK();
                }
-#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
-               osi_vnhold(tvc, 0);
 #else
-               VREFCOUNT_INC(tvc); /* AIX, apparently */
+               AFS_FAST_HOLD(tvc);
 #endif
                ReleaseReadLock(&afs_xvcache);
 #ifdef AFS_BOZONLOCK_ENV