]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: communicate shard count to ObjectStore
authorSage Weil <sage@redhat.com>
Thu, 2 Jun 2016 20:19:04 +0000 (16:19 -0400)
committerSage Weil <sage@redhat.com>
Fri, 3 Jun 2016 19:00:06 +0000 (15:00 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/ObjectStore.h
src/osd/OSD.cc

index 6775189bab532cc42a2acdfc54bf160ec6e5999c..841fdff04ceed863ff81f49d354e63cc90db573a 100644 (file)
@@ -1871,6 +1871,8 @@ public:
     return -EOPNOTSUPP;
   }
 
+  virtual void set_cache_shards(unsigned num) { }
+
   /**
    * Returns 0 if the hobject is valid, -error otherwise
    *
index db015b0417dd5aa39166491791e2f1f4c9a71f0e..f76369118ebd8d8c47b4b9183f0ab8cdf527e410 100644 (file)
@@ -1482,6 +1482,8 @@ int OSD::mkfs(CephContext *cct, ObjectStore *store, const string &dev,
     goto free_store;
   }
 
+  store->set_cache_shards(g_conf->osd_op_num_shards);
+
   ret = store->mount();
   if (ret) {
     derr << "OSD::mkfs: couldn't mount ObjectStore: error " << ret << dendl;
@@ -2023,6 +2025,8 @@ int OSD::init()
          << (journal_path.empty() ? "(no journal)" : journal_path) << dendl;
   assert(store);  // call pre_init() first!
 
+  store->set_cache_shards(g_conf->osd_op_num_shards);
+
   int r = store->mount();
   if (r < 0) {
     derr << "OSD:init: unable to mount object store" << dendl;