From patchwork Wed Nov 25 12:08:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 7698531 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 98DF8BF90C for ; Wed, 25 Nov 2015 12:09:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AD04F208ED for ; Wed, 25 Nov 2015 12:09:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A438B2084C for ; Wed, 25 Nov 2015 12:09:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753578AbbKYMI5 (ORCPT ); Wed, 25 Nov 2015 07:08:57 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:20664 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753567AbbKYMIy (ORCPT ); Wed, 25 Nov 2015 07:08:54 -0500 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id tAPC8aqE014576 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 25 Nov 2015 12:08:36 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id tAPC8aw3025058 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 25 Nov 2015 12:08:36 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id tAPC8aGc016290; Wed, 25 Nov 2015 12:08:36 GMT Received: from arch2.sg.oracle.com (/10.186.101.159) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 25 Nov 2015 04:08:35 -0800 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.cz, calestyo@scientia.net, ahferroin7@gmail.com, 1i5t5.duncan@cox.net Subject: [PATCH 3/7] btrfs-progs: make is_numerical non static Date: Wed, 25 Nov 2015 20:08:16 +0800 Message-Id: <1448453300-8449-4-git-send-email-anand.jain@oracle.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1448453300-8449-1-git-send-email-anand.jain@oracle.com> References: <1448453300-8449-1-git-send-email-anand.jain@oracle.com> X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.5 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 Signed-off-by: Anand Jain --- cmds-replace.c | 11 ----------- utils.c | 11 +++++++++++ utils.h | 1 + 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/cmds-replace.c b/cmds-replace.c index 9ab8438..86162b6 100644 --- a/cmds-replace.c +++ b/cmds-replace.c @@ -65,17 +65,6 @@ static const char * const replace_cmd_group_usage[] = { NULL }; -static int is_numerical(const char *str) -{ - if (!(*str >= '0' && *str <= '9')) - return 0; - while (*str >= '0' && *str <= '9') - str++; - if (*str != '\0') - return 0; - return 1; -} - static int dev_replace_cancel_fd = -1; static void dev_replace_sigint_handler(int signal) { diff --git a/utils.c b/utils.c index 6d2675d..0e66e2b 100644 --- a/utils.c +++ b/utils.c @@ -178,6 +178,17 @@ int test_uuid_unique(char *fs_uuid) return unique; } +int is_numerical(const char *str) +{ + if (!(*str >= '0' && *str <= '9')) + return 0; + while (*str >= '0' && *str <= '9') + str++; + if (*str != '\0') + return 0; + return 1; +} + /* * @fs_uuid - if NULL, generates a UUID, returns back the new filesystem UUID */ diff --git a/utils.h b/utils.h index af0aa31..cb20d73 100644 --- a/utils.h +++ b/utils.h @@ -271,5 +271,6 @@ const char *get_argv0_buf(void); "-t|--tbytes show sizes in TiB, or TB with --si" unsigned int get_unit_mode_from_arg(int *argc, char *argv[], int df_mode); +int is_numerical(const char *str); #endif