]> git.baikalelectronics.ru Git - kernel.git/commit
rbd: don't hold ctl_mutex to get/put device
authorAlex Elder <elder@inktank.com>
Fri, 31 May 2013 20:17:01 +0000 (15:17 -0500)
committerSage Weil <sage@inktank.com>
Wed, 3 Jul 2013 22:32:42 +0000 (15:32 -0700)
commite4859498a61f7d6f8e8160020533e731f5a7a76f
tree9203d8f6b37c07e699194e981c5b3828f678252b
parent64da5bf2fed69dcdaf0475306e38cdb726274a2b
rbd: don't hold ctl_mutex to get/put device

When an rbd device is first getting mapped, its device registration
is protected the control mutex.  There is no need to do that though,
because the device has already been assigned an id that's guaranteed
to be unique.

An unmap of an rbd device won't proceed if the device has a non-zero
open count or is already being unmapped.  So there's no need to hold
the control mutex in that case either.

Finally, an rbd device can't be opened if it is being removed, and
it won't go away if there is a non-zero open count.  So here too
there's no need to hold the control mutex while getting or putting a
reference to an rbd device's Linux device structure.

Drop the mutex calls in these cases.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
drivers/block/rbd.c