From patchwork Wed Apr 4 21:12:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 10323421 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6F2EE60467 for ; Wed, 4 Apr 2018 21:22:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F6C229022 for ; Wed, 4 Apr 2018 21:22:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 541D429029; Wed, 4 Apr 2018 21:22:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=2.0 tests=BAYES_05, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0BC4429022 for ; Wed, 4 Apr 2018 21:22:15 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 03775225264A7; Wed, 4 Apr 2018 14:22:15 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.20; helo=mga02.intel.com; envelope-from=dan.j.williams@intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 96E5622526491 for ; Wed, 4 Apr 2018 14:22:13 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Apr 2018 14:22:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,408,1517904000"; d="scan'208";a="44110832" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by fmsmga001.fm.intel.com with ESMTP; 04 Apr 2018 14:22:11 -0700 Subject: [ndctl PATCH 4/5] ndctl: add new START and WAIT actions From: Dan Williams To: linux-nvdimm@lists.01.org Date: Wed, 04 Apr 2018 14:12:17 -0700 Message-ID: <152287633697.29230.7355050331429260998.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <152287631592.29230.11531789298631204393.stgit@dwillia2-desk3.amr.corp.intel.com> References: <152287631592.29230.11531789298631204393.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-2-gc94f MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP In preparation for adding 'start-scrub' and 'wait-scrub' utilities, define new device actions for these operations. Signed-off-by: Dan Williams --- ndctl/action.h | 2 ++ ndctl/namespace.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/ndctl/action.h b/ndctl/action.h index 43ea62adbcd2..1ecad49530d5 100644 --- a/ndctl/action.h +++ b/ndctl/action.h @@ -11,5 +11,7 @@ enum device_action { ACTION_CREATE, ACTION_DESTROY, ACTION_CHECK, + ACTION_WAIT, + ACTION_START, }; #endif /* __NDCTL_ACTION_H__ */ diff --git a/ndctl/namespace.c b/ndctl/namespace.c index aef356abbee1..1c39d9b01adc 100644 --- a/ndctl/namespace.c +++ b/ndctl/namespace.c @@ -1054,6 +1054,9 @@ static int do_xaction_namespace(const char *namespace, if (rc < 0) return rc; return 1; + default: + rc = -EINVAL; + break; } if (rc >= 0) success++;