ext4l: Extract alloc declarations into their own file

Create include/linux/slab.h and include/linux/vmalloc.h with memory
allocation functions:

slab.h:
- GFP flags (GFP_KERNEL, GFP_ATOMIC, etc.)
- kmalloc(), kzalloc(), kcalloc(), kmalloc_array()
- kfree(), krealloc(), kmemdup()
- kmem_cache_* functions

vmalloc.h:
- vmalloc(), vzalloc(), vfree()
- __vmalloc()

Update compat.h to include these headers and remove duplicate
definitions.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
This commit is contained in:
Simon Glass
2025-12-16 13:37:22 -07:00
committed by Simon Glass
parent f592f31464
commit 43f6682069
5 changed files with 124 additions and 59 deletions

View File

@@ -10,7 +10,7 @@ struct p_current cur = {
};
__maybe_unused struct p_current *current = &cur;
void *kmalloc(size_t size, int flags)
void *kmalloc(size_t size, gfp_t flags)
{
void *p;
@@ -31,7 +31,7 @@ struct kmem_cache *get_mem(int element_sz)
return ret;
}
void *kmem_cache_alloc(struct kmem_cache *obj, int flag)
void *kmem_cache_alloc(struct kmem_cache *obj, gfp_t flag)
{
return malloc_cache_aligned(obj->sz);
}