Commit 4136e38a authored by Darrick J. Wong's avatar Darrick J. Wong Committed by Dave Chinner
Browse files

xfs: put attr[id] log item cache init with the others



Initialize and destroy the xattr log item caches in the same places that
we do all the other log item caches.

Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarAllison Henderson <allison.henderson@oracle.com>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent 500a512c
Loading
Loading
Loading
Loading
+0 −36
Original line number Diff line number Diff line
@@ -27,8 +27,6 @@
#include "xfs_attr_item.h"
#include "xfs_log.h"

struct kmem_cache		*xfs_attri_cache;
struct kmem_cache		*xfs_attrd_cache;
struct kmem_cache		*xfs_attr_intent_cache;

/*
@@ -1113,40 +1111,6 @@ xfs_attr_set(
	goto out_unlock;
}

int __init
xfs_attri_init_cache(void)
{
	xfs_attri_cache = kmem_cache_create("xfs_attri",
					    sizeof(struct xfs_attri_log_item),
					    0, 0, NULL);

	return xfs_attri_cache != NULL ? 0 : -ENOMEM;
}

void
xfs_attri_destroy_cache(void)
{
	kmem_cache_destroy(xfs_attri_cache);
	xfs_attri_cache = NULL;
}

int __init
xfs_attrd_init_cache(void)
{
	xfs_attrd_cache = kmem_cache_create("xfs_attrd",
					    sizeof(struct xfs_attrd_log_item),
					    0, 0, NULL);

	return xfs_attrd_cache != NULL ? 0 : -ENOMEM;
}

void
xfs_attrd_destroy_cache(void)
{
	kmem_cache_destroy(xfs_attrd_cache);
	xfs_attrd_cache = NULL;
}

/*========================================================================
 * External routines when attribute list is inside the inode
 *========================================================================*/
+0 −8
Original line number Diff line number Diff line
@@ -558,14 +558,6 @@ int xfs_attr_calc_size(struct xfs_da_args *args, int *local);
void xfs_init_attr_trans(struct xfs_da_args *args, struct xfs_trans_res *tres,
			 unsigned int *total);

extern struct kmem_cache	*xfs_attri_cache;
extern struct kmem_cache	*xfs_attrd_cache;

int __init xfs_attri_init_cache(void);
void xfs_attri_destroy_cache(void);
int __init xfs_attrd_init_cache(void);
void xfs_attrd_destroy_cache(void);

/*
 * Check to see if the attr should be upgraded from non-existent or shortform to
 * single-leaf-block attribute list.
+0 −8
Original line number Diff line number Diff line
@@ -871,12 +871,6 @@ xfs_defer_init_item_caches(void)
	if (error)
		goto err;
	error = xfs_extfree_intent_init_cache();
	if (error)
		goto err;
	error = xfs_attri_init_cache();
	if (error)
		goto err;
	error = xfs_attrd_init_cache();
	if (error)
		goto err;
	error = xfs_attr_intent_init_cache();
@@ -893,8 +887,6 @@ void
xfs_defer_destroy_item_caches(void)
{
	xfs_attr_intent_destroy_cache();
	xfs_attri_destroy_cache();
	xfs_attrd_destroy_cache();
	xfs_extfree_intent_destroy_cache();
	xfs_bmap_intent_destroy_cache();
	xfs_refcount_intent_destroy_cache();
+3 −0
Original line number Diff line number Diff line
@@ -29,6 +29,9 @@
#include "xfs_log_priv.h"
#include "xfs_log_recover.h"

struct kmem_cache		*xfs_attri_cache;
struct kmem_cache		*xfs_attrd_cache;

static const struct xfs_item_ops xfs_attri_item_ops;
static const struct xfs_item_ops xfs_attrd_item_ops;
static struct xfs_attrd_log_item *xfs_trans_get_attrd(struct xfs_trans *tp,
+3 −0
Original line number Diff line number Diff line
@@ -43,4 +43,7 @@ struct xfs_attrd_log_item {
	struct xfs_attrd_log_format	attrd_format;
};

extern struct kmem_cache	*xfs_attri_cache;
extern struct kmem_cache	*xfs_attrd_cache;

#endif	/* __XFS_ATTR_ITEM_H__ */
Loading