]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Objecter: add OSDMap accessors that are lock-safe
authorSage Weil <sage@redhat.com>
Sun, 20 Jul 2014 16:48:15 +0000 (09:48 -0700)
committerJohn Spray <john.spray@redhat.com>
Mon, 25 Aug 2014 00:34:00 +0000 (01:34 +0100)
Everybody needs to use these to inspect the OSDMap.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osdc/Objecter.h

index 07884c7269c1deb424fb5e6781e89bded112276f..00e767de015631c89cbe191daf1e5f04d97bd797 100644 (file)
@@ -1613,6 +1613,14 @@ public:
   void start();
   void shutdown();
 
+  const OSDMap *get_osdmap_read() {
+    rwlock.get_read();
+    return osdmap;
+  }
+  void put_osdmap_read() {
+    rwlock.put_read();
+  }
+
   /**
    * Tell the objecter to throttle outgoing ops according to its
    * budget (in _conf). If you do this, ops can block, in