]> Pileus Git - ~andy/linux/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)
commit1ba0f1e7975ad07557f7a931522bdcd813ae35f6
tree9203d8f6b37c07e699194e981c5b3828f678252b
parent82a442d239695a242c4d584464c9606322cd02aa
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