lkml.org 
[lkml]   [2010]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 42/49] include/linux/coda_linux.h: Use vzalloc
Date
Signed-off-by: Joe Perches <joe@perches.com>
---
include/linux/coda_linux.h | 26 ++++++++++++++++----------
1 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h
index 2e914d0..57460f3 100644
--- a/include/linux/coda_linux.h
+++ b/include/linux/coda_linux.h
@@ -55,19 +55,25 @@ unsigned short coda_flags_to_cflags(unsigned short);
void coda_sysctl_init(void);
void coda_sysctl_clean(void);

-#define CODA_ALLOC(ptr, cast, size) do { \
- if (size < PAGE_SIZE) \
- ptr = kmalloc((unsigned long) size, GFP_KERNEL); \
- else \
- ptr = (cast)vmalloc((unsigned long) size); \
- if (!ptr) \
- printk("kernel malloc returns 0 at %s:%d\n", __FILE__, __LINE__); \
- else memset( ptr, 0, size ); \
+#define CODA_ALLOC(ptr, cast, size) \
+do { \
+ if (size < PAGE_SIZE) \
+ ptr = kzalloc((unsigned long) size, GFP_KERNEL); \
+ else \
+ ptr = vzalloc((unsigned long) size); \
+ if (!ptr) \
+ printk(KERN_ERR "kernel malloc returns 0 at %s:%d\n", \
+ __FILE__, __LINE__); \
} while (0)


-#define CODA_FREE(ptr,size) \
- do { if (size < PAGE_SIZE) kfree((ptr)); else vfree((ptr)); } while (0)
+#define CODA_FREE(ptr, size) \
+do { \
+ if (size < PAGE_SIZE) \
+ kfree((ptr)); \
+ else \
+ vfree((ptr)); \
+} while (0)

/* inode to cnode access functions */

--
1.7.3.1.g432b3.dirty


\
 
 \ /
  Last update: 2010-11-05 04:15    [W:0.038 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site