Lines Matching refs:ptr
35 void *ptr; in kmem_alloc() local
47 ptr = kmalloc(size, lflags); in kmem_alloc()
49 ptr = __vmalloc(size, lflags, PAGE_KERNEL); in kmem_alloc()
50 if (ptr || (flags & (KM_MAYFAIL|KM_NOSLEEP))) in kmem_alloc()
51 return ptr; in kmem_alloc()
63 void *ptr; in kmem_zalloc() local
65 ptr = kmem_alloc(size, flags); in kmem_zalloc()
66 if (ptr) in kmem_zalloc()
67 memset((char *)ptr, 0, (int)size); in kmem_zalloc()
68 return ptr; in kmem_zalloc()
75 void *ptr; in kmem_zalloc_greedy() local
79 while (!(ptr = kmem_zalloc(kmsize, kmflags))) { in kmem_zalloc_greedy()
87 if (ptr) in kmem_zalloc_greedy()
89 return ptr; in kmem_zalloc_greedy()
93 kmem_free(const void *ptr) in kmem_free() argument
95 if (!is_vmalloc_addr(ptr)) { in kmem_free()
96 kfree(ptr); in kmem_free()
98 vfree(ptr); in kmem_free()
103 kmem_realloc(const void *ptr, size_t newsize, size_t oldsize, in kmem_realloc() argument
109 if (ptr) { in kmem_realloc()
111 memcpy(new, ptr, in kmem_realloc()
113 kmem_free(ptr); in kmem_realloc()
123 void *ptr; in kmem_zone_alloc() local
126 ptr = kmem_cache_alloc(zone, lflags); in kmem_zone_alloc()
127 if (ptr || (flags & (KM_MAYFAIL|KM_NOSLEEP))) in kmem_zone_alloc()
128 return ptr; in kmem_zone_alloc()
140 void *ptr; in kmem_zone_zalloc() local
142 ptr = kmem_zone_alloc(zone, flags); in kmem_zone_zalloc()
143 if (ptr) in kmem_zone_zalloc()
144 memset((char *)ptr, 0, kmem_cache_size(zone)); in kmem_zone_zalloc()
145 return ptr; in kmem_zone_zalloc()