rbd: protect the rbd_dev_list with a spinlock
authorAlex Elder <elder@dreamhost.com>
Sun, 29 Jan 2012 19:57:44 +0000 (13:57 -0600)
committerAlex Elder <elder@dreamhost.com>
Thu, 22 Mar 2012 15:47:47 +0000 (10:47 -0500)
commite124a82f3c4efc2cc2bae68a2bf30020fb8c4fc2
tree9c1b768d2871b181bcc21d89bedf9bf9dbc6d998
parent1ddbe94eda58597cb6dd464b455cb62d3f68be7b
rbd: protect the rbd_dev_list with a spinlock

The rbd_dev_list is just a simple list of all the current
rbd_devices.  Using the ctl_mutex as a concurrency guard is
overkill.  Instead, use a spinlock for that specific purpose.

This also reduces the window that the ctl_mutex needs to be held in
rbd_add().

Signed-off-by: Alex Elder <elder@dreamhost.com>
Signed-off-by: Sage Weil <sage@newdream.net>
drivers/block/rbd.c