From: Josh Durgin Date: Wed, 25 Feb 2015 02:49:26 +0000 (-0800) Subject: librbd: clarify md_lock usage X-Git-Tag: v0.93~6^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f4d8d16fbbb0a69c3bd8756e4096608294fccf9a;p=ceph.git librbd: clarify md_lock usage Signed-off-by: Josh Durgin --- diff --git a/src/librbd/ImageCtx.h b/src/librbd/ImageCtx.h index cb1d64d737bb..deca81d11b7b 100644 --- a/src/librbd/ImageCtx.h +++ b/src/librbd/ImageCtx.h @@ -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