Skip to content

Commit 9f1f70d

Browse files
Hongfu Lidavem330
authored andcommitted
rds:Simplify the allocation of slab caches
Use the new KMEM_CACHE() macro instead of direct kmem_cache_create to simplify the creation of SLAB caches. Signed-off-by: Hongfu Li <[email protected]> Reviewed-by: Zhu Yanjun <[email protected]> Reviewed-by: Allison Henderson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 382d174 commit 9f1f70d

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

net/rds/tcp.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -719,9 +719,7 @@ static int __init rds_tcp_init(void)
719719
{
720720
int ret;
721721

722-
rds_tcp_conn_slab = kmem_cache_create("rds_tcp_connection",
723-
sizeof(struct rds_tcp_connection),
724-
0, 0, NULL);
722+
rds_tcp_conn_slab = KMEM_CACHE(rds_tcp_connection, 0);
725723
if (!rds_tcp_conn_slab) {
726724
ret = -ENOMEM;
727725
goto out;

net/rds/tcp_recv.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,7 @@ void rds_tcp_data_ready(struct sock *sk)
337337

338338
int rds_tcp_recv_init(void)
339339
{
340-
rds_tcp_incoming_slab = kmem_cache_create("rds_tcp_incoming",
341-
sizeof(struct rds_tcp_incoming),
342-
0, 0, NULL);
340+
rds_tcp_incoming_slab = KMEM_CACHE(rds_tcp_incoming, 0);
343341
if (!rds_tcp_incoming_slab)
344342
return -ENOMEM;
345343
return 0;

0 commit comments

Comments
 (0)