]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: clarify md_lock usage
authorJosh Durgin <jdurgin@redhat.com>
Wed, 25 Feb 2015 02:49:26 +0000 (18:49 -0800)
committerJosh Durgin <jdurgin@redhat.com>
Thu, 26 Feb 2015 01:27:34 +0000 (17:27 -0800)
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
src/librbd/ImageCtx.h

index cb1d64d737bb41f100429590ef26bce8903deceb..deca81d11b7b0455359657e5438c372b98cf2db8 100644 (file)
@@ -75,8 +75,14 @@ namespace librbd {
      */
     RWLock owner_lock; // protects exclusive lock leadership updates
     RWLock md_lock; // protects access to the mutable image metadata that
-                   // isn't guarded by other locks below
-                   // (flush_encountered, etc)
+                   // isn't guarded by other locks below, and blocks writes
+                   // when held exclusively, so snapshots can be consistent.
+                   // Fields guarded include:
+                   // flush_encountered
+                   // total_bytes_read
+                   // exclusive_locked
+                   // lock_tag
+                   // lockers
     Mutex cache_lock; // used as client_lock for the ObjectCacher
     RWLock snap_lock; // protects snapshot-related member variables, features, and flags
     RWLock parent_lock; // protects parent_md and parent