public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Yongqiang Yang <xiaoqiangnk@gmail.com>
To: jack@suse.cz
Cc: linux-ext4@vger.kernel.org, Yongqiang Yang <xiaoqiangnk@gmail.com>
Subject: [PATCH 2/2] jbd: use KMEM_CACHE instead of kmem_cache_create
Date: Sun, 13 Nov 2011 19:29:32 +0800	[thread overview]
Message-ID: <1321183772-6181-2-git-send-email-xiaoqiangnk@gmail.com> (raw)
In-Reply-To: <1321183772-6181-1-git-send-email-xiaoqiangnk@gmail.com>

Let jbd use KMEM_CACHE instead of kmem_cache_create.

Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
---
 fs/jbd/journal.c |   12 ++----------
 fs/jbd/revoke.c  |   11 +++--------
 2 files changed, 5 insertions(+), 18 deletions(-)

diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
index 45ca982..b0ee518 100644
--- a/fs/jbd/journal.c
+++ b/fs/jbd/journal.c
@@ -1735,11 +1735,7 @@ static int journal_init_journal_head_cache(void)
 	int retval;
 
 	J_ASSERT(journal_head_cache == NULL);
-	journal_head_cache = kmem_cache_create("journal_head",
-				sizeof(struct journal_head),
-				0,		/* offset */
-				SLAB_TEMPORARY,	/* flags */
-				NULL);		/* ctor */
+	journal_head_cache = KMEM_CACHE(journal_head, SLAB_TEMPORARY);
 	retval = 0;
 	if (!journal_head_cache) {
 		retval = -ENOMEM;
@@ -1973,11 +1969,7 @@ struct kmem_cache *jbd_handle_cache;
 
 static int __init journal_init_handle_cache(void)
 {
-	jbd_handle_cache = kmem_cache_create("journal_handle",
-				sizeof(handle_t),
-				0,		/* offset */
-				SLAB_TEMPORARY,	/* flags */
-				NULL);		/* ctor */
+	jbd_handle_cache = KMEM_CACHE(handle_s, SLAB_TEMPORARY);
 	if (jbd_handle_cache == NULL) {
 		printk(KERN_EMERG "JBD: failed to create handle cache\n");
 		return -ENOMEM;
diff --git a/fs/jbd/revoke.c b/fs/jbd/revoke.c
index 305a907..034eb82 100644
--- a/fs/jbd/revoke.c
+++ b/fs/jbd/revoke.c
@@ -203,17 +203,12 @@ int __init journal_init_revoke_caches(void)
 	J_ASSERT(!revoke_record_cache);
 	J_ASSERT(!revoke_table_cache);
 
-	revoke_record_cache = kmem_cache_create("revoke_record",
-					   sizeof(struct jbd_revoke_record_s),
-					   0,
-					   SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY,
-					   NULL);
+	revoke_record_cache = KMEM_CACHE(jbd_revoke_record_s,
+					 SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY);
 	if (!revoke_record_cache)
 		goto record_cache_failure;
 
-	revoke_table_cache = kmem_cache_create("revoke_table",
-					   sizeof(struct jbd_revoke_table_s),
-					   0, SLAB_TEMPORARY, NULL);
+	revoke_table_cache = KMEM_CACHE(jbd_revoke_table_s, SLAB_TEMPORARY);
 	if (!revoke_table_cache)
 		goto table_cache_failure;
 
-- 
1.7.5.1


  reply	other threads:[~2011-11-13 13:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-13 11:29 [PATCH 1/2] jbd: allocate transacion from special cache Yongqiang Yang
2011-11-13 11:29 ` Yongqiang Yang [this message]
2011-11-14 12:53 ` Jan Kara
2011-11-14 15:22   ` Manish Katiyar
2011-11-14 15:35     ` Jan Kara

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=1321183772-6181-2-git-send-email-xiaoqiangnk@gmail.com \
    --to=xiaoqiangnk@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox