From 64778fd7bece52360482f9a51f19b34dac1d2678 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Tue, 17 Nov 2009 20:46:17 +0000 Subject: [PATCH] Kernel is always defined When we build the kernel module, either in the real or the ukernel case, KERNEL is defined. So, remove the #ifdefs around our locking primitives, so that things are a little bit clearer. Change-Id: I60893cc630d8cd4dd6cb11cdc44e8bf4f2f9f863 Reviewed-on: http://gerrit.openafs.org/838 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/afs/AIX/osi_machdep.h | 2 -- src/afs/DARWIN/osi_machdep.h | 3 --- src/afs/FBSD/osi_machdep.h | 3 --- src/afs/HPUX/osi_machdep.h | 2 -- src/afs/NBSD/osi_machdep.h | 3 --- src/afs/OBSD/osi_machdep.h | 3 --- src/afs/SOLARIS/osi_machdep.h | 2 -- src/afs/afs.h | 2 -- src/afs/afs_icl.c | 2 +- 9 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/afs/AIX/osi_machdep.h b/src/afs/AIX/osi_machdep.h index 1cd8b908ab..eb52b2677c 100644 --- a/src/afs/AIX/osi_machdep.h +++ b/src/afs/AIX/osi_machdep.h @@ -53,7 +53,6 @@ typedef struct proc afs_proc_t; #include #define get_ulimit() (ulimit(GET_FSIZE, 0) << UBSHIFT) -#ifdef KERNEL #include #include #include @@ -86,6 +85,5 @@ extern simple_lock_data afs_global_lock; #endif #define ifnet_flags(x) (x?(x)->if_flags:0) -#endif #endif /* _OSI_MACHDEP_H_ */ diff --git a/src/afs/DARWIN/osi_machdep.h b/src/afs/DARWIN/osi_machdep.h index a0ad9c2180..7146125d42 100644 --- a/src/afs/DARWIN/osi_machdep.h +++ b/src/afs/DARWIN/osi_machdep.h @@ -155,7 +155,6 @@ void darwin_vn_rele(struct vnode *vp); #undef afs_suser -#ifdef KERNEL extern thread_t afs_global_owner; /* simple locks cannot be used since sleep can happen at any time */ #ifdef AFS_DARWIN80_ENV @@ -265,6 +264,4 @@ extern int (**afs_vnodeop_p) (); # define SetAfsVnode(v) /* nothing; done in getnewvnode() */ #endif -#endif /* KERNEL */ - #endif /* _OSI_MACHDEP_H_ */ diff --git a/src/afs/FBSD/osi_machdep.h b/src/afs/FBSD/osi_machdep.h index dff2e40c72..b151690e31 100644 --- a/src/afs/FBSD/osi_machdep.h +++ b/src/afs/FBSD/osi_machdep.h @@ -76,8 +76,6 @@ extern int (**afs_vnodeop_p) (); #define afs_strcat(s1, s2) strcat((s1), (s2)) -#ifdef KERNEL - #undef afs_osi_Alloc_NoSleep #define afs_osi_Alloc_NoSleep(size) osi_fbsd_alloc((size), 0) @@ -167,7 +165,6 @@ extern struct proc *afs_global_owner; #define NETPRI splvar=splnet() #undef USERPRI #define USERPRI splx(splvar) -#endif /* KERNEL */ #define ifnet_flags(x) (x?(x)->if_flags:0) diff --git a/src/afs/HPUX/osi_machdep.h b/src/afs/HPUX/osi_machdep.h index 057b309329..bbee67fc2a 100644 --- a/src/afs/HPUX/osi_machdep.h +++ b/src/afs/HPUX/osi_machdep.h @@ -44,7 +44,6 @@ typedef proc_t afs_proc_t; #define getppid() (afs_uint32)p_ppid(u.u_procp) -#ifdef KERNEL /* * Global lock support. * @@ -84,7 +83,6 @@ extern void afsHashRelease(tid_t key); #define SPLVAR register ulong_t splvar #define NETPRI NET_SPLNET(splvar) #define USERPRI NET_SPLX(splvar) -#endif /* KERNEL */ #if !defined(AFS_HPUX110_ENV) /* diff --git a/src/afs/NBSD/osi_machdep.h b/src/afs/NBSD/osi_machdep.h index db7440ad9e..6a2b4e776a 100644 --- a/src/afs/NBSD/osi_machdep.h +++ b/src/afs/NBSD/osi_machdep.h @@ -51,7 +51,6 @@ typedef struct proc afs_proc_t; #undef afs_suser -#ifdef KERNEL extern struct simplelock afs_global_lock; #if 0 extern thread_t afs_global_owner; @@ -100,6 +99,4 @@ extern int (**afs_vnodeop_p) (); #define IsAfsVnode(v) ((v)->v_op == afs_vnodeop_p) #define SetAfsVnode(v) /* nothing; done in getnewvnode() */ -#endif /* KERNEL */ - #endif /* _OSI_MACHDEP_H_ */ diff --git a/src/afs/OBSD/osi_machdep.h b/src/afs/OBSD/osi_machdep.h index 33a8af6588..ebca62df7f 100644 --- a/src/afs/OBSD/osi_machdep.h +++ b/src/afs/OBSD/osi_machdep.h @@ -143,8 +143,6 @@ extern int afs_vget(); #define afs_osi_lockmgr(l, f, i, p) lockmgr((l), (f), (i), (p)) #endif -#ifdef KERNEL - #ifdef AFS_OBSD44_ENV /* Revert to classical, BSD locks */ @@ -224,7 +222,6 @@ extern struct lock afs_global_lock; #define NETPRI splvar=splnet() #undef USERPRI #define USERPRI splx(splvar) -#endif /* KERNEL */ #define osi_InitGlock() \ do { \ diff --git a/src/afs/SOLARIS/osi_machdep.h b/src/afs/SOLARIS/osi_machdep.h index 0faf3631dc..2400cc0a3d 100644 --- a/src/afs/SOLARIS/osi_machdep.h +++ b/src/afs/SOLARIS/osi_machdep.h @@ -71,7 +71,6 @@ extern void *afs_osi_Alloc_NoSleep(size_t size); #define afs_suser(x) suser(x) #endif -#ifdef KERNEL /* * Global lock support. */ @@ -128,5 +127,4 @@ struct afs_ifinfo { int metric; ipaddr_t dstaddr; }; -#endif #endif /* _OSI_MACHDEP_H_ */ diff --git a/src/afs/afs.h b/src/afs/afs.h index 0c8bd585a3..04e62f0c8a 100644 --- a/src/afs/afs.h +++ b/src/afs/afs.h @@ -1069,7 +1069,6 @@ typedef union { afs_mem_dcache_id_t mem; } afs_dcache_id_t; -#ifdef KERNEL /* it does not compile outside kernel */ struct buffer { afs_int32 fid; /* is adc->index, the cache file number */ @@ -1095,7 +1094,6 @@ struct fcache { afs_int32 chunkBytes; /* Num bytes in this chunk */ char states; /* Has this chunk been modified? */ }; -#endif /* magic numbers to specify the cache type */ diff --git a/src/afs/afs_icl.c b/src/afs/afs_icl.c index 3358bacb2e..5a38b550b9 100644 --- a/src/afs/afs_icl.c +++ b/src/afs/afs_icl.c @@ -34,7 +34,7 @@ struct afs_icl_set *afs_iclLongTermSetp = (struct afs_icl_set *)0; #if defined(AFS_SGI61_ENV) /* For SGI 6.2, this can is changed to 1 if it's a 32 bit kernel. */ -#if defined(AFS_SGI62_ENV) && defined(KERNEL) && !defined(_K64U64) +#if defined(AFS_SGI62_ENV) && !defined(_K64U64) int afs_icl_sizeofLong = 1; #else int afs_icl_sizeofLong = 2;