mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 22:50:41 +00:00
Btrfs: kill btrfs_cache_create
Just use kmem_cache_create directly. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
0d4bf11e53
commit
9601e3f633
@ -17,12 +17,6 @@
|
|||||||
#include "ctree.h"
|
#include "ctree.h"
|
||||||
#include "btrfs_inode.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_state_cache;
|
||||||
static struct kmem_cache *extent_buffer_cache;
|
static struct kmem_cache *extent_buffer_cache;
|
||||||
|
|
||||||
@ -58,15 +52,15 @@ struct extent_page_data {
|
|||||||
|
|
||||||
int __init extent_io_init(void)
|
int __init extent_io_init(void)
|
||||||
{
|
{
|
||||||
extent_state_cache = btrfs_cache_create("extent_state",
|
extent_state_cache = kmem_cache_create("extent_state",
|
||||||
sizeof(struct extent_state), 0,
|
sizeof(struct extent_state), 0,
|
||||||
NULL);
|
SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD, NULL);
|
||||||
if (!extent_state_cache)
|
if (!extent_state_cache)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
extent_buffer_cache = btrfs_cache_create("extent_buffers",
|
extent_buffer_cache = kmem_cache_create("extent_buffers",
|
||||||
sizeof(struct extent_buffer), 0,
|
sizeof(struct extent_buffer), 0,
|
||||||
NULL);
|
SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD, NULL);
|
||||||
if (!extent_buffer_cache)
|
if (!extent_buffer_cache)
|
||||||
goto free_state_cache;
|
goto free_state_cache;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -6,19 +6,14 @@
|
|||||||
#include <linux/hardirq.h>
|
#include <linux/hardirq.h>
|
||||||
#include "extent_map.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;
|
static struct kmem_cache *extent_map_cache;
|
||||||
|
|
||||||
int __init extent_map_init(void)
|
int __init extent_map_init(void)
|
||||||
{
|
{
|
||||||
extent_map_cache = btrfs_cache_create("extent_map",
|
extent_map_cache = kmem_cache_create("extent_map",
|
||||||
sizeof(struct extent_map), 0,
|
sizeof(struct extent_map), 0,
|
||||||
NULL);
|
SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD, NULL);
|
||||||
if (!extent_map_cache)
|
if (!extent_map_cache)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -4640,39 +4640,35 @@ void btrfs_destroy_cachep(void)
|
|||||||
kmem_cache_destroy(btrfs_path_cachep);
|
kmem_cache_destroy(btrfs_path_cachep);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct kmem_cache *btrfs_cache_create(const char *name, size_t size,
|
|
||||||
unsigned long extra_flags,
|
|
||||||
void (*ctor)(void *))
|
|
||||||
{
|
|
||||||
return kmem_cache_create(name, size, 0, (SLAB_RECLAIM_ACCOUNT |
|
|
||||||
SLAB_MEM_SPREAD | extra_flags), ctor);
|
|
||||||
}
|
|
||||||
|
|
||||||
int btrfs_init_cachep(void)
|
int btrfs_init_cachep(void)
|
||||||
{
|
{
|
||||||
btrfs_inode_cachep = btrfs_cache_create("btrfs_inode_cache",
|
btrfs_inode_cachep = kmem_cache_create("btrfs_inode_cache",
|
||||||
sizeof(struct btrfs_inode),
|
sizeof(struct btrfs_inode), 0,
|
||||||
0, init_once);
|
SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD, init_once);
|
||||||
if (!btrfs_inode_cachep)
|
if (!btrfs_inode_cachep)
|
||||||
goto fail;
|
goto fail;
|
||||||
btrfs_trans_handle_cachep =
|
|
||||||
btrfs_cache_create("btrfs_trans_handle_cache",
|
btrfs_trans_handle_cachep = kmem_cache_create("btrfs_trans_handle_cache",
|
||||||
sizeof(struct btrfs_trans_handle),
|
sizeof(struct btrfs_trans_handle), 0,
|
||||||
0, NULL);
|
SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD, NULL);
|
||||||
if (!btrfs_trans_handle_cachep)
|
if (!btrfs_trans_handle_cachep)
|
||||||
goto fail;
|
goto fail;
|
||||||
btrfs_transaction_cachep = btrfs_cache_create("btrfs_transaction_cache",
|
|
||||||
sizeof(struct btrfs_transaction),
|
btrfs_transaction_cachep = kmem_cache_create("btrfs_transaction_cache",
|
||||||
0, NULL);
|
sizeof(struct btrfs_transaction), 0,
|
||||||
|
SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD, NULL);
|
||||||
if (!btrfs_transaction_cachep)
|
if (!btrfs_transaction_cachep)
|
||||||
goto fail;
|
goto fail;
|
||||||
btrfs_path_cachep = btrfs_cache_create("btrfs_path_cache",
|
|
||||||
sizeof(struct btrfs_path),
|
btrfs_path_cachep = kmem_cache_create("btrfs_path_cache",
|
||||||
0, NULL);
|
sizeof(struct btrfs_path), 0,
|
||||||
|
SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD, NULL);
|
||||||
if (!btrfs_path_cachep)
|
if (!btrfs_path_cachep)
|
||||||
goto fail;
|
goto fail;
|
||||||
btrfs_bit_radix_cachep = btrfs_cache_create("btrfs_radix", 256,
|
|
||||||
SLAB_DESTROY_BY_RCU, NULL);
|
btrfs_bit_radix_cachep = kmem_cache_create("btrfs_radix", 256, 0,
|
||||||
|
SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD |
|
||||||
|
SLAB_DESTROY_BY_RCU, NULL);
|
||||||
if (!btrfs_bit_radix_cachep)
|
if (!btrfs_bit_radix_cachep)
|
||||||
goto fail;
|
goto fail;
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user