@@ -7,6 +7,7 @@
#define SLAB_PANIC 2
#define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */
+#define SLAB_NO_MERGE 0x01000000UL /* Prevent merging with compatible kmem caches */
#define kzalloc_node(size, flags, node) kmalloc(size, flags)
@@ -45,4 +46,7 @@ void kmem_cache_free_bulk(struct kmem_cache *cachep, size_t size, void **list);
int kmem_cache_alloc_bulk(struct kmem_cache *cachep, gfp_t gfp, size_t size,
void **list);
+int kmem_cache_setup_percpu_array(struct kmem_cache *s, unsigned int count);
+int kmem_cache_prefill_percpu_array(struct kmem_cache *s, unsigned int count,
+ gfp_t gfp);
#endif /* _TOOLS_SLAB_H */
@@ -187,6 +187,20 @@ int kmem_cache_alloc_bulk(struct kmem_cache *cachep, gfp_t gfp, size_t size,
return size;
}
+int kmem_cache_setup_percpu_array(struct kmem_cache *s, unsigned int count)
+{
+ return 0;
+}
+
+int kmem_cache_prefill_percpu_array(struct kmem_cache *s, unsigned int count,
+ gfp_t gfp)
+{
+ if (count > s->non_kernel)
+ return s->non_kernel;
+
+ return count;
+}
+
struct kmem_cache *
kmem_cache_create(const char *name, unsigned int size, unsigned int align,
unsigned int flags, void (*ctor)(void *))
@@ -15,6 +15,7 @@
#define printk printf
#define pr_err printk
+#define pr_warn printk
#define pr_info printk
#define pr_debug printk
#define pr_cont printk