Skip to contentSkip to conversation

sunrpc: do not pin sunrpc module in the memory

PATCH In review [email protected] 1 participant 1 message Sep 22, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/3 sunrpc: do not pin sunrpc module in the memory

From: "Denis V. Lunev" <[email protected]>

Basically, try_module_get here are pretty useless. Any other module using this API will pin sunrpc in memory due using exported symbols.

Cc Trond Myklebust <[email protected]>
Cc "J. Bruce Fields" <[email protected]>
Cc Chuck Lever <[email protected]>
Cc "David S. Miller" <[email protected]>

---

 net/sunrpc/xprt.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
net/sunrpc/xprt.c renamed from net/sunrpc/xprt.c~sunrpc-do-not-pin-sunrpc-module-in-the-memory +4 -8
diff -puN net/sunrpc/xprt.c~sunrpc-do-not-pin-sunrpc-module-in-the-memory net/sunrpc/xprt.c
@@ -108,13 +108,10 @@ int xprt_register_transport(struct xprt_
 			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 xpr
 				"RPC: Unregistered %s transport module.\n",
 				transport->name);
 			list_del_init(&transport->list);
-			module_put(THIS_MODULE);
 			goto out;
 		}
 	}

_