From patchwork Fri Oct 16 16:18:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 7418811 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 4EA8ABEEA4 for ; Fri, 16 Oct 2015 16:19:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8719020A00 for ; Fri, 16 Oct 2015 16:19:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8331020A02 for ; Fri, 16 Oct 2015 16:19:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932644AbbJPQTP (ORCPT ); Fri, 16 Oct 2015 12:19:15 -0400 Received: from mx2.suse.de ([195.135.220.15]:34582 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754378AbbJPQTO (ORCPT ); Fri, 16 Oct 2015 12:19:14 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8CE22AAC8 for ; Fri, 16 Oct 2015 16:19:12 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id B19C9DA8E4; Fri, 16 Oct 2015 18:18:02 +0200 (CEST) From: David Sterba To: linux-btrfs@vger.kernel.org Cc: David Sterba Subject: [PATCH 5/8] btrfs-progs: add helpers to print ranges Date: Fri, 16 Oct 2015 18:18:02 +0200 Message-Id: <62198ec2e23b520e08b0e81417c867cad510b75f.1445011409.git.dsterba@suse.com> X-Mailer: git-send-email 2.6.1 In-Reply-To: References: 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, T_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: David Sterba --- cmds-balance.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/cmds-balance.c b/cmds-balance.c index 457d693eec42..3166d7a73ba2 100644 --- a/cmds-balance.c +++ b/cmds-balance.c @@ -192,6 +192,25 @@ static int parse_range_u32(const char *range, u32 *start, u32 *end) return 0; } +__attribute__ ((unused)) +static void print_range(u64 start, u64 end) +{ + if (start) + printf("%llu", (unsigned long long)start); + printf(".."); + if (end != (u64)-1) + printf("%llu", (unsigned long long)end); +} + +static void print_range_u32(u32 start, u32 end) +{ + if (start) + printf("%u", start); + printf(".."); + if (end != (u32)-1) + printf("%u", end); +} + static int parse_filters(char *filters, struct btrfs_balance_args *args) { char *this_char;