Linux: Remove use of undefined AFS_LINUX_ENV
authorMarc Dionne <marc.c.dionne@gmail.com>
Wed, 14 Sep 2011 21:16:52 +0000 (17:16 -0400)
committerDerrick Brashear <shadow@dementix.org>
Thu, 15 Sep 2011 03:49:57 +0000 (20:49 -0700)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

src/afs/afs.h
src/afs/afs_osi.c
src/afs/afs_osi.h

index 094bcfe..8b2badf 100644 (file)
@@ -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 */
index 6b9c002..b446e8b 100644 (file)
@@ -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
            }
index 2b81aa6..30f497d 100644 (file)
@@ -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