]> git.karo-electronics.de Git - karo-tx-linux.git/commit
idr: make idr_get_next() good for rcu_read_lock()
authorHugh Dickins <hughd@google.com>
Wed, 21 Mar 2012 23:34:20 +0000 (16:34 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 6 Mar 2013 03:24:16 +0000 (03:24 +0000)
commit6195dff3efda58746096daf01c3dbb74015dc0b5
tree7e80d36602d78ced512e3688779debd38abe4e4d
parent507b2ac935cfe53dbe3a61d61254154e4829c2e4
idr: make idr_get_next() good for rcu_read_lock()

commit 9f7de8275b46d9d11b1505adbfe6c2bb48df4741 upstream.

Make one small adjustment to idr_get_next(): take the height from the top
layer (stable under RCU) instead of from the root (unprotected by RCU), as
idr_find() does: so that it can be used with RCU locking.  Copied comment
on RCU locking from idr_find().

Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
lib/idr.c