]> git.karo-electronics.de Git - karo-tx-linux.git/commit
rbd: use rwsem to protect header updates
authorAlex Elder <elder@inktank.com>
Fri, 31 May 2013 22:40:45 +0000 (17:40 -0500)
committerSage Weil <sage@inktank.com>
Thu, 13 Jun 2013 15:46:27 +0000 (08:46 -0700)
commit4cd989fdc75241cd9c183ff3f9a2a384f0246ae1
tree3cb3e33d6e1b5703e65d891905c0f429f28ca3be
parent87f11b7221f72a1f5db9c00b170bda75c79c8d32
rbd: use rwsem to protect header updates

Updating an image header needs to be protected to ensure it's
done consistently.  However distinct headers can be updated
concurrently without a problem.  Instead of using the global
control lock to serialize headder updates, just rely on the header
semaphore.  (It's already used, this just moves it out to cover
a broader section of the code.)

That leaves the control mutex protecting only the creation of rbd
clients, so rename it.

This resolves:
    http://tracker.ceph.com/issues/5222

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