From: kunwu.chan@linux.dev
To: chandan.babu@oracle.com, djwong@kernel.org
Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
Kunwu Chan <chentao@kylinos.cn>
Subject: [PATCH] xfs: use KMEM_CACHE() to create xfs_defer_pending cache
Date: Thu, 29 Feb 2024 16:33:42 +0800 [thread overview]
Message-ID: <20240229083342.1128686-1-kunwu.chan@linux.dev> (raw)
From: Kunwu Chan <chentao@kylinos.cn>
Use the KMEM_CACHE() macro instead of kmem_cache_create() to simplify
the creation of SLAB caches when the default values are used.
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
---
fs/xfs/libxfs/xfs_defer.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_defer.c b/fs/xfs/libxfs/xfs_defer.c
index 66a17910d021..6d957fcc17f2 100644
--- a/fs/xfs/libxfs/xfs_defer.c
+++ b/fs/xfs/libxfs/xfs_defer.c
@@ -1143,9 +1143,7 @@ xfs_defer_resources_rele(
static inline int __init
xfs_defer_init_cache(void)
{
- xfs_defer_pending_cache = kmem_cache_create("xfs_defer_pending",
- sizeof(struct xfs_defer_pending),
- 0, 0, NULL);
+ xfs_defer_pending_cache = KMEM_CACHE(xfs_defer_pending, 0);
return xfs_defer_pending_cache != NULL ? 0 : -ENOMEM;
}
--
2.39.2
next reply other threads:[~2024-02-29 8:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-29 8:33 kunwu.chan [this message]
2024-02-29 16:00 ` [PATCH] xfs: use KMEM_CACHE() to create xfs_defer_pending cache Darrick J. Wong
2024-02-29 23:26 ` Dave Chinner
2024-03-01 2:02 ` Kunwu Chan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240229083342.1128686-1-kunwu.chan@linux.dev \
--to=kunwu.chan@linux.dev \
--cc=chandan.babu@oracle.com \
--cc=chentao@kylinos.cn \
--cc=djwong@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.