lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1321183772-6181-2-git-send-email-xiaoqiangnk@gmail.com>
Date:	Sun, 13 Nov 2011 19:29:32 +0800
From:	Yongqiang Yang <xiaoqiangnk@...il.com>
To:	jack@...e.cz
Cc:	linux-ext4@...r.kernel.org, Yongqiang Yang <xiaoqiangnk@...il.com>
Subject: [PATCH 2/2] jbd: use KMEM_CACHE instead of kmem_cache_create

Let jbd use KMEM_CACHE instead of kmem_cache_create.

Signed-off-by: Yongqiang Yang <xiaoqiangnk@...il.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

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ