From 2aa16fba58c6d14c1bb3dd5dc2187338d89a2149 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sat, 10 Jul 2010 20:17:56 +0100 Subject: [PATCH] Linux: Use freezer compatibility macros in RX Commit eef18466d920985c37ed8d22a6557b609c6225a6 introduced some compatibility macros for the refridgerator functionality. Use these in the Linux kernel RX code, rather than rolling our own. Change-Id: I4279e0b3ee92337cb992ff46895712630f681b7b Reviewed-on: http://gerrit.openafs.org/2383 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/rx/LINUX/rx_kmutex.c | 29 +++-------------------------- src/rx/LINUX/rx_knet.c | 24 +----------------------- 2 files changed, 4 insertions(+), 49 deletions(-) diff --git a/src/rx/LINUX/rx_kmutex.c b/src/rx/LINUX/rx_kmutex.c index 3ddd1bf..be36c74 100644 --- a/src/rx/LINUX/rx_kmutex.c +++ b/src/rx/LINUX/rx_kmutex.c @@ -21,9 +21,7 @@ #include "rx_kmutex.h" #include "rx/rx_kernel.h" -#ifdef HAVE_LINUX_FREEZER_H -# include -#endif +#include "osi_compat.h" void afs_mutex_init(afs_kmutex_t * l) @@ -115,29 +113,8 @@ afs_cv_wait(afs_kcondvar_t * cv, afs_kmutex_t * l, int sigok) while(seq == cv->seq) { schedule(); -#ifdef CONFIG_PM - if ( -#ifdef PF_FREEZE - current->flags & PF_FREEZE -#else -#if defined(STRUCT_TASK_STRUCT_HAS_TODO) - !current->todo -#else -#if defined(STRUCT_TASK_STRUCT_HAS_THREAD_INFO) - test_ti_thread_flag(current->thread_info, TIF_FREEZE) -#else - test_ti_thread_flag(task_thread_info(current), TIF_FREEZE) -#endif -#endif -#endif - ) -#ifdef LINUX_REFRIGERATOR_TAKES_PF_FREEZE - refrigerator(PF_FREEZE); -#else - refrigerator(); -#endif - set_current_state(TASK_INTERRUPTIBLE); -#endif + afs_try_to_freeze(); + set_current_state(TASK_INTERRUPTIBLE); } remove_wait_queue(&cv->waitq, &wait); diff --git a/src/rx/LINUX/rx_knet.c b/src/rx/LINUX/rx_knet.c index d93d2d5..9165cfd 100644 --- a/src/rx/LINUX/rx_knet.c +++ b/src/rx/LINUX/rx_knet.c @@ -240,29 +240,7 @@ osi_NetReceive(osi_socket so, struct sockaddr_in *from, struct iovec *iov, code = kernel_recvmsg(sop, &msg, (struct kvec *)tmpvec, iovcnt, *lengthp, 0); if (code < 0) { -#ifdef CONFIG_PM - if ( -# ifdef PF_FREEZE - current->flags & PF_FREEZE -# else -# if defined(STRUCT_TASK_STRUCT_HAS_TODO) - !current->todo -# else -# if defined(STRUCT_TASK_STRUCT_HAS_THREAD_INFO) - test_ti_thread_flag(current->thread_info, TIF_FREEZE) -# else - test_ti_thread_flag(task_thread_info(current), TIF_FREEZE) -# endif -# endif -# endif - ) -# ifdef LINUX_REFRIGERATOR_TAKES_PF_FREEZE - refrigerator(PF_FREEZE); -# else - refrigerator(); -# endif - set_current_state(TASK_INTERRUPTIBLE); -#endif + afs_try_to_freeze(); /* Clear the error before using the socket again. * Oh joy, Linux has hidden header files as well. It appears we can -- 1.9.4