From patchwork Thu Jul 17 00:42:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ma, Jianpeng" X-Patchwork-Id: 4572251 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 124699F1D6 for ; Thu, 17 Jul 2014 00:42:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 31A402018A for ; Thu, 17 Jul 2014 00:42:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 344A72017D for ; Thu, 17 Jul 2014 00:42:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755189AbaGQAmY (ORCPT ); Wed, 16 Jul 2014 20:42:24 -0400 Received: from mga11.intel.com ([192.55.52.93]:25323 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754796AbaGQAmX convert rfc822-to-8bit (ORCPT ); Wed, 16 Jul 2014 20:42:23 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 16 Jul 2014 17:42:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,674,1400050800"; d="scan'208";a="562946525" Received: from fmsmsx106.amr.corp.intel.com ([10.19.9.37]) by fmsmga001.fm.intel.com with ESMTP; 16 Jul 2014 17:42:22 -0700 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by FMSMSX106.amr.corp.intel.com (10.19.9.37) with Microsoft SMTP Server (TLS) id 14.3.123.3; Wed, 16 Jul 2014 17:42:22 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx156.amr.corp.intel.com (10.18.116.74) with Microsoft SMTP Server (TLS) id 14.3.123.3; Wed, 16 Jul 2014 17:42:22 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.52]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.204]) with mapi id 14.03.0123.003; Thu, 17 Jul 2014 08:42:14 +0800 From: "Ma, Jianpeng" To: Samuel Just CC: "loic@dachary.org" , "ceph-devel@vger.kernel.org" Subject: [PATCH] mon: OSDMonitor: add "osd pool get erasure_code_profile" command Thread-Topic: [PATCH] mon: OSDMonitor: add "osd pool get erasure_code_profile" command Thread-Index: Ac+hVwI2f1tG+aK8RVqsad4b6NJvuA== Date: Thu, 17 Jul 2014 00:42:13 +0000 Message-ID: <6AA21C22F0A5DA478922644AD2EC308C893D76@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Enable us to obtain the erasure-code-profile for a given erasure-pool. Signed-off-by: Ma Jianpeng --- src/mon/MonCommands.h | 2 +- src/mon/OSDMonitor.cc | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h index f429e0f..627546b 100644 --- a/src/mon/MonCommands.h +++ b/src/mon/MonCommands.h @@ -571,7 +571,7 @@ COMMAND("osd pool rename " \ "rename to ", "osd", "rw", "cli,rest") COMMAND("osd pool get " \ "name=pool,type=CephPoolname " \ - "name=var,type=CephChoices,strings=size|min_size|crash_replay_interval|pg_num|pgp_num|crush_ruleset|hit_set_type|hit_set_period|hit_set_count|hit_set_fpp|auid|target_max_objects|target_max_bytes|cache_target_dirty_ratio|cache_target_full_ratio|cache_min_flush_age|cache_min_evict_age", \ + "name=var,type=CephChoices,strings=size|min_size|crash_replay_interval|pg_num|pgp_num|crush_ruleset|hit_set_type|hit_set_period|hit_set_count|hit_set_fpp|auid|target_max_objects|target_max_bytes|cache_target_dirty_ratio|cache_target_full_ratio|cache_min_flush_age|cache_min_evict_age|erasure_code_profile", \ "get pool parameter ", "osd", "r", "cli,rest") COMMAND("osd pool set " \ "name=pool,type=CephPoolname " \ diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index c60d744..d267245 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -2483,6 +2483,13 @@ bool OSDMonitor::preprocess_command(MMonCommand *m) goto reply; } + if (!p->is_erasure() && var == "erasure_code_profile") { + ss << "pool '" << poolstr + << "' is not a erasure pool: variable not applicable"; + r = -EACCES; + goto reply; + } + if (f) { f->open_object_section("pool"); f->dump_string("pool", poolstr); @@ -2536,6 +2543,8 @@ bool OSDMonitor::preprocess_command(MMonCommand *m) f->dump_unsigned("cache_min_flush_age", p->cache_min_flush_age); } else if (var == "cache_min_evict_age") { f->dump_unsigned("cache_min_evict_age", p->cache_min_evict_age); + } else if (var == "erasure_code_profile") { + f->dump_string("erasure_code_profile", p->erasure_code_profile); } f->close_section(); @@ -2583,6 +2592,8 @@ bool OSDMonitor::preprocess_command(MMonCommand *m) ss << "cache_min_flush_age: " << p->cache_min_flush_age; } else if (var == "cache_min_evict_age") { ss << "cache_min_evict_age: " << p->cache_min_evict_age; + } else if (var == "erasure_code_profile") { + ss << "erasure_code_profile: " << p->erasure_code_profile; } rdata.append(ss);