sunrpc: do not pin sunrpc module in the memory
authorDenis V. Lunev <den@openvz.org>
Thu, 31 Jul 2008 05:53:56 +0000 (09:53 +0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 7 Oct 2008 22:14:54 +0000 (18:14 -0400)
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: Denis V. Lunev <den@openvz.org>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
net/sunrpc/xprt.c

index 99a52aabe332a70d881a427dd1beba36e9d1d87a..29e401bb612ecf62edfa8f71a3e44f2583837b5c 100644 (file)
@@ -108,13 +108,10 @@ int xprt_register_transport(struct xprt_class *transport)
                        goto out;
        }
 
-       result = -EINVAL;
-       if (try_module_get(THIS_MODULE)) {
-               list_add_tail(&transport->list, &xprt_list);
-               printk(KERN_INFO "RPC: Registered %s transport module.\n",
-                       transport->name);
-               result = 0;
-       }
+       list_add_tail(&transport->list, &xprt_list);
+       printk(KERN_INFO "RPC: Registered %s transport module.\n",
+              transport->name);
+       result = 0;
 
 out:
        spin_unlock(&xprt_list_lock);
@@ -143,7 +140,6 @@ int xprt_unregister_transport(struct xprt_class *transport)
                                "RPC: Unregistered %s transport module.\n",
                                transport->name);
                        list_del_init(&transport->list);
-                       module_put(THIS_MODULE);
                        goto out;
                }
        }