From: Loic Dachary Date: Sun, 2 Feb 2014 09:04:48 +0000 (+0100) Subject: mon: compute the size of erasure-coded pools X-Git-Tag: v0.78~226^2~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8259e51d4649ea2da5ef5b646d0b1f29ad497e48;p=ceph.git mon: compute the size of erasure-coded pools It is K+M ( data chunks + coding chunks ) as returned by the get_chunk_count() method of the erasure code plugin. http://tracker.ceph.com/issues/7277 refs #7277 Reviewed-By: Christophe Courtaut Signed-off-by: Loic Dachary --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 54e2285f5c8e..60262ad0c87a 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -2801,6 +2801,14 @@ int OSDMonitor::prepare_pool_size(const unsigned pool_type, case pg_pool_t::TYPE_REPLICATED: *size = g_conf->osd_pool_default_size; break; + case pg_pool_t::TYPE_ERASURE: + { + ErasureCodeInterfaceRef erasure_code; + err = get_erasure_code(properties, &erasure_code, ss); + if (err == 0) + *size = erasure_code->get_chunk_count(); + } + break; default: ss << "prepare_pool_size: " << pool_type << " is not a known pool type"; err = -EINVAL;