extent_map.c (0d4bf11e5309eff64272a49e1ea55658372abc56) | extent_map.c (9601e3f6336f6ca66929f451b1f66085e68e36e3) |
---|---|
1#include <linux/err.h> 2#include <linux/gfp.h> 3#include <linux/slab.h> 4#include <linux/module.h> 5#include <linux/spinlock.h> 6#include <linux/hardirq.h> 7#include "extent_map.h" 8 | 1#include <linux/err.h> 2#include <linux/gfp.h> 3#include <linux/slab.h> 4#include <linux/module.h> 5#include <linux/spinlock.h> 6#include <linux/hardirq.h> 7#include "extent_map.h" 8 |
9/* temporary define until extent_map moves out of btrfs */ 10struct kmem_cache *btrfs_cache_create(const char *name, size_t size, 11 unsigned long extra_flags, 12 void (*ctor)(void *, struct kmem_cache *, 13 unsigned long)); | |
14 15static struct kmem_cache *extent_map_cache; 16 17int __init extent_map_init(void) 18{ | 9 10static struct kmem_cache *extent_map_cache; 11 12int __init extent_map_init(void) 13{ |
19 extent_map_cache = btrfs_cache_create("extent_map", 20 sizeof(struct extent_map), 0, 21 NULL); | 14 extent_map_cache = kmem_cache_create("extent_map", 15 sizeof(struct extent_map), 0, 16 SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD, NULL); |
22 if (!extent_map_cache) 23 return -ENOMEM; 24 return 0; 25} 26 27void extent_map_exit(void) 28{ 29 if (extent_map_cache) --- 314 unchanged lines hidden --- | 17 if (!extent_map_cache) 18 return -ENOMEM; 19 return 0; 20} 21 22void extent_map_exit(void) 23{ 24 if (extent_map_cache) --- 314 unchanged lines hidden --- |