]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd: use snap_lock to protect ImageCtx->flags
authorJosh Durgin <jdurgin@redhat.com>
Tue, 24 Feb 2015 03:49:12 +0000 (19:49 -0800)
committerJosh Durgin <jdurgin@redhat.com>
Wed, 25 Feb 2015 23:42:31 +0000 (15:42 -0800)
commit40c2abb08a8d2cbf43c3facbe10252138173b498
tree813cd2374e4a192852ea10895a8b09d7697a623c
parentbb4041fc956f2e83c2deef0e89e8286707bc9f30
librbd: use snap_lock to protect ImageCtx->flags

This is another step towards eliminating md_lock from the writeback
path. Almost all the places that use ImageCtx->flags already use
snap_lock, so there's no need to create a new lock. For the others,
add a helper, test_flags() that acquires the lock, similar to
test_features().

This also makes sure we look up flags of the snapshot we're operating
on, instead of those for head.

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
src/librbd/ImageCtx.cc
src/librbd/ImageCtx.h
src/librbd/ObjectMap.cc
src/librbd/internal.cc