[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4804C1D8.7000803@hp.com>
Date: Tue, 15 Apr 2008 10:55:20 -0400
From: Brian Haley <brian.haley@...com>
To: "Denis V. Lunev" <den@...nvz.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
containers@...ts.osdl.org, dlezcano@...ibm.com
Subject: Re: [PATCH 1/8 net-2.6.26] [NETNS]: Make netns refconting debug like
a socket one.
Denis V. Lunev wrote:
> +#ifdef NETNS_REFCNT_DEBUG
> static inline struct net *hold_net(struct net *net)
> {
> + if (net == NULL)
> + return NULL;
> + atomic_inc(&net->use_count);
> return net;
> }
This could be shrunk to:
if (net)
atomic_inc(&net->use_count);
return net;
> static inline void release_net(struct net *net)
> {
> + if (net == NULL)
> + return;
> + atomic_dec(&net->use_count);
> }
This one too:
if (net)
atomic_dec(&net->use_count);
-Brian
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists