From 236c18b36a93a1c4906f84c825f03f654f5ae4dc Mon Sep 17 00:00:00 2001 From: Marc Dionne Date: Wed, 14 Sep 2011 17:16:52 -0400 Subject: [PATCH] Linux: Remove use of undefined AFS_LINUX_ENV AFS_LINUX_ENV is used in a few places, mostly from commit dc077b83, but it is not defined anywhere. As a result the logic was not as intended. In the definition of osi_ThreadUnique, this means that on all Linux we use getpid(), which is OK as it gets defined appropriately under LINUX and LINUX24 as current->pid or current->tgid. Change-Id: Ic8daf10480a91ff8406cd6ca3929a2ecfafa78ad Reviewed-on: http://gerrit.openafs.org/5424 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/afs/afs.h | 2 +- src/afs/afs_osi.c | 6 +++--- src/afs/afs_osi.h | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/afs/afs.h b/src/afs/afs.h index 094bcfebdd..8b2badf557 100644 --- a/src/afs/afs.h +++ b/src/afs/afs.h @@ -1582,7 +1582,7 @@ typedef struct afs_event { /* no cond member */ #elif defined(AFS_FBSD_ENV) || defined(AFS_OBSD_ENV) int cond; /* "all this gluck should probably be replaced by CVs" */ -#elif defined(AFS_LINUX_ENV) || defined(AFS_LINUX24_ENV) +#elif defined(AFS_LINUX24_ENV) wait_queue_head_t cond; #elif defined(AFS_NBSD_ENV) || defined(AFS_SOLARIS_ENV) || defined(AFS_SGI_ENV) kcondvar_t cond; /* Currently associated condition variable */ diff --git a/src/afs/afs_osi.c b/src/afs/afs_osi.c index 6b9c002236..b446e8b06a 100644 --- a/src/afs/afs_osi.c +++ b/src/afs/afs_osi.c @@ -272,7 +272,7 @@ shutdown_osi(void) afs_osi_ctxtp_initialized = 0; } #endif -#if !defined(AFS_HPUX_ENV) && !defined(UKERNEL) && !defined(AFS_DFBSD_ENV) && !defined(AFS_LINUX_ENV) +#if !defined(AFS_HPUX_ENV) && !defined(UKERNEL) && !defined(AFS_DFBSD_ENV) && !defined(AFS_LINUX26_ENV) /* LINUX calls this from afs_cleanup() which hooks into module_exit */ shutdown_osisleep(); #endif @@ -301,9 +301,9 @@ shutdown_osisleep(void) afs_osi_Free(tmp, sizeof(*tmp)); #elif defined(AFS_SGI_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_SOLARIS_ENV) osi_FreeSmallSpace(tmp); -#elif defined(AFS_LINUX_ENV) +#elif defined(AFS_LINUX26_ENV) kfree(tmp); -#elif defined(AFS_LINUX24_ENV) +#elif defined(AFS_LINUX20_ENV) osi_linux_free(tmp); #endif } diff --git a/src/afs/afs_osi.h b/src/afs/afs_osi.h index 2b81aa6044..30f497d6e6 100644 --- a/src/afs/afs_osi.h +++ b/src/afs/afs_osi.h @@ -205,8 +205,6 @@ typedef struct timeval osi_timeval32_t; #ifdef AFS_FBSD_ENV /* should use curthread, but 'ps' can't display it */ #define osi_ThreadUnique() (curproc->p_pid) -#elif defined(AFS_LINUX_ENV) -#define osi_ThreadUnique() (current->pid) #elif defined(UKERNEL) #define osi_ThreadUnique() osi_getpid() #else