From 06f8a6232b7ad56a82dc94384dc950411107f48a Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Fri, 23 Apr 2010 18:38:02 +0100 Subject: [PATCH] Linux: Remove old code from RX kernel implementation The RX implementation was split into LINUX and LINUX24 along with the kernel, but the old 2.4 and 2.2 only code was never removed from the LINUX/ directory. Do so now. Change-Id: I80300a1390e297298f4af3c06086e25d0acf8c1a Reviewed-on: http://gerrit.openafs.org/1819 Reviewed-by: Derrick Brashear Reviewed-by: Marc Dionne Tested-by: Derrick Brashear --- src/rx/LINUX/rx_kmutex.c | 2 -- src/rx/LINUX/rx_kmutex.h | 12 ------------ src/rx/LINUX/rx_knet.c | 42 +++++++++++++--------------------------- 3 files changed, 13 insertions(+), 43 deletions(-) diff --git a/src/rx/LINUX/rx_kmutex.c b/src/rx/LINUX/rx_kmutex.c index ba35a1f7ee..27f5577e45 100644 --- a/src/rx/LINUX/rx_kmutex.c +++ b/src/rx/LINUX/rx_kmutex.c @@ -111,7 +111,6 @@ afs_cv_wait(afs_kcondvar_t * cv, afs_kmutex_t * l, int sigok) while(seq == cv->seq) { schedule(); -#ifdef AFS_LINUX26_ENV #ifdef CONFIG_PM if ( #ifdef PF_FREEZE @@ -134,7 +133,6 @@ afs_cv_wait(afs_kcondvar_t * cv, afs_kmutex_t * l, int sigok) refrigerator(); #endif set_current_state(TASK_INTERRUPTIBLE); -#endif #endif } diff --git a/src/rx/LINUX/rx_kmutex.h b/src/rx/LINUX/rx_kmutex.h index 6ea4faf078..c7bb559d5d 100644 --- a/src/rx/LINUX/rx_kmutex.h +++ b/src/rx/LINUX/rx_kmutex.h @@ -55,11 +55,7 @@ typedef struct afs_kmutex { typedef struct afs_kcondvar { int seq; -#if defined(AFS_LINUX24_ENV) wait_queue_head_t waitq; -#else - struct wait_queue *waitq; -#endif } afs_kcondvar_t; static inline int @@ -74,21 +70,13 @@ MUTEX_ISMINE(afs_kmutex_t * l) #define MUTEX_TRYENTER afs_mutex_tryenter #define MUTEX_EXIT afs_mutex_exit -#if defined(AFS_LINUX24_ENV) #define CV_INIT(cv,b,c,d) do { (cv)->seq = 0; init_waitqueue_head(&(cv)->waitq); } while (0) -#else -#define CV_INIT(cv,b,c,d) do { (cv)->seq = 0; init_waitqueue(&(cv)->waitq); } while (0) -#endif #define CV_DESTROY(cv) #define CV_WAIT_SIG(cv, m) afs_cv_wait(cv, m, 1) #define CV_WAIT(cv, m) afs_cv_wait(cv, m, 0) #define CV_TIMEDWAIT afs_cv_timedwait #define CV_SIGNAL(cv) do { ++(cv)->seq; wake_up(&(cv)->waitq); } while (0) -#if defined(AFS_LINUX24_ENV) #define CV_BROADCAST(cv) do { ++(cv)->seq; wake_up_all(&(cv)->waitq); } while (0) -#else -#define CV_BROADCAST(cv) do { ++(cv)->seq; wake_up(&(cv)->waitq); } while (0) -#endif #endif /* RX_KMUTEX_H_ */ diff --git a/src/rx/LINUX/rx_knet.c b/src/rx/LINUX/rx_knet.c index 40df9a8e02..d670a833fb 100644 --- a/src/rx/LINUX/rx_knet.c +++ b/src/rx/LINUX/rx_knet.c @@ -17,11 +17,8 @@ #include -#ifdef AFS_LINUX22_ENV #include "rx/rx_kcommon.h" -#if defined(AFS_LINUX24_ENV) #include "h/smp_lock.h" -#endif #include #ifdef ADAPT_PMTU #include @@ -64,11 +61,7 @@ rxk_NewSocketHost(afs_uint32 ahost, short aport) sockp->ops->bind(sockp, (struct sockaddr *)&myaddr, sizeof(myaddr)); if (code < 0) { -#if defined(AFS_LINUX24_ENV) printk("sock_release(rx_socket) FIXME\n"); -#else - sock_release(sockp); -#endif return NULL; } @@ -266,41 +259,35 @@ osi_NetReceive(osi_socket so, struct sockaddr_in *from, struct iovec *iov, TO_KERNEL_SPACE(); if (code < 0) { -#ifdef AFS_LINUX26_ENV #ifdef CONFIG_PM if ( -#ifdef PF_FREEZE +# ifdef PF_FREEZE current->flags & PF_FREEZE -#else -#if defined(STRUCT_TASK_STRUCT_HAS_TODO) +# else +# if defined(STRUCT_TASK_STRUCT_HAS_TODO) !current->todo -#else -#if defined(STRUCT_TASK_STRUCT_HAS_THREAD_INFO) +# else +# if defined(STRUCT_TASK_STRUCT_HAS_THREAD_INFO) test_ti_thread_flag(current->thread_info, TIF_FREEZE) -#else +# else test_ti_thread_flag(task_thread_info(current), TIF_FREEZE) -#endif -#endif -#endif +# endif +# endif +# endif ) -#ifdef LINUX_REFRIGERATOR_TAKES_PF_FREEZE +# ifdef LINUX_REFRIGERATOR_TAKES_PF_FREEZE refrigerator(PF_FREEZE); -#else +# else refrigerator(); -#endif +# endif set_current_state(TASK_INTERRUPTIBLE); -#endif #endif /* Clear the error before using the socket again. * Oh joy, Linux has hidden header files as well. It appears we can * simply call again and have it clear itself via sock_error(). */ -#ifdef AFS_LINUX22_ENV flush_signals(current); /* We don't want no stinkin' signals. */ -#else - current->signal = 0; /* We don't want no stinkin' signals. */ -#endif rxk_lastSocketError = code; rxk_nSocketErrors++; } else { @@ -310,9 +297,7 @@ osi_NetReceive(osi_socket so, struct sockaddr_in *from, struct iovec *iov, return code; } -#ifdef EXPORTED_TASKLIST_LOCK -extern rwlock_t tasklist_lock __attribute__((weak)); -#endif + void osi_StopListener(void) { @@ -331,4 +316,3 @@ osi_StopListener(void) rx_socket = NULL; } -#endif /* AFS_LINUX22_ENV */