mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-03 11:13:56 +08:00
svcrdma: Refactor svc_rdma_init() and svc_rdma_clean_up()
Setting up the proc variables is about to get more complicated. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
parent
20ad856e47
commit
59a00257c6
@ -224,27 +224,43 @@ static struct ctl_table svcrdma_root_table[] = {
|
|||||||
{ },
|
{ },
|
||||||
};
|
};
|
||||||
|
|
||||||
void svc_rdma_cleanup(void)
|
static void svc_rdma_proc_cleanup(void)
|
||||||
{
|
{
|
||||||
dprintk("SVCRDMA Module Removed, deregister RPC RDMA transport\n");
|
if (!svcrdma_table_header)
|
||||||
if (svcrdma_table_header) {
|
return;
|
||||||
unregister_sysctl_table(svcrdma_table_header);
|
unregister_sysctl_table(svcrdma_table_header);
|
||||||
svcrdma_table_header = NULL;
|
svcrdma_table_header = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int svc_rdma_proc_init(void)
|
||||||
|
{
|
||||||
|
if (svcrdma_table_header)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
svcrdma_table_header = register_sysctl_table(svcrdma_root_table);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void svc_rdma_cleanup(void)
|
||||||
|
{
|
||||||
|
dprintk("SVCRDMA Module Removed, deregister RPC RDMA transport\n");
|
||||||
svc_unreg_xprt_class(&svc_rdma_class);
|
svc_unreg_xprt_class(&svc_rdma_class);
|
||||||
|
svc_rdma_proc_cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
int svc_rdma_init(void)
|
int svc_rdma_init(void)
|
||||||
{
|
{
|
||||||
|
int rc;
|
||||||
|
|
||||||
dprintk("SVCRDMA Module Init, register RPC RDMA transport\n");
|
dprintk("SVCRDMA Module Init, register RPC RDMA transport\n");
|
||||||
dprintk("\tsvcrdma_ord : %d\n", svcrdma_ord);
|
dprintk("\tsvcrdma_ord : %d\n", svcrdma_ord);
|
||||||
dprintk("\tmax_requests : %u\n", svcrdma_max_requests);
|
dprintk("\tmax_requests : %u\n", svcrdma_max_requests);
|
||||||
dprintk("\tmax_bc_requests : %u\n", svcrdma_max_bc_requests);
|
dprintk("\tmax_bc_requests : %u\n", svcrdma_max_bc_requests);
|
||||||
dprintk("\tmax_inline : %d\n", svcrdma_max_req_size);
|
dprintk("\tmax_inline : %d\n", svcrdma_max_req_size);
|
||||||
|
|
||||||
if (!svcrdma_table_header)
|
rc = svc_rdma_proc_init();
|
||||||
svcrdma_table_header =
|
if (rc)
|
||||||
register_sysctl_table(svcrdma_root_table);
|
return rc;
|
||||||
|
|
||||||
/* Register RDMA with the SVC transport switch */
|
/* Register RDMA with the SVC transport switch */
|
||||||
svc_reg_xprt_class(&svc_rdma_class);
|
svc_reg_xprt_class(&svc_rdma_class);
|
||||||
|
Loading…
Reference in New Issue
Block a user