From patchwork Mon Mar 21 07:21:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 8629821 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DB69C9F372 for ; Mon, 21 Mar 2016 07:21:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0994520272 for ; Mon, 21 Mar 2016 07:21:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EDFCD20270 for ; Mon, 21 Mar 2016 07:21:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752106AbcCUHVW (ORCPT ); Mon, 21 Mar 2016 03:21:22 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:20241 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751349AbcCUHVU (ORCPT ); Mon, 21 Mar 2016 03:21:20 -0400 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u2L7LGj8031766 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 21 Mar 2016 07:21:17 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u2L7LGOg031152 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 21 Mar 2016 07:21:16 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u2L7LFaW021410; Mon, 21 Mar 2016 07:21:15 GMT Received: from arch2.sg.oracle.com (/10.186.101.133) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 21 Mar 2016 00:21:15 -0700 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.cz Subject: [PATCH 1/6] btrfs-progs: spatial rearrange subvolume functions together Date: Mon, 21 Mar 2016 15:21:00 +0800 Message-Id: <1458544865-16467-2-git-send-email-anand.jain@oracle.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1458544865-16467-1-git-send-email-anand.jain@oracle.com> References: <1458137673-464-1-git-send-email-anand.jain@oracle.com> <1458544865-16467-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=-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 Signed-off-by: Anand Jain --- utils.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/utils.c b/utils.c index c0c564e2f69b..fb549ee923c7 100644 --- a/utils.c +++ b/utils.c @@ -2784,17 +2784,6 @@ int test_minimum_size(const char *file, u32 nodesize) return 0; } -/* - * test if name is a correct subvolume name - * this function return - * 0-> name is not a correct subvolume name - * 1-> name is a correct subvolume name - */ -int test_issubvolname(const char *name) -{ - return name[0] != '\0' && !strchr(name, '/') && - strcmp(name, ".") && strcmp(name, ".."); -} /* * Test if path is a directory @@ -3146,3 +3135,16 @@ void clean_args_no_options(int argc, char *argv[], const char * const *usagestr) } } } + +/* Subvolume helper functions */ +/* + * test if name is a correct subvolume name + * this function return + * 0-> name is not a correct subvolume name + * 1-> name is a correct subvolume name + */ +int test_issubvolname(const char *name) +{ + return name[0] != '\0' && !strchr(name, '/') && + strcmp(name, ".") && strcmp(name, ".."); +}