netdev
[Top] [All Lists]

Re: [RFC][PATCH] identify in_dev_get rcu read-side critical sections

To: "Paul E. McKenney" <paulmck@xxxxxxxxxx>
Subject: Re: [RFC][PATCH] identify in_dev_get rcu read-side critical sections
From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 30 Sep 2005 11:19:07 +1000
Cc: Suzanne Wood <suzannew@xxxxxxxxxx>, Robert.Olsson@xxxxxxxxxxx, davem@xxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx, walpole@xxxxxxxxxx
In-reply-to: <20050930011603.GT8177@xxxxxxxxxx>
References: <200509292330.j8TNUSmH019572@xxxxxxxxxxxxxxxxxxx> <20050930002346.GP8177@xxxxxxxxxx> <20050930002719.GC21062@xxxxxxxxxxxxxxxxxxx> <20050930003642.GQ8177@xxxxxxxxxx> <20050930010404.GA21429@xxxxxxxxxxxxxxxxxxx> <20050930011603.GT8177@xxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.9i
On Thu, Sep 29, 2005 at 06:16:03PM -0700, Paul E. McKenney wrote:
> 
> OK, how about this instead?
> 
>       rcu_read_lock();
>       in_dev = dev->ip_ptr;
>       if (in_dev) {
>               atomic_inc(&rcu_dereference(in_dev)->refcnt);
>       }
>       rcu_read_unlock();
>       return in_dev;

Looks great.  Thanks Paul.
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

<Prev in Thread] Current Thread [Next in Thread>