diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2018-10-02 10:16:52 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-10-08 08:36:58 +0200 |
commit | edf126f64901c6457ff1afd2d2d63234842873b8 (patch) | |
tree | 8dbd777a5028282ef7b08285f6b4f94049ef844b /fs/ubifs | |
parent | 7324242de921f3820e7da843f19bf49eca9502db (diff) | |
download | barebox-edf126f64901c6457ff1afd2d2d63234842873b8.tar.gz barebox-edf126f64901c6457ff1afd2d2d63234842873b8.tar.xz |
Add linux/slab.h
Move stuff we already have in include/linux/barebox-wrapper.h that
really belongs to include/linux/slab.h to there. Also add kmem_cache_*
functions. UBIFS uses them in there own implementation, so we have to
remove it there.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs/ubifs')
-rw-r--r-- | fs/ubifs/super.c | 8 | ||||
-rw-r--r-- | fs/ubifs/ubifs.h | 18 |
2 files changed, 2 insertions, 24 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 977c723442..bfc0a4714a 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -2406,20 +2406,16 @@ static struct file_system_type ubifs_fs_type = { #ifndef __BAREBOX__ MODULE_ALIAS_FS("ubifs"); +#endif /* * Inode slab cache constructor. */ static void inode_slab_ctor(void *obj) { - struct ubifs_inode *ui = obj; - inode_init_once(&ui->vfs_inode); } static int __init ubifs_init(void) -#else -int ubifs_init(void) -#endif { int err; @@ -2480,7 +2476,6 @@ int ubifs_init(void) return -EINVAL; } -#ifndef __BAREBOX__ ubifs_inode_slab = kmem_cache_create("ubifs_inode_slab", sizeof(struct ubifs_inode), 0, SLAB_MEM_SPREAD | SLAB_RECLAIM_ACCOUNT, @@ -2488,6 +2483,7 @@ int ubifs_init(void) if (!ubifs_inode_slab) return -ENOMEM; +#ifndef __BAREBOX__ err = register_shrinker(&ubifs_shrinker_info); if (err) goto out_slab; diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index 4c4c927de9..19af05ade3 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h @@ -71,24 +71,6 @@ struct page { struct inode *inode; }; -struct kmem_cache { int sz; }; - -struct kmem_cache *get_mem(int element_sz); -#define kmem_cache_create(a, sz, c, d, e) get_mem(sz) -static inline void *kmem_cache_alloc(struct kmem_cache *obj, int flag) -{ - return kzalloc(obj->sz, 0); -} - -static inline void kmem_cache_free(struct kmem_cache *cachep, void *obj) -{ - free(obj); -} -static inline void kmem_cache_destroy(struct kmem_cache *cachep) -{ - free(cachep); -} - void *kmemdup(const void *src, size_t len, gfp_t gfp); /* uapi/linux/limits.h */ |