4 * Copyright (C) 2001 Cluster File Systems, Inc.
6 * This code is issued under the GNU General Public License.
7 * See the file COPYING in this distribution
10 #include <linux/autoconf.h>
11 #include <linux/slab.h>
12 #include <linux/kp30.h>
14 /* global variables */
15 extern int obd_debug_level;
16 extern unsigned long obd_memory;
18 #define OBD_ALLOC(ptr, size) \
21 (ptr) = kmalloc(s, GFP_KERNEL); \
22 if ((ptr) == NULL) { \
23 CERROR("kernel malloc of %ld bytes failed at " \
24 "%s:%d\n", s, __FILE__, __LINE__); \
26 memset((ptr), 0, s); \
29 CDEBUG(D_MALLOC, "kmalloced: %ld at %x (tot %ld).\n", \
30 s, (int)(ptr), obd_memory); \
33 #define OBD_FREE(ptr, size) \
37 CDEBUG(D_MALLOC, "kfreed: %d at %x (tot %ld).\n", \
38 s, (int)(ptr), obd_memory); \