Kernel is always defined
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Tue, 17 Nov 2009 20:46:17 +0000 (20:46 +0000)
committerDerrick Brashear <shadow|account-1000005@unknown>
Thu, 14 Jan 2010 15:50:11 +0000 (07:50 -0800)
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 <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/afs/AIX/osi_machdep.h
src/afs/DARWIN/osi_machdep.h
src/afs/FBSD/osi_machdep.h
src/afs/HPUX/osi_machdep.h
src/afs/NBSD/osi_machdep.h
src/afs/OBSD/osi_machdep.h
src/afs/SOLARIS/osi_machdep.h
src/afs/afs.h
src/afs/afs_icl.c

index 1cd8b90..eb52b26 100644 (file)
@@ -53,7 +53,6 @@ typedef struct proc afs_proc_t;
 #include <ulimit.h>
 #define get_ulimit()           (ulimit(GET_FSIZE, 0) << UBSHIFT)
 
-#ifdef KERNEL
 #include <sys/lockl.h>
 #include <sys/lock_def.h>
 #include <sys/lock_alloc.h>
@@ -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_ */
index a0ad9c2..7146125 100644 (file)
@@ -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_ */
index dff2e40..b151690 100644 (file)
@@ -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)
 
index 057b309..bbee67f 100644 (file)
@@ -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)
 /* 
index db7440a..6a2b4e7 100644 (file)
@@ -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_ */
index 33a8af6..ebca62d 100644 (file)
@@ -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 { \
index 0faf363..2400cc0 100644 (file)
@@ -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_ */
index 0c8bd58..04e62f0 100644 (file)
@@ -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 */
 
index 3358bac..5a38b55 100644 (file)
@@ -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;