From 2e1394fccdda6e88fd91bdfc99cd035bbc8f5242 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Thu, 28 Apr 2022 15:39:04 -0400 Subject: [PATCH] xfs: rename _zone variables to _cache Source kernel commit: 182696fb021fc196e5cbe641565ca40fcf0f885a Now that we've gotten rid of the kmem_zone_t typedef, rename the variables to _cache since that's what they are. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Signed-off-by: Eric Sandeen --- include/kmem.h | 18 ++++++---------- libxfs/defer_item.c | 6 +++--- libxfs/init.c | 46 ++++++++++++++++++++--------------------- libxfs/kmem.c | 32 ++++++++++++++-------------- libxfs/libxfs_priv.h | 10 ++++----- libxfs/logitem.c | 8 +++---- libxfs/rdwr.c | 20 +++++++++--------- libxfs/trans.c | 14 ++++++------- libxfs/xfs_alloc.c | 6 +++--- libxfs/xfs_attr_leaf.c | 2 +- libxfs/xfs_bmap.c | 6 +++--- libxfs/xfs_bmap.h | 2 +- libxfs/xfs_da_btree.c | 6 +++--- libxfs/xfs_da_btree.h | 3 +-- libxfs/xfs_inode_fork.c | 8 +++---- libxfs/xfs_inode_fork.h | 2 +- 16 files changed, 91 insertions(+), 98 deletions(-) diff --git a/include/kmem.h b/include/kmem.h index e330e0e88..20e4bfe3c 100644 --- a/include/kmem.h +++ b/include/kmem.h @@ -12,10 +12,10 @@ #define KM_NOLOCKDEP 0x0020u struct kmem_cache { - int zone_unitsize; /* Size in bytes of zone unit */ + int cache_unitsize; /* Size in bytes of cache unit */ int allocated; /* debug: How many allocated? */ unsigned int align; - const char *zone_name; /* tag name */ + const char *cache_name; /* tag name */ void (*ctor)(void *); }; @@ -33,25 +33,19 @@ struct kmem_cache * kmem_cache_create(const char *name, unsigned int size, void (*ctor)(void *)); static inline struct kmem_cache * -kmem_zone_init(unsigned int size, const char *name) +kmem_cache_init(unsigned int size, const char *name) { return kmem_cache_create(name, size, 0, 0, NULL); } extern void *kmem_cache_alloc(struct kmem_cache *, gfp_t); extern void *kmem_cache_zalloc(struct kmem_cache *, gfp_t); -extern int kmem_zone_destroy(struct kmem_cache *); +extern int kmem_cache_destroy(struct kmem_cache *); static inline void -kmem_cache_destroy(struct kmem_cache *zone) +kmem_cache_free(struct kmem_cache *cache, void *ptr) { - kmem_zone_destroy(zone); -} - -static inline void -kmem_cache_free(struct kmem_cache *zone, void *ptr) -{ - zone->allocated--; + cache->allocated--; free(ptr); } diff --git a/libxfs/defer_item.c b/libxfs/defer_item.c index a985f0280..1412d0890 100644 --- a/libxfs/defer_item.c +++ b/libxfs/defer_item.c @@ -82,7 +82,7 @@ xfs_extent_free_finish_item( error = xfs_free_extent(tp, free->xefi_startblock, free->xefi_blockcount, &free->xefi_oinfo, XFS_AG_RESV_NONE); - kmem_cache_free(xfs_bmap_free_item_zone, free); + kmem_cache_free(xfs_bmap_free_item_cache, free); return error; } @@ -101,7 +101,7 @@ xfs_extent_free_cancel_item( struct xfs_extent_free_item *free; free = container_of(item, struct xfs_extent_free_item, xefi_list); - kmem_cache_free(xfs_bmap_free_item_zone, free); + kmem_cache_free(xfs_bmap_free_item_cache, free); } const struct xfs_defer_op_type xfs_extent_free_defer_type = { @@ -139,7 +139,7 @@ xfs_agfl_free_finish_item( if (!error) error = xfs_free_agfl_block(tp, agno, agbno, agbp, &free->xefi_oinfo); - kmem_cache_free(xfs_bmap_free_item_zone, free); + kmem_cache_free(xfs_bmap_free_item_cache, free); return error; } diff --git a/libxfs/init.c b/libxfs/init.c index fcfd45c5f..e258f938d 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -226,49 +226,49 @@ check_open(char *path, int flags, char **rawfile, char **blockfile) } /* - * Initialize/destroy all of the zone allocators we use. + * Initialize/destroy all of the cache allocators we use. */ static void -init_zones(void) +init_caches(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( + /* initialise cache allocation */ + xfs_buf_cache = kmem_cache_init(sizeof(struct xfs_buf), "xfs_buffer"); + xfs_inode_cache = kmem_cache_init(sizeof(struct xfs_inode), "xfs_inode"); + xfs_ifork_cache = kmem_cache_init(sizeof(struct xfs_ifork), "xfs_ifork"); + xfs_ili_cache = kmem_cache_init( sizeof(struct xfs_inode_log_item),"xfs_inode_log_item"); - xfs_buf_item_zone = kmem_zone_init( + xfs_buf_item_cache = kmem_cache_init( sizeof(struct xfs_buf_log_item), "xfs_buf_log_item"); - xfs_da_state_zone = kmem_zone_init( + xfs_da_state_cache = kmem_cache_init( sizeof(struct xfs_da_state), "xfs_da_state"); 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( + xfs_bmap_free_item_cache = kmem_cache_init( sizeof(struct xfs_extent_free_item), "xfs_bmap_free_item"); - xfs_trans_zone = kmem_zone_init( + xfs_trans_cache = kmem_cache_init( sizeof(struct xfs_trans), "xfs_trans"); } static int -destroy_zones(void) +destroy_caches(void) { int leaked = 0; - leaked += kmem_zone_destroy(xfs_buf_zone); - leaked += kmem_zone_destroy(xfs_ili_zone); - leaked += kmem_zone_destroy(xfs_inode_zone); - leaked += kmem_zone_destroy(xfs_ifork_zone); - leaked += kmem_zone_destroy(xfs_buf_item_zone); - leaked += kmem_zone_destroy(xfs_da_state_zone); + leaked += kmem_cache_destroy(xfs_buf_cache); + leaked += kmem_cache_destroy(xfs_ili_cache); + leaked += kmem_cache_destroy(xfs_inode_cache); + leaked += kmem_cache_destroy(xfs_ifork_cache); + leaked += kmem_cache_destroy(xfs_buf_item_cache); + leaked += kmem_cache_destroy(xfs_da_state_cache); xfs_btree_destroy_cur_caches(); - leaked += kmem_zone_destroy(xfs_bmap_free_item_zone); - leaked += kmem_zone_destroy(xfs_trans_zone); + leaked += kmem_cache_destroy(xfs_bmap_free_item_cache); + leaked += kmem_cache_destroy(xfs_trans_cache); return leaked; } @@ -405,7 +405,7 @@ libxfs_init(libxfs_init_t *a) &libxfs_bcache_operations); use_xfs_buf_lock = a->usebuflock; xfs_dir_startup(); - init_zones(); + init_caches(); rval = 1; done: if (dpath[0]) @@ -1031,11 +1031,11 @@ libxfs_destroy( libxfs_close_devices(li); - /* Free everything from the buffer cache before freeing buffer zone */ + /* Free everything from the buffer cache before freeing buffer cache */ libxfs_bcache_purge(); libxfs_bcache_free(); cache_destroy(libxfs_bcache); - leaked = destroy_zones(); + leaked = destroy_caches(); rcu_unregister_thread(); if (getenv("LIBXFS_LEAK_CHECK") && leaked) exit(1); diff --git a/libxfs/kmem.c b/libxfs/kmem.c index daacd2c6b..42d813088 100644 --- a/libxfs/kmem.c +++ b/libxfs/kmem.c @@ -13,13 +13,13 @@ kmem_cache_create(const char *name, unsigned int size, unsigned int align, struct kmem_cache *ptr = malloc(sizeof(struct kmem_cache)); if (ptr == NULL) { - fprintf(stderr, _("%s: zone init failed (%s, %d bytes): %s\n"), + fprintf(stderr, _("%s: cache init failed (%s, %d bytes): %s\n"), progname, name, (int)sizeof(struct kmem_cache), strerror(errno)); exit(1); } - ptr->zone_unitsize = size; - ptr->zone_name = name; + ptr->cache_unitsize = size; + ptr->cache_name = name; ptr->allocated = 0; ptr->align = align; ptr->ctor = ctor; @@ -28,40 +28,40 @@ kmem_cache_create(const char *name, unsigned int size, unsigned int align, } int -kmem_zone_destroy(struct kmem_cache *zone) +kmem_cache_destroy(struct kmem_cache *cache) { int leaked = 0; - if (getenv("LIBXFS_LEAK_CHECK") && zone->allocated) { + if (getenv("LIBXFS_LEAK_CHECK") && cache->allocated) { leaked = 1; - fprintf(stderr, "zone %s freed with %d items allocated\n", - zone->zone_name, zone->allocated); + fprintf(stderr, "cache %s freed with %d items allocated\n", + cache->cache_name, cache->allocated); } - free(zone); + free(cache); return leaked; } void * -kmem_cache_alloc(struct kmem_cache *zone, gfp_t flags) +kmem_cache_alloc(struct kmem_cache *cache, gfp_t flags) { - void *ptr = malloc(zone->zone_unitsize); + void *ptr = malloc(cache->cache_unitsize); if (ptr == NULL) { - fprintf(stderr, _("%s: zone alloc failed (%s, %d bytes): %s\n"), - progname, zone->zone_name, zone->zone_unitsize, + fprintf(stderr, _("%s: cache alloc failed (%s, %d bytes): %s\n"), + progname, cache->cache_name, cache->cache_unitsize, strerror(errno)); exit(1); } - zone->allocated++; + cache->allocated++; return ptr; } void * -kmem_cache_zalloc(struct kmem_cache *zone, gfp_t flags) +kmem_cache_zalloc(struct kmem_cache *cache, gfp_t flags) { - void *ptr = kmem_cache_alloc(zone, flags); + void *ptr = kmem_cache_alloc(cache, flags); - memset(ptr, 0, zone->zone_unitsize); + memset(ptr, 0, cache->cache_unitsize); return ptr; } diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h index 2c888fb74..53f45d5a5 100644 --- a/libxfs/libxfs_priv.h +++ b/libxfs/libxfs_priv.h @@ -59,11 +59,11 @@ #include /* Zones used in libxfs allocations that aren't in shared header files */ -extern struct kmem_cache *xfs_buf_item_zone; -extern struct kmem_cache *xfs_ili_zone; -extern struct kmem_cache *xfs_buf_zone; -extern struct kmem_cache *xfs_inode_zone; -extern struct kmem_cache *xfs_trans_zone; +extern struct kmem_cache *xfs_buf_item_cache; +extern struct kmem_cache *xfs_ili_cache; +extern struct kmem_cache *xfs_buf_cache; +extern struct kmem_cache *xfs_inode_cache; +extern struct kmem_cache *xfs_trans_cache; /* fake up iomap, (not) used in xfs_bmap.[ch] */ #define IOMAP_F_SHARED 0x04 diff --git a/libxfs/logitem.c b/libxfs/logitem.c index dde90502c..98ccdaefb 100644 --- a/libxfs/logitem.c +++ b/libxfs/logitem.c @@ -16,8 +16,8 @@ #include "xfs_inode.h" #include "xfs_trans.h" -struct kmem_cache *xfs_buf_item_zone; -struct kmem_cache *xfs_ili_zone; /* inode log item zone */ +struct kmem_cache *xfs_buf_item_cache; +struct kmem_cache *xfs_ili_cache; /* inode log item cache */ /* * Following functions from fs/xfs/xfs_trans_buf.c @@ -96,7 +96,7 @@ xfs_buf_item_init( } } - bip = kmem_cache_zalloc(xfs_buf_item_zone, 0); + bip = kmem_cache_zalloc(xfs_buf_item_cache, 0); #ifdef LI_DEBUG fprintf(stderr, "adding buf item %p for not-logged buffer %p\n", bip, bp); @@ -138,7 +138,7 @@ xfs_inode_item_init( struct xfs_inode_log_item *iip; ASSERT(ip->i_itemp == NULL); - iip = ip->i_itemp = kmem_cache_zalloc(xfs_ili_zone, 0); + iip = ip->i_itemp = kmem_cache_zalloc(xfs_ili_cache, 0); #ifdef LI_DEBUG fprintf(stderr, "inode_item_init for inode %llu, iip=%p\n", ip->i_ino, iip); diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c index d23827158..c283928b1 100644 --- a/libxfs/rdwr.c +++ b/libxfs/rdwr.c @@ -161,7 +161,7 @@ libxfs_getsb( return bp; } -struct kmem_cache *xfs_buf_zone; +struct kmem_cache *xfs_buf_cache; static struct cache_mru xfs_buf_freelist = {{&xfs_buf_freelist.cm_list, &xfs_buf_freelist.cm_list}, @@ -327,7 +327,7 @@ __libxfs_getbufr(int blen) bp->b_maps = NULL; } } else - bp = kmem_cache_zalloc(xfs_buf_zone, 0); + bp = kmem_cache_zalloc(xfs_buf_cache, 0); pthread_mutex_unlock(&xfs_buf_freelist.cm_mutex); bp->b_ops = NULL; if (bp->b_flags & LIBXFS_B_DIRTY) @@ -964,7 +964,7 @@ libxfs_bcache_free(void) free(bp->b_addr); if (bp->b_maps != &bp->__b_map) free(bp->b_maps); - kmem_cache_free(xfs_buf_zone, bp); + kmem_cache_free(xfs_buf_cache, bp); } } @@ -1056,8 +1056,8 @@ xfs_verify_magic16( * Inode cache stubs. */ -struct kmem_cache *xfs_inode_zone; -extern struct kmem_cache *xfs_ili_zone; +struct kmem_cache *xfs_inode_cache; +extern struct kmem_cache *xfs_ili_cache; int libxfs_iget( @@ -1071,7 +1071,7 @@ libxfs_iget( struct xfs_buf *bp; int error = 0; - ip = kmem_cache_zalloc(xfs_inode_zone, 0); + ip = kmem_cache_zalloc(xfs_inode_cache, 0); if (!ip) return -ENOMEM; @@ -1101,7 +1101,7 @@ libxfs_iget( return 0; out_destroy: - kmem_cache_free(xfs_inode_zone, ip); + kmem_cache_free(xfs_inode_cache, ip); *ipp = NULL; return error; } @@ -1118,11 +1118,11 @@ libxfs_idestroy(xfs_inode_t *ip) } if (ip->i_afp) { libxfs_idestroy_fork(ip->i_afp); - kmem_cache_free(xfs_ifork_zone, ip->i_afp); + kmem_cache_free(xfs_ifork_cache, ip->i_afp); } if (ip->i_cowfp) { libxfs_idestroy_fork(ip->i_cowfp); - kmem_cache_free(xfs_ifork_zone, ip->i_cowfp); + kmem_cache_free(xfs_ifork_cache, ip->i_cowfp); } } @@ -1135,7 +1135,7 @@ libxfs_irele( if (VFS_I(ip)->i_count == 0) { ASSERT(ip->i_itemp == NULL); libxfs_idestroy(ip); - kmem_cache_free(xfs_inode_zone, ip); + kmem_cache_free(xfs_inode_cache, ip); } } diff --git a/libxfs/trans.c b/libxfs/trans.c index f87a65c57..50d9c23de 100644 --- a/libxfs/trans.c +++ b/libxfs/trans.c @@ -30,7 +30,7 @@ static int __xfs_trans_commit(struct xfs_trans *tp, bool regrant); * Simple transaction interface */ -struct kmem_cache *xfs_trans_zone; +struct kmem_cache *xfs_trans_cache; /* * Initialize the precomputed transaction reservation values @@ -124,7 +124,7 @@ static void xfs_trans_free( struct xfs_trans *tp) { - kmem_cache_free(xfs_trans_zone, tp); + kmem_cache_free(xfs_trans_cache, tp); } /* @@ -141,7 +141,7 @@ xfs_trans_dup( { struct xfs_trans *ntp; - ntp = kmem_cache_zalloc(xfs_trans_zone, 0); + ntp = kmem_cache_zalloc(xfs_trans_cache, 0); /* * Initialize the new transaction structure. @@ -259,7 +259,7 @@ libxfs_trans_alloc( struct xfs_trans *tp; int error; - tp = kmem_cache_zalloc(xfs_trans_zone, 0); + tp = kmem_cache_zalloc(xfs_trans_cache, 0); tp->t_mountp = mp; INIT_LIST_HEAD(&tp->t_items); INIT_LIST_HEAD(&tp->t_dfops); @@ -354,7 +354,7 @@ xfs_buf_item_put( struct xfs_buf *bp = bip->bli_buf; bp->b_log_item = NULL; - kmem_cache_free(xfs_buf_item_zone, bip); + kmem_cache_free(xfs_buf_item_cache, bip); } /* from xfs_trans_buf.c */ @@ -816,7 +816,7 @@ xfs_inode_item_put( ip->i_itemp = NULL; list_del_init(&iip->ili_item.li_bio_list); - kmem_cache_free(xfs_ili_zone, iip); + kmem_cache_free(xfs_ili_cache, iip); } @@ -868,7 +868,7 @@ buf_item_done( { struct xfs_buf *bp; int hold; - extern struct kmem_cache *xfs_buf_item_zone; + extern struct kmem_cache *xfs_buf_item_cache; bp = bip->bli_buf; ASSERT(bp != NULL); diff --git a/libxfs/xfs_alloc.c b/libxfs/xfs_alloc.c index c99497fd9..06e870a8e 100644 --- a/libxfs/xfs_alloc.c +++ b/libxfs/xfs_alloc.c @@ -23,7 +23,7 @@ #include "xfs_ag_resv.h" #include "xfs_bmap.h" -extern struct kmem_cache *xfs_bmap_free_item_zone; +extern struct kmem_cache *xfs_bmap_free_item_cache; struct workqueue_struct *xfs_alloc_wq; @@ -2455,10 +2455,10 @@ xfs_defer_agfl_block( struct xfs_mount *mp = tp->t_mountp; struct xfs_extent_free_item *new; /* new element */ - ASSERT(xfs_bmap_free_item_zone != NULL); + ASSERT(xfs_bmap_free_item_cache != NULL); ASSERT(oinfo != NULL); - new = kmem_cache_alloc(xfs_bmap_free_item_zone, + new = kmem_cache_alloc(xfs_bmap_free_item_cache, GFP_KERNEL | __GFP_NOFAIL); new->xefi_startblock = XFS_AGB_TO_FSB(mp, agno, agbno); new->xefi_blockcount = 1; diff --git a/libxfs/xfs_attr_leaf.c b/libxfs/xfs_attr_leaf.c index 76a525735..31eddb543 100644 --- a/libxfs/xfs_attr_leaf.c +++ b/libxfs/xfs_attr_leaf.c @@ -767,7 +767,7 @@ xfs_attr_fork_remove( ASSERT(ip->i_afp->if_nextents == 0); xfs_idestroy_fork(ip->i_afp); - kmem_cache_free(xfs_ifork_zone, ip->i_afp); + kmem_cache_free(xfs_ifork_cache, ip->i_afp); ip->i_afp = NULL; ip->i_forkoff = 0; xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index ecf79e244..0514d6e5c 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -31,7 +31,7 @@ #include "xfs_refcount.h" -struct kmem_cache *xfs_bmap_free_item_zone; +struct kmem_cache *xfs_bmap_free_item_cache; /* * Miscellaneous helper functions @@ -548,9 +548,9 @@ __xfs_bmap_add_free( ASSERT(len < mp->m_sb.sb_agblocks); ASSERT(agbno + len <= mp->m_sb.sb_agblocks); #endif - ASSERT(xfs_bmap_free_item_zone != NULL); + ASSERT(xfs_bmap_free_item_cache != NULL); - new = kmem_cache_alloc(xfs_bmap_free_item_zone, + new = kmem_cache_alloc(xfs_bmap_free_item_cache, GFP_KERNEL | __GFP_NOFAIL); new->xefi_startblock = bno; new->xefi_blockcount = (xfs_extlen_t)len; diff --git a/libxfs/xfs_bmap.h b/libxfs/xfs_bmap.h index 171a72ee9..2cd7717cf 100644 --- a/libxfs/xfs_bmap.h +++ b/libxfs/xfs_bmap.h @@ -13,7 +13,7 @@ struct xfs_inode; struct xfs_mount; struct xfs_trans; -extern struct kmem_cache *xfs_bmap_free_item_zone; +extern struct kmem_cache *xfs_bmap_free_item_cache; /* * Argument structure for xfs_bmap_alloc. diff --git a/libxfs/xfs_da_btree.c b/libxfs/xfs_da_btree.c index f1ae5d4d7..50f3ec661 100644 --- a/libxfs/xfs_da_btree.c +++ b/libxfs/xfs_da_btree.c @@ -69,7 +69,7 @@ STATIC int xfs_da3_blk_unlink(xfs_da_state_t *state, xfs_da_state_blk_t *save_blk); -struct kmem_cache *xfs_da_state_zone; /* anchor for state struct zone */ +struct kmem_cache *xfs_da_state_cache; /* anchor for dir/attr state */ /* * Allocate a dir-state structure. @@ -81,7 +81,7 @@ xfs_da_state_alloc( { struct xfs_da_state *state; - state = kmem_cache_zalloc(xfs_da_state_zone, GFP_NOFS | __GFP_NOFAIL); + state = kmem_cache_zalloc(xfs_da_state_cache, GFP_NOFS | __GFP_NOFAIL); state->args = args; state->mp = args->dp->i_mount; return state; @@ -110,7 +110,7 @@ xfs_da_state_free(xfs_da_state_t *state) #ifdef DEBUG memset((char *)state, 0, sizeof(*state)); #endif /* DEBUG */ - kmem_cache_free(xfs_da_state_zone, state); + kmem_cache_free(xfs_da_state_cache, state); } static inline int xfs_dabuf_nfsb(struct xfs_mount *mp, int whichfork) diff --git a/libxfs/xfs_da_btree.h b/libxfs/xfs_da_btree.h index da845e32a..0faf7d9ac 100644 --- a/libxfs/xfs_da_btree.h +++ b/libxfs/xfs_da_btree.h @@ -9,7 +9,6 @@ struct xfs_inode; struct xfs_trans; -struct zone; /* * Directory/attribute geometry information. There will be one of these for each @@ -227,6 +226,6 @@ void xfs_da3_node_hdr_from_disk(struct xfs_mount *mp, void xfs_da3_node_hdr_to_disk(struct xfs_mount *mp, struct xfs_da_intnode *to, struct xfs_da3_icnode_hdr *from); -extern struct kmem_cache *xfs_da_state_zone; +extern struct kmem_cache *xfs_da_state_cache; #endif /* __XFS_DA_BTREE_H__ */ diff --git a/libxfs/xfs_inode_fork.c b/libxfs/xfs_inode_fork.c index c80b40661..d6ac13eea 100644 --- a/libxfs/xfs_inode_fork.c +++ b/libxfs/xfs_inode_fork.c @@ -24,7 +24,7 @@ #include "xfs_types.h" #include "xfs_errortag.h" -struct kmem_cache *xfs_ifork_zone; +struct kmem_cache *xfs_ifork_cache; void xfs_init_local_fork( @@ -282,7 +282,7 @@ xfs_ifork_alloc( { struct xfs_ifork *ifp; - ifp = kmem_cache_zalloc(xfs_ifork_zone, GFP_NOFS | __GFP_NOFAIL); + ifp = kmem_cache_zalloc(xfs_ifork_cache, GFP_NOFS | __GFP_NOFAIL); ifp->if_format = format; ifp->if_nextents = nextents; return ifp; @@ -323,7 +323,7 @@ xfs_iformat_attr_fork( } if (error) { - kmem_cache_free(xfs_ifork_zone, ip->i_afp); + kmem_cache_free(xfs_ifork_cache, ip->i_afp); ip->i_afp = NULL; } return error; @@ -674,7 +674,7 @@ xfs_ifork_init_cow( if (ip->i_cowfp) return; - ip->i_cowfp = kmem_cache_zalloc(xfs_ifork_zone, + ip->i_cowfp = kmem_cache_zalloc(xfs_ifork_cache, GFP_NOFS | __GFP_NOFAIL); ip->i_cowfp->if_format = XFS_DINODE_FMT_EXTENTS; } diff --git a/libxfs/xfs_inode_fork.h b/libxfs/xfs_inode_fork.h index cb296bd5b..3d64a3acb 100644 --- a/libxfs/xfs_inode_fork.h +++ b/libxfs/xfs_inode_fork.h @@ -221,7 +221,7 @@ static inline bool xfs_iext_peek_prev_extent(struct xfs_ifork *ifp, xfs_iext_get_extent((ifp), (ext), (got)); \ xfs_iext_next((ifp), (ext))) -extern struct kmem_cache *xfs_ifork_zone; +extern struct kmem_cache *xfs_ifork_cache; extern void xfs_ifork_init_cow(struct xfs_inode *ip); -- 2.47.2