netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][IPVS] Relax the module get/put in ip_vs_app.c
@ 2007-11-19  9:58 Pavel Emelyanov
  2007-11-20  2:28 ` Simon Horman
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Emelyanov @ 2007-11-19  9:58 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List, devel

Both try_module_get/module_put already handle the module == NULL
case, so no need in manual checking.

This patch fits both net-2.6 and net-2.6.25.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---

diff --git a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c
index 664cb8e..535abe0 100644
--- a/net/ipv4/ipvs/ip_vs_app.c
+++ b/net/ipv4/ipvs/ip_vs_app.c
@@ -51,18 +51,13 @@ static DEFINE_MUTEX(__ip_vs_app_mutex);
  */
 static inline int ip_vs_app_get(struct ip_vs_app *app)
 {
-	/* test and get the module atomically */
-	if (app->module)
-		return try_module_get(app->module);
-	else
-		return 1;
+	return try_module_get(app->module);
 }
 
 
 static inline void ip_vs_app_put(struct ip_vs_app *app)
 {
-	if (app->module)
-		module_put(app->module);
+	module_put(app->module);
 }
 
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH][IPVS] Relax the module get/put in ip_vs_app.c
  2007-11-19  9:58 [PATCH][IPVS] Relax the module get/put in ip_vs_app.c Pavel Emelyanov
@ 2007-11-20  2:28 ` Simon Horman
  2007-11-20  6:53   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Horman @ 2007-11-20  2:28 UTC (permalink / raw)
  To: Pavel Emelyanov; +Cc: David Miller, Linux Netdev List, devel

On Mon, Nov 19, 2007 at 12:58:14PM +0300, Pavel Emelyanov wrote:
> Both try_module_get/module_put already handle the module == NULL
> case, so no need in manual checking.
> 
> This patch fits both net-2.6 and net-2.6.25.
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

Thanks, that looks fine to me.

Acked-by: Simon Horman <horms@verge.net.au>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][IPVS] Relax the module get/put in ip_vs_app.c
  2007-11-20  2:28 ` Simon Horman
@ 2007-11-20  6:53   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2007-11-20  6:53 UTC (permalink / raw)
  To: horms; +Cc: xemul, netdev, devel

From: Simon Horman <horms@verge.net.au>
Date: Tue, 20 Nov 2007 11:28:18 +0900

> On Mon, Nov 19, 2007 at 12:58:14PM +0300, Pavel Emelyanov wrote:
> > Both try_module_get/module_put already handle the module == NULL
> > case, so no need in manual checking.
> > 
> > This patch fits both net-2.6 and net-2.6.25.
> > 
> > Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
> 
> Thanks, that looks fine to me.
> 
> Acked-by: Simon Horman <horms@verge.net.au>

Me too, applied to net-2.6.25, thanks Pavel.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-11-20  6:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-19  9:58 [PATCH][IPVS] Relax the module get/put in ip_vs_app.c Pavel Emelyanov
2007-11-20  2:28 ` Simon Horman
2007-11-20  6:53   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).