]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd: make ImageCtx->object_map always present
authorJosh Durgin <jdurgin@redhat.com>
Tue, 24 Feb 2015 04:28:38 +0000 (20:28 -0800)
committerJosh Durgin <jdurgin@redhat.com>
Thu, 26 Feb 2015 01:27:33 +0000 (17:27 -0800)
commit6ac8139b258078568e52f01b1f4c0f4de62c4e94
treef80c37e0d2fdcf11018656b9e50427596a72cffe
parent04d360a4c1e7b29bafe4aa4a9e91e98360932d31
librbd: make ImageCtx->object_map always present

This simplifies locking by obviating the NULL checks.  We no longer
need md_lock to protect these acceses. We can use object_map_lock
instead, to make sure no one reads an object map while its being
updated.

Keep track of whether the object map is enabled for a given snapshot
internally. In each public method, check this state, and automatically
set it correctly when refreshing the object map. During snapshot
removal, unconditionally try to remove the object map object, to
protect against bugs leaking objects, and to be consistent with image
removal.

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
src/librbd/AioRequest.cc
src/librbd/AsyncResizeRequest.cc
src/librbd/AsyncTrimRequest.cc
src/librbd/CopyupRequest.cc
src/librbd/ImageCtx.cc
src/librbd/ImageCtx.h
src/librbd/ImageWatcher.cc
src/librbd/LibrbdWriteback.cc
src/librbd/ObjectMap.cc
src/librbd/ObjectMap.h
src/librbd/internal.cc