From 4bcd24e190ae1a69e7acd60d2e74d5c5a9383e63 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Mon, 15 Mar 2010 13:15:34 -0400 Subject: [PATCH] aix vnode hold simplification 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 Tested-by: Derrick Brashear --- src/afs/AIX/osi_machdep.h | 4 ---- src/afs/afs_callback.c | 12 ++---------- src/afs/afs_osi.h | 6 ++++++ src/afs/afs_pioctl.c | 4 +--- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/src/afs/AIX/osi_machdep.h b/src/afs/AIX/osi_machdep.h index 1cc84a846..27f1e51df 100644 --- a/src/afs/AIX/osi_machdep.h +++ b/src/afs/AIX/osi_machdep.h @@ -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) \ diff --git a/src/afs/afs_callback.c b/src/afs/afs_callback.c index ed6754298..f13436a78 100644 --- a/src/afs/afs_callback.c +++ b/src/afs/afs_callback.c @@ -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); diff --git a/src/afs/afs_osi.h b/src/afs/afs_osi.h index 2daff3611..b83f1d6e6 100644 --- a/src/afs/afs_osi.h +++ b/src/afs/afs_osi.h @@ -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 diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index 76ffba984..b0d690f87 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -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 -- 2.39.5