From: Sage Weil Date: Thu, 2 Jun 2016 20:19:04 +0000 (-0400) Subject: osd: communicate shard count to ObjectStore X-Git-Tag: v11.0.0~302^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=07094ca0082a50eeb3f7138c6bc10d1a968c4bae;p=ceph.git osd: communicate shard count to ObjectStore Signed-off-by: Sage Weil --- diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index 6775189bab53..841fdff04cee 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -1871,6 +1871,8 @@ public: return -EOPNOTSUPP; } + virtual void set_cache_shards(unsigned num) { } + /** * Returns 0 if the hobject is valid, -error otherwise * diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index db015b0417dd..f76369118ebd 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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;