]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
OpenBSD: Fix use of macros for AFS_KALLOC/AFS_KFREE
authorAntoine Verheijen <antoine@ualberta.ca>
Wed, 19 Jan 2011 18:52:10 +0000 (11:52 -0700)
committerDerrick Brashear <shadow@dementia.org>
Sat, 22 Jan 2011 20:59:42 +0000 (12:59 -0800)
The macro definitions for AFS_KALLOC and AFS_KFREE used by
afs_osi_alloc.c to perform OS-specific memory allocation
are only defined by the OpenBSD osi_machdep.h header file
if they already exist, which means: never. This patch fixes
this situtation and makes sure that afs_osi_alloc.c
actually uses them, eliminating a direct OS-specific call
in afs_osi_alloc.c.

Reviewed-on: http://gerrit.openafs.org/3682
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit d5367b5f1494ca2cf09f62d7f2ffa6304e38a648)

Change-Id: I362f1b6ab808ff171cebc429eb74703c7151d026
Reviewed-on: http://gerrit.openafs.org/3718
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/afs/OBSD/osi_machdep.h
src/afs/afs_osi_alloc.c

index 61ed43e7dcdae6192a4c2c5a93763346778bc2a1..c0599f272335087c9c7b18624cfbd857db4dd02a 100644 (file)
@@ -66,13 +66,13 @@ extern void osi_obsd_Free(void *p, size_t asize);
 
 #ifdef AFS_KALLOC
 #undef AFS_KALLOC
-#define AFS_KALLOC(s) osi_obsd_Alloc((s), 1 /* cansleep */)
 #endif
+#define AFS_KALLOC(s) osi_obsd_Alloc((s), 1 /* cansleep */)
 
 #ifdef AFS_KFREE
 #undef AFS_KFREE
-#define AFS_KFREE(p, s) (osi_obsd_Free((p), (s)))
 #endif
+#define AFS_KFREE(p, s) (osi_obsd_Free((p), (s)))
 
 #ifdef AFS_OBSD42_ENV
 /* removed, live with it */
index 676d523ebe011909590862bb9fde72dd7f8ca0bf..303999551f9d13204dc006ff4269a516459a2349 100644 (file)
@@ -109,8 +109,6 @@ afs_osi_Free(void *x, size_t asize)
     osi_linux_free(x);
 #elif defined(AFS_FBSD_ENV)
     osi_fbsd_free(x);
-#elif defined(AFS_OBSD_ENV)
-    osi_obsd_Free(x, asize);
 #else
     AFS_KFREE((struct osimem *)x, asize);
 #endif