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 <lihongfu@kylinos.cn> Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev> Reviewed-by: Allison Henderson <allison.henderson@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
382d1741b5
commit
9f1f70dd85
@ -719,9 +719,7 @@ static int __init rds_tcp_init(void)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
rds_tcp_conn_slab = kmem_cache_create("rds_tcp_connection",
|
rds_tcp_conn_slab = KMEM_CACHE(rds_tcp_connection, 0);
|
||||||
sizeof(struct rds_tcp_connection),
|
|
||||||
0, 0, NULL);
|
|
||||||
if (!rds_tcp_conn_slab) {
|
if (!rds_tcp_conn_slab) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -337,9 +337,7 @@ out:
|
|||||||
|
|
||||||
int rds_tcp_recv_init(void)
|
int rds_tcp_recv_init(void)
|
||||||
{
|
{
|
||||||
rds_tcp_incoming_slab = kmem_cache_create("rds_tcp_incoming",
|
rds_tcp_incoming_slab = KMEM_CACHE(rds_tcp_incoming, 0);
|
||||||
sizeof(struct rds_tcp_incoming),
|
|
||||||
0, 0, NULL);
|
|
||||||
if (!rds_tcp_incoming_slab)
|
if (!rds_tcp_incoming_slab)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user