MCPcopy Create free account
hub / github.com/bobranten/Ext4Fsd / jbd2_alloc

Function jbd2_alloc

Ext4Fsd/jbd2/journal.c:2374–2390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2372}
2373
2374void *jbd2_alloc(size_t size, gfp_t flags)
2375{
2376 void *ptr;
2377
2378 BUG_ON(size & (size-1)); /* Must be a power of 2 */
2379
2380 if (size < PAGE_SIZE)
2381 ptr = kmem_cache_alloc(get_slab(size), flags);
2382 else
2383 ptr = (void *)__get_free_pages(flags, get_order(size));
2384
2385 /* Check alignment; SLUB has gotten this wrong in the past,
2386 * and this can lead to user data corruption! */
2387 BUG_ON(((unsigned long) ptr) & (size-1));
2388
2389 return ptr;
2390}
2391
2392void jbd2_free(void *ptr, size_t size)
2393{

Callers 1

Calls 2

kmem_cache_allocFunction · 0.85
get_slabFunction · 0.85

Tested by

no test coverage detected