From: Simon Wilkinson Date: Fri, 1 Oct 2010 08:36:06 +0000 (+0100) Subject: rx: Reorganise includes X-Git-Tag: openafs-devel-1_7_1~1293 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=f78b29b900028d67c51de7ae6c9e46b94602196c rx: Reorganise includes RX files were including the same header set in three different places, once for user-land builds, once for kernel builds and once for ukernel. The duplication was a bit pointless, and really frustrating when adding new headers. So, reorganise the includes so that we only list headers that are used in all three builds in one location. Also take the opportunity to indent the #ifdefs so that it is clear what is going on, and to remove some more of AFS_OSF_ENV and AFS_AUX_ENV from kernel builds. Change-Id: Ic2b5d39de4dd406bbc0acaa29fc876ac882ccf10 Reviewed-on: http://gerrit.openafs.org/3160 Reviewed-by: Derrick Brashear Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/rx/rx.c b/src/rx/rx.c index 5a189a2..f8a5496 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -10,77 +10,53 @@ /* RX: Extended Remote Procedure Call */ #include -#ifdef KERNEL #include "afs/param.h" -#else -#include -#endif - #ifdef KERNEL -#include "afs/sysincludes.h" -#include "afsincludes.h" -#ifndef UKERNEL -#include "h/types.h" -#include "h/time.h" -#include "h/stat.h" -#ifdef AFS_OSF_ENV -#include -#endif /* AFS_OSF_ENV */ -#ifdef AFS_LINUX20_ENV -#include "h/socket.h" -#endif -#include "netinet/in.h" -#ifdef AFS_SUN57_ENV -#include "inet/common.h" -#include "inet/ip.h" -#include "inet/ip_ire.h" -#endif -#include "afs/afs_args.h" -#include "afs/afs_osi.h" -#ifdef RX_KERNEL_TRACE -#include "rx_kcommon.h" -#endif -#if (defined(AFS_AUX_ENV) || defined(AFS_AIX_ENV)) -#include "h/systm.h" -#endif -#ifdef RXDEBUG -#undef RXDEBUG /* turn off debugging */ -#endif /* RXDEBUG */ -#if defined(AFS_SGI_ENV) -#include "sys/debug.h" -#endif -#include "afsint.h" -#ifdef AFS_OSF_ENV -#undef kmem_alloc -#undef kmem_free -#undef mem_alloc -#undef mem_free -#endif /* AFS_OSF_ENV */ -#else /* !UKERNEL */ -#include "afs/sysincludes.h" -#include "afsincludes.h" -#endif /* !UKERNEL */ -#include "afs/lock.h" -#include "rx_kmutex.h" -#include "rx_kernel.h" -#include "rx_clock.h" -#include "rx_queue.h" -#include "rx.h" -#include "rx_globals.h" -#include "rx_trace.h" -#include "rx_atomic.h" -#include "rx_internal.h" -#include "rx_stats.h" -#define AFSOP_STOP_RXCALLBACK 210 /* Stop CALLBACK process */ -#define AFSOP_STOP_AFS 211 /* Stop AFS process */ -#define AFSOP_STOP_BKG 212 /* Stop BKG process */ -#include "afsint.h" +# include "afs/sysincludes.h" +# include "afsincludes.h" +# ifndef UKERNEL +# include "h/types.h" +# include "h/time.h" +# include "h/stat.h" +# ifdef AFS_LINUX20_ENV +# include "h/socket.h" +# endif +# include "netinet/in.h" +# ifdef AFS_SUN57_ENV +# include "inet/common.h" +# include "inet/ip.h" +# include "inet/ip_ire.h" +# endif +# include "afs/afs_args.h" +# include "afs/afs_osi.h" +# ifdef RX_KERNEL_TRACE +# include "rx_kcommon.h" +# endif +# if defined(AFS_AIX_ENV) +# include "h/systm.h" +# endif +# ifdef RXDEBUG +# undef RXDEBUG /* turn off debugging */ +# endif /* RXDEBUG */ +# if defined(AFS_SGI_ENV) +# include "sys/debug.h" +# endif +# else /* !UKERNEL */ +# include "afs/sysincludes.h" +# include "afsincludes.h" +# endif /* !UKERNEL */ +# include "afs/lock.h" +# include "rx_kmutex.h" +# include "rx_kernel.h" +# define AFSOP_STOP_RXCALLBACK 210 /* Stop CALLBACK process */ +# define AFSOP_STOP_AFS 211 /* Stop AFS process */ +# define AFSOP_STOP_BKG 212 /* Stop BKG process */ extern afs_int32 afs_termState; -#ifdef AFS_AIX41_ENV -#include "sys/lockl.h" -#include "sys/lock_def.h" -#endif /* AFS_AIX41_ENV */ +# ifdef AFS_AIX41_ENV +# include "sys/lockl.h" +# include "sys/lock_def.h" +# endif /* AFS_AIX41_ENV */ # include "afs/rxgen_consts.h" #else /* KERNEL */ # include @@ -90,31 +66,33 @@ extern afs_int32 afs_termState; # ifdef HAVE_STDINT_H # include # endif -#ifdef AFS_NT40_ENV -# include -# include -# include -# include -#else -# include -# include -# include -# include -# include -# include -#endif -# include "rx.h" +# ifdef AFS_NT40_ENV +# include +# include +# include +# include +# else +# include +# include +# include +# include +# include +# include +# endif # include "rx_user.h" -# include "rx_clock.h" -# include "rx_queue.h" -# include "rx_atomic.h" -# include "rx_globals.h" -# include "rx_trace.h" -# include "rx_internal.h" -# include "rx_stats.h" -# include #endif /* KERNEL */ +#include "rx.h" +#include "rx_clock.h" +#include "rx_queue.h" +#include "rx_atomic.h" +#include "rx_globals.h" +#include "rx_trace.h" +#include "rx_internal.h" +#include "rx_stats.h" + +#include + #ifndef KERNEL #ifdef AFS_PTHREAD_ENV #ifndef AFS_NT40_ENV diff --git a/src/rx/rx.h b/src/rx/rx.h index 2c05d30..deb50fb 100644 --- a/src/rx/rx.h +++ b/src/rx/rx.h @@ -26,12 +26,6 @@ #ifdef KERNEL #include "rx_kmutex.h" #include "rx_kernel.h" -#include "rx_clock.h" -#include "rx_event.h" -#include "rx_queue.h" -#include "rx_packet.h" -#include "rx_misc.h" -#include "rx_multi.h" #if defined (AFS_OBSD_ENV) && !defined (MLEN) #include "sys/mbuf.h" #endif @@ -52,18 +46,18 @@ #include #endif # include "rx_user.h" -# include "rx_clock.h" -# include "rx_event.h" -# include "rx_packet.h" -# include "rx_misc.h" -# include "rx_null.h" -# include "rx_multi.h" #ifndef AFS_NT40_ENV # include # include #endif #endif /* KERNEL */ +#include "rx_clock.h" +#include "rx_event.h" +#include "rx_packet.h" +#include "rx_misc.h" +#include "rx_null.h" +#include "rx_multi.h" /* Configurable parameters */ #define RX_IDLE_DEAD_TIME 60 /* default idle dead time */ diff --git a/src/rx/rx_clock.c b/src/rx/rx_clock.c index d2ce7e9..38e726b 100644 --- a/src/rx/rx_clock.c +++ b/src/rx/rx_clock.c @@ -11,39 +11,32 @@ /* See rx_clock.h for calling conventions */ #include -#ifdef KERNEL #include "afs/param.h" -#else -#include -#endif #ifdef AFS_SUN59_ENV #include #endif - #ifdef KERNEL -#ifndef UKERNEL -#include "rx/rx_clock.h" -#include "h/types.h" -#include "h/time.h" -#else /* !UKERNEL */ -#include "afs/sysincludes.h" -#include "afsincludes.h" -#include "rx/rx.h" -#include "rx/rx_clock.h" -#endif /* !UKERNEL */ +# ifndef UKERNEL +# include "h/types.h" +# include "h/time.h" +# else /* !UKERNEL */ +# include "afs/sysincludes.h" +# include "afsincludes.h" +# endif /* !UKERNEL */ #else /* KERNEL */ -#include -#ifdef HAVE_SIGNAL_H -#include +# include +# ifdef HAVE_SIGNAL_H +# include +# endif +# include +# include +# include #endif -#include -#include -#include + #include "rx.h" #include "rx_clock.h" -#endif #if !defined(AFS_USE_GETTIMEOFDAY) /*use this package only if gettimeofday is much much costlier than getitime */ diff --git a/src/rx/rx_event.c b/src/rx/rx_event.c index 04f5a18..0d92584 100644 --- a/src/rx/rx_event.c +++ b/src/rx/rx_event.c @@ -8,65 +8,51 @@ */ #include -#ifdef KERNEL #include "afs/param.h" -#else -#include -#endif #ifdef AFS_SUN59_ENV -#include +# include #endif - #ifdef KERNEL -#ifndef UKERNEL -#include "afs/afs_osi.h" -#else /* !UKERNEL */ -#include "afs/sysincludes.h" -#include "afsincludes.h" -#endif /* !UKERNEL */ -#include "rx/rx_clock.h" -#include "rx/rx_queue.h" -#include "rx/rx_event.h" -#include "rx/rx_kernel.h" -#include "rx_kmutex.h" -#ifdef RX_ENABLE_LOCKS -#include "rx/rx.h" -#endif /* RX_ENABLE_LOCKS */ -#include "rx/rx_globals.h" -#if defined(AFS_SGI_ENV) -#include "sys/debug.h" +# ifndef UKERNEL +# include "afs/afs_osi.h" +# else /* !UKERNEL */ +# include "afs/sysincludes.h" +# include "afsincludes.h" +# endif /* !UKERNEL */ +# include "rx_kernel.h" +# include "rx_kmutex.h" +# if defined(AFS_SGI_ENV) +# include "sys/debug.h" /* These are necessary to get curproc (used by GLOCK asserts) to work. */ -#include "h/proc.h" -#if !defined(AFS_SGI64_ENV) && !defined(UKERNEL) -#include "h/user.h" -#endif +# include "h/proc.h" +# if !defined(AFS_SGI64_ENV) && !defined(UKERNEL) +# include "h/user.h" +# endif extern void *osi_Alloc(); -#endif -#if defined(AFS_OBSD_ENV) -#include "h/proc.h" -#endif +# endif +# if defined(AFS_OBSD_ENV) +# include "h/proc.h" +# endif #else /* KERNEL */ -#include +# include +# include "rx_user.h" +# ifdef AFS_PTHREAD_ENV +# include "rx_pthread.h" +# else +# include "rx_lwp.h" +# endif +# ifdef AFS_NT40_ENV +# include +# endif +#endif /* KERNEL */ + +#include "rx.h" #include "rx_clock.h" #include "rx_queue.h" #include "rx_event.h" -#include "rx_user.h" -#ifdef AFS_PTHREAD_ENV -#include -#else -#include "rx_lwp.h" -#endif -#ifdef RX_ENABLE_LOCKS -#include "rx.h" -#endif /* RX_ENABLE_LOCKS */ #include "rx_globals.h" -#ifdef AFS_NT40_ENV -#include -#endif -#endif /* KERNEL */ - /* All event processing is relative to the apparent current time given by clock_GetTime */ diff --git a/src/rx/rx_getaddr.c b/src/rx/rx_getaddr.c index 0859316..55f3e35 100644 --- a/src/rx/rx_getaddr.c +++ b/src/rx/rx_getaddr.c @@ -12,42 +12,42 @@ #ifndef KERNEL -#ifndef AFS_NT40_ENV -#include -#include -#include -#include -#include -#include -#include -#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) -#include -#ifndef AFS_ARM_DARWIN_ENV -#include -#endif -#include -#endif +# ifndef AFS_NT40_ENV +# include +# include +# include +# include +# include +# include +# include +# if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +# include +# ifndef AFS_ARM_DARWIN_ENV +# include +# endif +# include +# endif /* * By including this, we get any system dependencies. In particular, * the pthreads for solaris requires the socket call to be mapped. */ -#include "rx.h" -#include "rx_globals.h" -#endif /* AFS_NT40_ENV */ +# include "rx.h" +# include "rx_globals.h" +# endif /* AFS_NT40_ENV */ #else /* KERNEL */ -#ifdef UKERNEL -#include "rx/rx_kcommon.h" -#else /* UKERNEL */ -#include "rx/rx.h" -#endif /* UKERNEL */ +# ifdef UKERNEL +# include "rx/rx_kcommon.h" +# else /* UKERNEL */ +# include "rx/rx.h" +# endif /* UKERNEL */ #endif /* KERNEL */ #define NIFS 512 #if defined(AFS_USR_DFBSD_ENV) -#include -#include +# include +# include #endif #ifdef KERNEL diff --git a/src/rx/rx_globals.c b/src/rx/rx_globals.c index 11128f5..763baa3 100644 --- a/src/rx/rx_globals.c +++ b/src/rx/rx_globals.c @@ -19,11 +19,7 @@ #endif #include -#ifdef KERNEL #include "afs/param.h" -#else -#include -#endif /* Enable data initialization when the header file is included */ diff --git a/src/rx/rx_lwp.c b/src/rx/rx_lwp.c index 8675992..acca31b 100644 --- a/src/rx/rx_lwp.c +++ b/src/rx/rx_lwp.c @@ -22,9 +22,9 @@ #include -# include /* fd_set on older platforms */ -# include -# include +#include /* fd_set on older platforms */ +#include +#include #ifdef AFS_NT40_ENV # include #else @@ -42,11 +42,12 @@ # include # include #endif -# include "rx.h" -# include "rx_atomic.h" -# include "rx_globals.h" -# include "rx_stats.h" -# include + +#include "rx.h" +#include "rx_atomic.h" +#include "rx_globals.h" +#include "rx_stats.h" +#include #define MAXTHREADNAMELENGTH 64 diff --git a/src/rx/rx_misc.c b/src/rx/rx_misc.c index bdbeab2..d22e3d7 100644 --- a/src/rx/rx_misc.c +++ b/src/rx/rx_misc.c @@ -12,31 +12,31 @@ #ifdef KERNEL -#include -#include +# include +# include #else -#ifdef AFS_NT40_ENV -#include -#include -#else -#include -#endif -#include -#include -#include "xdr.h" -#ifdef AFS_PTHREAD_ENV -#include "rx.h" -#endif /* AFS_PTHREAD_ENV */ -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef AFS_NT40_ENV -#ifndef EDQUOT -#define EDQUOT WSAEDQUOT -#endif /* EDQUOT */ -#endif /* AFS_NT40_ENV */ +# ifdef AFS_NT40_ENV +# include +# include +# else +# include +# endif +# include +# include +# include "xdr.h" +# ifdef AFS_PTHREAD_ENV +# include "rx.h" +# endif /* AFS_PTHREAD_ENV */ +# include +# include +# ifdef HAVE_UNISTD_H +# include +# endif +# ifdef AFS_NT40_ENV +# ifndef EDQUOT +# define EDQUOT WSAEDQUOT +# endif /* EDQUOT */ +# endif /* AFS_NT40_ENV */ #endif /* diff --git a/src/rx/rx_multi.c b/src/rx/rx_multi.c index 56b8a89..704024a 100644 --- a/src/rx/rx_multi.c +++ b/src/rx/rx_multi.c @@ -13,10 +13,9 @@ #ifdef KERNEL #include "afs/sysincludes.h" -#include "rx/rx.h" -#else /* KERNEL */ -# include "rx.h" -#endif /* KERNEL */ +#endif + +#include "rx.h" /* * multi.c and multi.h, together with some rxgen hooks, provide a way of diff --git a/src/rx/rx_null.c b/src/rx/rx_null.c index 8334057..cc98bf4 100644 --- a/src/rx/rx_null.c +++ b/src/rx/rx_null.c @@ -8,24 +8,18 @@ */ #include -#ifdef KERNEL #include "afs/param.h" -#else -#include -#endif - #ifdef KERNEL -#ifndef UKERNEL -#include "h/types.h" -#else /* !UKERNEL */ -#include "afs/sysincludes.h" -#endif /* !UKERNEL */ -#include "rx/rx.h" -#else /* KERNEL */ -#include "rx.h" +# ifndef UKERNEL +# include "h/types.h" +# else /* !UKERNEL */ +# include "afs/sysincludes.h" +# endif /* !UKERNEL */ #endif /* KERNEL */ +#include "rx.h" + /* The null security object. No authentication, no nothing. */ static struct rx_securityOps null_ops; diff --git a/src/rx/rx_packet.c b/src/rx/rx_packet.c index 69471d9..69ccd66 100644 --- a/src/rx/rx_packet.c +++ b/src/rx/rx_packet.c @@ -8,91 +8,74 @@ */ #include -#ifdef KERNEL -#include "afs/param.h" -#else #include -#endif #ifdef KERNEL -#if defined(UKERNEL) -#include "afs/sysincludes.h" -#include "afsincludes.h" -#include "rx/rx_kcommon.h" -#include "rx/rx_clock.h" -#include "rx/rx_queue.h" -#include "rx/rx_packet.h" -#include "rx/rx_atomic.h" -#include "rx/rx_internal.h" -#include "rx/rx_stats.h" -#else /* defined(UKERNEL) */ -#ifdef RX_KERNEL_TRACE -#include "../rx/rx_kcommon.h" -#endif -#include "h/types.h" -#ifndef AFS_LINUX20_ENV -#include "h/systm.h" -#endif -#if defined(AFS_SGI_ENV) || defined(AFS_HPUX110_ENV) || defined(AFS_NBSD50_ENV) -#include "afs/sysincludes.h" -#endif -#if defined(AFS_OBSD_ENV) -#include "h/proc.h" -#endif -#include "h/socket.h" -#if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_HPUX110_ENV) -#if !defined(AFS_OSF_ENV) && !defined(AFS_AIX41_ENV) -#include "sys/mount.h" /* it gets pulled in by something later anyway */ -#endif -#include "h/mbuf.h" -#endif -#include "netinet/in.h" -#include "afs/afs_osi.h" -#include "rx_kmutex.h" -#include "rx/rx_clock.h" -#include "rx/rx_queue.h" -#include "rx_atomic.h" -#ifdef AFS_SUN5_ENV -#include -#endif -#include "rx/rx_packet.h" -#include "rx_internal.h" -#include "rx_stats.h" -#endif /* defined(UKERNEL) */ -#include "rx/rx_globals.h" +# if defined(UKERNEL) +# include "afs/sysincludes.h" +# include "afsincludes.h" +# include "rx_kcommon.h" +# else /* defined(UKERNEL) */ +# ifdef RX_KERNEL_TRACE +# include "rx_kcommon.h" +# endif +# include "h/types.h" +# ifndef AFS_LINUX20_ENV +# include "h/systm.h" +# endif +# if defined(AFS_SGI_ENV) || defined(AFS_HPUX110_ENV) || defined(AFS_NBSD50_ENV) +# include "afs/sysincludes.h" +# endif +# if defined(AFS_OBSD_ENV) +# include "h/proc.h" +# endif +# include "h/socket.h" +# if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_HPUX110_ENV) +# if !defined(AFS_OSF_ENV) && !defined(AFS_AIX41_ENV) +# include "sys/mount.h" /* it gets pulled in by something later anyway */ +# endif +# include "h/mbuf.h" +# endif +# include "netinet/in.h" +# include "afs/afs_osi.h" +# include "rx_kmutex.h" +# endif /* defined(UKERNEL) */ #else /* KERNEL */ -#include "sys/types.h" -#include -#include -#if defined(AFS_NT40_ENV) -#include -#ifndef EWOULDBLOCK -#define EWOULDBLOCK WSAEWOULDBLOCK -#endif -#include "rx_user.h" -#include "rx_xmit_nt.h" -#include -#else -#include -#include +# include +# include +# include +# include +# include +# include +# ifdef HAVE_UNISTD_H +# include +# endif +# if defined(AFS_NT40_ENV) +# include +# ifndef EWOULDBLOCK +# define EWOULDBLOCK WSAEWOULDBLOCK +# endif +# include "rx_user.h" +# include "rx_xmit_nt.h" +# else +# include +# include +# endif +# include +#endif /* KERNEL */ + +#ifdef AFS_SUN5_ENV +# include #endif -#include "rx_clock.h" + #include "rx.h" +#include "rx_clock.h" #include "rx_queue.h" -#ifdef AFS_SUN5_ENV -#include -#endif #include "rx_packet.h" #include "rx_atomic.h" #include "rx_globals.h" #include "rx_internal.h" #include "rx_stats.h" -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#endif /* KERNEL */ #ifdef RX_LOCKS_DB /* rxdb_fileID is used to identify the lock location, along with line#. */ diff --git a/src/rx/rx_pthread.c b/src/rx/rx_pthread.c index ae92c67..ef63d89 100644 --- a/src/rx/rx_pthread.c +++ b/src/rx/rx_pthread.c @@ -38,10 +38,11 @@ # include #endif #include -#include -#include -#include -#include + +#include "rx.h" +#include "rx_globals.h" +#include "rx_pthread.h" +#include "rx_clock.h" #include "rx_atomic.h" /* Set rx_pthread_event_rescheduled if event_handler should just try diff --git a/src/rx/rx_rdwr.c b/src/rx/rx_rdwr.c index 90f2015..dcc9fe1 100644 --- a/src/rx/rx_rdwr.c +++ b/src/rx/rx_rdwr.c @@ -8,87 +8,70 @@ */ #include -#ifdef KERNEL -#include "afs/param.h" -#else #include -#endif - #ifdef KERNEL -#ifndef UKERNEL -#ifdef RX_KERNEL_TRACE -#include "rx_kcommon.h" -#endif -#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) -#include "afs/sysincludes.h" -#else -#include "h/types.h" -#include "h/time.h" -#include "h/stat.h" -#if defined(AFS_AIX_ENV) || defined(AFS_AUX_ENV) || defined(AFS_SUN5_ENV) -#include "h/systm.h" -#endif -#ifdef AFS_OSF_ENV -#include -#endif /* AFS_OSF_ENV */ -#ifdef AFS_LINUX20_ENV -#include "h/socket.h" -#endif -#include "netinet/in.h" -#if defined(AFS_SGI_ENV) -#include "afs/sysincludes.h" -#endif -#endif -#include "afs/afs_args.h" -#include "afs/afs_osi.h" -#if (defined(AFS_AUX_ENV) || defined(AFS_AIX_ENV)) -#include "h/systm.h" -#endif -#else /* !UKERNEL */ -#include "afs/sysincludes.h" -#endif /* !UKERNEL */ -#ifdef RXDEBUG -#undef RXDEBUG /* turn off debugging */ -#endif /* RXDEBUG */ - -#include "rx_kmutex.h" -#include "rx/rx_kernel.h" -#include "rx/rx_clock.h" -#include "rx/rx_queue.h" -#include "rx/rx.h" -#include "rx/rx_globals.h" -#include "afs/lock.h" -#include "afsint.h" -#ifdef AFS_OSF_ENV -#undef kmem_alloc -#undef kmem_free -#undef mem_alloc -#undef mem_free -#endif /* AFS_OSF_ENV */ +# ifndef UKERNEL +# ifdef RX_KERNEL_TRACE +# include "rx_kcommon.h" +# endif +# if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +# include "afs/sysincludes.h" +# else +# include "h/types.h" +# include "h/time.h" +# include "h/stat.h" +# if defined(AFS_AIX_ENV) || defined(AFS_AUX_ENV) || defined(AFS_SUN5_ENV) +# include "h/systm.h" +# endif +# ifdef AFS_OSF_ENV +# include +# endif /* AFS_OSF_ENV */ +# ifdef AFS_LINUX20_ENV +# include "h/socket.h" +# endif +# include "netinet/in.h" +# if defined(AFS_SGI_ENV) +# include "afs/sysincludes.h" +# endif +# endif +# include "afs/afs_args.h" +# if (defined(AFS_AUX_ENV) || defined(AFS_AIX_ENV)) +# include "h/systm.h" +# endif +# else /* !UKERNEL */ +# include "afs/sysincludes.h" +# endif /* !UKERNEL */ + +# ifdef RXDEBUG +# undef RXDEBUG /* turn off debugging */ +# endif /* RXDEBUG */ + +# include "afs/afs_osi.h" +# include "rx_kmutex.h" +# include "rx/rx_kernel.h" +# include "afs/lock.h" #else /* KERNEL */ # include -#ifdef AFS_NT40_ENV -# include -#else /* !AFS_NT40_ENV */ -# include -# include -# include -# include -# include -# include -#endif /* !AFS_NT40_ENV */ -#include -#ifdef HAVE_UNISTD_H -#include -#endif -# include "rx_user.h" -# include "rx_clock.h" -# include "rx_queue.h" -# include "rx.h" -# include "rx_globals.h" +# include +# ifdef AFS_NT40_ENV +# include +# else /* !AFS_NT40_ENV */ +# include +# include +# include +# include +# include +# include +# include +# endif /* !AFS_NT40_ENV */ #endif /* KERNEL */ +#include "rx.h" +#include "rx_clock.h" +#include "rx_queue.h" +#include "rx_globals.h" + #ifdef RX_LOCKS_DB /* rxdb_fileID is used to identify the lock location, along with line#. */ static int rxdb_fileID = RXDB_FILE_RX_RDWR; diff --git a/src/rx/rx_trace.c b/src/rx/rx_trace.c index b4fbbd5..85cff81 100644 --- a/src/rx/rx_trace.c +++ b/src/rx/rx_trace.c @@ -29,6 +29,7 @@ main(int argc, char **argv) #include #include #endif + #include "rx.h" #include "rx_atomic.h" #include "rx_globals.h" diff --git a/src/rx/rx_user.c b/src/rx/rx_user.c index 8fbeaf4..3dfe8f0 100644 --- a/src/rx/rx_user.c +++ b/src/rx/rx_user.c @@ -15,10 +15,10 @@ #include -# include -# include -# include -# include +#include +#include +#include +#include #ifdef AFS_NT40_ENV # include #else @@ -32,7 +32,7 @@ # include # include #endif -# include +#include #if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV) # include #endif @@ -57,6 +57,7 @@ #ifndef AFS_NT40_ENV # include #endif + #include "rx.h" #include "rx_atomic.h" #include "rx_globals.h" diff --git a/src/rx/rx_xmit_nt.c b/src/rx/rx_xmit_nt.c index f88bdea..4c8f72d 100644 --- a/src/rx/rx_xmit_nt.c +++ b/src/rx/rx_xmit_nt.c @@ -17,7 +17,6 @@ #include #include - #if defined(AFS_NT40_ENV) #include diff --git a/src/rx/xdr.c b/src/rx/xdr.c index 057f7c2..830c178 100644 --- a/src/rx/xdr.c +++ b/src/rx/xdr.c @@ -28,10 +28,9 @@ */ #include -#ifdef KERNEL -#include "afs/param.h" -#else #include + +#ifndef KERNEL #include #endif diff --git a/src/rx/xdr_rx.c b/src/rx/xdr_rx.c index 353f5a9..54dbf00 100644 --- a/src/rx/xdr_rx.c +++ b/src/rx/xdr_rx.c @@ -12,11 +12,7 @@ */ #include -#ifdef KERNEL -#include "afs/param.h" -#else #include -#endif #ifdef KERNEL @@ -24,42 +20,30 @@ # ifndef UKERNEL # include "h/types.h" # include "h/uio.h" -# ifdef AFS_OSF_ENV -# include -# endif /* AFS_OSF_ENV */ # ifdef AFS_LINUX20_ENV # include "h/socket.h" # else # include "rpc/types.h" # endif -# ifdef AFS_OSF_ENV -# undef kmem_alloc -# undef kmem_free -# undef mem_alloc -# undef mem_free -# endif /* AFS_OSF_ENV */ # ifdef AFS_LINUX22_ENV # ifndef quad_t # define quad_t __quad_t # define u_quad_t __u_quad_t # endif # endif -# include "rx/xdr.h" # include "netinet/in.h" # endif /* !UKERNEL */ -# include "rx/xdr.h" -# include "rx/rx.h" - #else /* KERNEL */ # include # include # ifndef AFS_NT40_ENV # include # endif -# include "rx.h" -# include "xdr.h" #endif /* KERNEL */ +#include "rx.h" +#include "xdr.h" + /* Static prototypes */ #ifdef AFS_XDR_64BITOPS static bool_t xdrrx_getint64(XDR *axdrs, long *lp);