]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: compute the size of erasure-coded pools
authorLoic Dachary <loic@dachary.org>
Sun, 2 Feb 2014 09:04:48 +0000 (10:04 +0100)
committerLoic Dachary <loic@dachary.org>
Tue, 4 Feb 2014 07:06:26 +0000 (08:06 +0100)
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 <christophe.courtaut@gmail.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
src/mon/OSDMonitor.cc

index 54e2285f5c8e3d5fe9a73f4ce709f3c52253d1b8..60262ad0c87a70d5fdd373b495bc05ec26b186bd 100644 (file)
@@ -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;