btrfs: kill btrfs_cache_create
PATCH 1/1 btrfs: kill btrfs_cache_create
Just use kmem_cache_create directly.
Signed-off-by Christoph Hellwig <[email protected]>
fs/btrfs/extent_io.c +6 -12
@@ -18,12 +18,6 @@#include "ctree.h" #include "btrfs_inode.h" -/* temporary define until extent_map moves out of btrfs */ -struct kmem_cache *btrfs_cache_create (const char *name,size_t size, -unsigned long extra_flags, -void (*ctor)(void *,struct kmem_cache *, -unsigned long )); -static struct kmem_cache *extent_state_cache;static struct kmem_cache *extent_buffer_cache;
@@ -56,15 +50,15 @@ struct extent_page_data {int __init extent_io_init (void ) { - extent_state_cache =btrfs_cache_create ("extent_state" , -sizeof (struct extent_state ),0 , -NULL ); + extent_state_cache =kmem_cache_create ("extent_state" , +sizeof (struct extent_state ),0 , +SLAB_RECLAIM_ACCOUNT |SLAB_MEM_SPREAD ,NULL );if (!extent_state_cache)return -ENOMEM ; - extent_buffer_cache =btrfs_cache_create ("extent_buffers" , -sizeof (struct extent_buffer ),0 , -NULL ); + extent_buffer_cache =kmem_cache_create ("extent_buffers" , +sizeof (struct extent_buffer ),0 , +SLAB_RECLAIM_ACCOUNT |SLAB_MEM_SPREAD ,NULL );if (!extent_buffer_cache) goto free_state_cache;return 0 ;
fs/btrfs/extent_map.c +3 -8
@@ -7,19 +7,14 @@#include <linux/hardirq.h> #include "extent_map.h" -/* temporary define until extent_map moves out of btrfs */ -struct kmem_cache *btrfs_cache_create (const char *name,size_t size, -unsigned long extra_flags, -void (*ctor)(void *,struct kmem_cache *, -unsigned long ));static struct kmem_cache *extent_map_cache;int __init extent_map_init (void ) { - extent_map_cache =btrfs_cache_create ("extent_map" , -sizeof (struct extent_map ),0 , -NULL ); + extent_map_cache =kmem_cache_create ("extent_map" , +sizeof (struct extent_map ),0 , +SLAB_RECLAIM_ACCOUNT |SLAB_MEM_SPREAD ,NULL );if (!extent_map_cache)return -ENOMEM ;return 0 ;
fs/btrfs/inode.c +19 -23
58 lines not on this page · raw message