Subject: [PATCH] tgt: use KMEM_CACHE
--- drivers/scsi/scsi_tgt_lib.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/scsi/scsi_tgt_lib.c +1 -3
@@ -641,9 +641,7 @@ static int __init scsi_tgt_init(void) {int err; - scsi_tgt_cmd_cache =kmem_cache_create ("scsi_tgt_cmd" , -sizeof (struct scsi_tgt_cmd ), -0 ,0 ,NULL ); + scsi_tgt_cmd_cache =KMEM_CACHE (scsi_tgt_cmd,0 );if (!scsi_tgt_cmd_cache)return -ENOMEM ;
Signature · 1 line
1.5.2.4
Quoted 10 lines · On Thu, 25 Oct 2007 01:21:29 +0900 FUJITA Tomonori <[email protected]> wrote:
Signed-off-by FUJITA Tomonori <[email protected]>--- drivers/scsi/scsi_tgt_lib.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)drivers/scsi/scsi_tgt_lib.c +0
-0
drivers/scsi/scsi_tgt_lib.c static int __init scsi_tgt_init(void) · line 645
Quoted 8 lines
drivers/scsi/scsi_tgt_lib.c +1
-3@@ -641,9 +641,7 @@ static int __init scsi_tgt_init(void) {int err; - scsi_tgt_cmd_cache =kmem_cache_create ("scsi_tgt_cmd" , -sizeof (struct scsi_tgt_cmd), -0 ,0 ,NULL ); + scsi_tgt_cmd_cache =KMEM_CACHE (scsi_tgt_cmd,0 );
Hi,
I have a question that is not described in your change log: why would you want to do this change? kmem_cache_create() is THE linux API to achieve this.... why would you not want to use it?? I'm sure you have a good reason for this change, but I can't figure out what that is from the changelog of your patch.
Greetings,
Arjan van de Ven
Quoted 13 lines · Arjan van de Ven
drivers/scsi/scsi_tgt_lib.c static int __init scsi_tgt_init(void) · line 644
Quoted 5 lines · On Thu, 25 Oct 2007 01:21:29 +0900 FUJITA Tomonori <[email protected]> wrote:
(quoted diff) +0
-2- scsi_tgt_cmd_cache = kmem_cache_create("scsi_tgt_cmd", - sizeof(struct
scsi_tgt_cmd),drivers/scsi/scsi_tgt_lib.c +1
-1- 0, 0, NULL); + scsi_tgt_cmd_cache =KMEM_CACHE (scsi_tgt_cmd,0 );I have a question that is not described in your change log: why would you want to do this change?
kmem_cache_create()is THE linux API to achieve this.... why would you not want to use it?? I'm sure you have a good reason for this change, but I can't figure out what that is from the changelog of your patch.
Looks like the preferred API was changed in May by clameter; see commit 0a31bd5f2bbb6473ef9d24f0063ca91cfa678b64
Signature · 4 lines
Intel are signing my paycheques ... these opinions are still mine "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step."
Quoted 15 lines · On Wed, 24 Oct 2007 21:25:24 -0600 Matthew Wilcox <[email protected]> wrote:
Quoted 13 lines · Arjan van de Ven
Review
Quoted 5 lines · On Thu, 25 Oct 2007 01:21:29 +0900 FUJITA Tomonori <[email protected]> wrote:
(quoted diff) +0
-2- scsi_tgt_cmd_cache = kmem_cache_create("scsi_tgt_cmd", - sizeof(struct
scsi_tgt_cmd),(quoted diff) +1
-1- 0, 0, NULL); + scsi_tgt_cmd_cache = KMEM_CACHE(scsi_tgt_cmd, 0);I have a question that is not described in your change log: why would you want to do this change?
kmem_cache_create()is THE linux API to achieve this.... why would you not want to use it?? I'm sure you have a good reason for this change, but I can't figure out what that is from the changelog of your patch.
Quoted 2 lines
Looks like the preferred API was changed in May by clameter; see commit
0a31bd5f2bbb6473ef9d24f0063ca91cfa678b64
Yeah, I just thought that it would be better use new KMEM_CACHE macro.
Here's a bit better changelog.
-
From: FUJITA Tomonori <[email protected]>
Subject: [PATCH] tgt: use KMEM_CACHE macro
This uses new KMEM_CACHE() macro instead of kmem_cache_create directly to simplify slab cache creation.
--- drivers/scsi/scsi_tgt_lib.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/scsi/scsi_tgt_lib.c +1 -3
@@ -640,9 +640,7 @@ static int __init scsi_tgt_init(void) {int err; - scsi_tgt_cmd_cache =kmem_cache_create ("scsi_tgt_cmd" , -sizeof (struct scsi_tgt_cmd ), -0 ,0 ,NULL ); + scsi_tgt_cmd_cache =KMEM_CACHE (scsi_tgt_cmd,0 );if (!scsi_tgt_cmd_cache)return -ENOMEM ;
Signature · 1 line
1.5.2.4