diff options
author | Christoph Hellwig <hch@lst.de> | 2009-04-13 09:33:09 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-04-24 15:46:04 -0400 |
commit | 9601e3f6336f6ca66929f451b1f66085e68e36e3 (patch) | |
tree | 002308d56cb1947490d691fdf9a8ea74e48d8672 /fs/btrfs/inode.c | |
parent | 0d4bf11e5309eff64272a49e1ea55658372abc56 (diff) |
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>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 65219f6a16a1..176b6cc28b1e 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -4640,39 +4640,35 @@ void btrfs_destroy_cachep(void) | |||
4640 | kmem_cache_destroy(btrfs_path_cachep); | 4640 | kmem_cache_destroy(btrfs_path_cachep); |
4641 | } | 4641 | } |
4642 | 4642 | ||
4643 | struct kmem_cache *btrfs_cache_create(const char *name, size_t size, | ||
4644 | unsigned long extra_flags, | ||
4645 | void (*ctor)(void *)) | ||
4646 | { | ||
4647 | return kmem_cache_create(name, size, 0, (SLAB_RECLAIM_ACCOUNT | | ||
4648 | SLAB_MEM_SPREAD | extra_flags), ctor); | ||
4649 | } | ||
4650 | |||
4651 | int btrfs_init_cachep(void) | 4643 | int btrfs_init_cachep(void) |
4652 | { | 4644 | { |
4653 | btrfs_inode_cachep = btrfs_cache_create("btrfs_inode_cache", | 4645 | btrfs_inode_cachep = kmem_cache_create("btrfs_inode_cache", |
4654 | sizeof(struct btrfs_inode), | 4646 | sizeof(struct btrfs_inode), 0, |
4655 | 0, init_once); | 4647 | SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD, init_once); |
4656 | if (!btrfs_inode_cachep) | 4648 | if (!btrfs_inode_cachep) |
4657 | goto fail; | 4649 | goto fail; |
4658 | btrfs_trans_handle_cachep = | 4650 | |
4659 | btrfs_cache_create("btrfs_trans_handle_cache", | 4651 | btrfs_trans_handle_cachep = kmem_cache_create("btrfs_trans_handle_cache", |
4660 | sizeof(struct btrfs_trans_handle), | 4652 | sizeof(struct btrfs_trans_handle), 0, |
4661 | 0, NULL); | 4653 | SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD, NULL); |
4662 | if (!btrfs_trans_handle_cachep) | 4654 | if (!btrfs_trans_handle_cachep) |
4663 | goto fail; | 4655 | goto fail; |
4664 | btrfs_transaction_cachep = btrfs_cache_create("btrfs_transaction_cache", | 4656 | |
4665 | sizeof(struct btrfs_transaction), | 4657 | btrfs_transaction_cachep = kmem_cache_create("btrfs_transaction_cache", |
4666 | 0, NULL); | 4658 | sizeof(struct btrfs_transaction), 0, |
4659 | SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD, NULL); | ||
4667 | if (!btrfs_transaction_cachep) | 4660 | if (!btrfs_transaction_cachep) |
4668 | goto fail; | 4661 | goto fail; |
4669 | btrfs_path_cachep = btrfs_cache_create("btrfs_path_cache", | 4662 | |
4670 | sizeof(struct btrfs_path), | 4663 | btrfs_path_cachep = kmem_cache_create("btrfs_path_cache", |
4671 | 0, NULL); | 4664 | sizeof(struct btrfs_path), 0, |
4665 | SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD, NULL); | ||
4672 | if (!btrfs_path_cachep) | 4666 | if (!btrfs_path_cachep) |
4673 | goto fail; | 4667 | goto fail; |
4674 | btrfs_bit_radix_cachep = btrfs_cache_create("btrfs_radix", 256, | 4668 | |
4675 | SLAB_DESTROY_BY_RCU, NULL); | 4669 | btrfs_bit_radix_cachep = kmem_cache_create("btrfs_radix", 256, 0, |
4670 | SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD | | ||
4671 | SLAB_DESTROY_BY_RCU, NULL); | ||
4676 | if (!btrfs_bit_radix_cachep) | 4672 | if (!btrfs_bit_radix_cachep) |
4677 | goto fail; | 4673 | goto fail; |
4678 | return 0; | 4674 | return 0; |