提交 c9f6cde6 编写于 作者: D Denis V. Lunev 提交者: Trond Myklebust

sunrpc: do not pin sunrpc module in the memory

Basically, try_module_get here are pretty useless. Any other module using
this API will pin sunrpc in memory due using exported symbols.
Signed-off-by: NDenis V. Lunev <den@openvz.org>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 fd08d7e9
...@@ -108,13 +108,10 @@ int xprt_register_transport(struct xprt_class *transport) ...@@ -108,13 +108,10 @@ int xprt_register_transport(struct xprt_class *transport)
goto out; goto out;
} }
result = -EINVAL; list_add_tail(&transport->list, &xprt_list);
if (try_module_get(THIS_MODULE)) { printk(KERN_INFO "RPC: Registered %s transport module.\n",
list_add_tail(&transport->list, &xprt_list); transport->name);
printk(KERN_INFO "RPC: Registered %s transport module.\n", result = 0;
transport->name);
result = 0;
}
out: out:
spin_unlock(&xprt_list_lock); spin_unlock(&xprt_list_lock);
...@@ -143,7 +140,6 @@ int xprt_unregister_transport(struct xprt_class *transport) ...@@ -143,7 +140,6 @@ int xprt_unregister_transport(struct xprt_class *transport)
"RPC: Unregistered %s transport module.\n", "RPC: Unregistered %s transport module.\n",
transport->name); transport->name);
list_del_init(&transport->list); list_del_init(&transport->list);
module_put(THIS_MODULE);
goto out; goto out;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册