]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: remove kmem_zone_init
authorDarrick J. Wong <djwong@kernel.org>
Thu, 6 Jan 2022 22:13:23 +0000 (14:13 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 20 Jan 2022 00:02:53 +0000 (16:02 -0800)
Port all callers to kmem_cache_create, to sync with kernel API.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
include/kmem.h
libxfs/init.c

index 53a2b37a748213ce168d05fb5ef979cad89409ff..36acd20dd79f9bf57b932f55a190d303d6b970d4 100644 (file)
@@ -34,13 +34,6 @@ typedef unsigned int __bitwise gfp_t;
 kmem_zone_t * kmem_cache_create(const char *name, unsigned int size,
                unsigned int align, unsigned int slab_flags,
                void (*ctor)(void *));
-
-static inline kmem_zone_t *
-kmem_zone_init(unsigned int size, const char *name)
-{
-       return kmem_cache_create(name, size, 0, 0, NULL);
-}
-
 void kmem_cache_destroy(kmem_zone_t *);
 
 extern void    *kmem_cache_alloc(kmem_zone_t *, gfp_t);
index 0d693848ec5aa9362ad8c4c921e2ba1316946077..155b12facdba0368612544545f4d9346209b7302 100644 (file)
@@ -234,25 +234,29 @@ init_zones(void)
        int             error;
 
        /* initialise zone allocation */
-       xfs_buf_zone = kmem_zone_init(sizeof(struct xfs_buf), "xfs_buffer");
-       xfs_inode_zone = kmem_zone_init(sizeof(struct xfs_inode), "xfs_inode");
-       xfs_ifork_zone = kmem_zone_init(sizeof(struct xfs_ifork), "xfs_ifork");
-       xfs_ili_zone = kmem_zone_init(
-                       sizeof(struct xfs_inode_log_item),"xfs_inode_log_item");
-       xfs_buf_item_zone = kmem_zone_init(
-                       sizeof(struct xfs_buf_log_item), "xfs_buf_log_item");
-       xfs_da_state_zone = kmem_zone_init(
-                       sizeof(struct xfs_da_state), "xfs_da_state");
+       xfs_buf_zone = kmem_cache_create("xfs_buffer",
+                       sizeof(struct xfs_buf), 0, 0, NULL);
+       xfs_inode_zone = kmem_cache_create("xfs_inode",
+                       sizeof(struct xfs_inode), 0, 0, NULL);
+       xfs_ifork_zone = kmem_cache_create("xfs_ifork",
+                       sizeof(struct xfs_ifork), 0, 0, NULL);
+       xfs_ili_zone = kmem_cache_create("xfs_inode_log_item",
+                       sizeof(struct xfs_inode_log_item), 0, 0, NULL);
+       xfs_buf_item_zone = kmem_cache_create("xfs_buf_log_item",
+                       sizeof(struct xfs_buf_log_item), 0, 0, NULL);
+       xfs_da_state_zone = kmem_cache_create("xfs_da_state",
+                       sizeof(struct xfs_da_state), 0, 0, NULL);
+
        error = xfs_btree_init_cur_caches();
        if (error) {
                fprintf(stderr, "Could not allocate btree cursor caches.\n");
                abort();
        }
-       xfs_bmap_free_item_zone = kmem_zone_init(
-                       sizeof(struct xfs_extent_free_item),
-                       "xfs_bmap_free_item");
-       xfs_trans_zone = kmem_zone_init(
-                       sizeof(struct xfs_trans), "xfs_trans");
+
+       xfs_bmap_free_item_zone = kmem_cache_create("xfs_bmap_free_item",
+                       sizeof(struct xfs_extent_free_item), 0, 0, NULL);
+       xfs_trans_zone = kmem_cache_create("xfs_trans",
+                       sizeof(struct xfs_trans), 0, 0, NULL);
 }
 
 static void