kernel - RB_SCAN() requires a short-term spinlock
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 29 Nov 2011 06:03:23 +0000 (22:03 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 29 Nov 2011 06:06:02 +0000 (22:06 -0800)
commit5f97768d56d8f4feadf9407630849bdd67cad2f1
treeccdfc4a7cfa9932580f5f5f8804e1a67cd312363
parent4fb294d7189541b3a6beb03f9c479dbce81abb40
kernel - RB_SCAN() requires a short-term spinlock

* RB_SCAN() links and unlinks an info structure.  If called with a shared
  lock the linking and unlinking operations requires a very short-term spin
  lock to avoid clobbering each other.

* Note that RB_REMOVE() scans the inprog list but this function can only
  be safely called with the RB tree held exclusively anyway, so there's
  no need to spinlock the info list.

* Add kern/subr_rbtree.c glue functions for acquiring and releasing the
  spinlock, so sys/tree.h only needs to include sys/spinlock.h and not
  also sys/spinlock2.h

Reported-by: sephe
sys/conf/files
sys/kern/subr_rbtree.c [new file with mode: 0644]
sys/sys/tree.h