[4/7] btrfs-progs: add helpers to print ranges
diff mbox

Message ID 92b7e8c34b35527a86ada1ac0f321cd05ab63d82.1444750808.git.dsterba@suse.com
State New
Headers show

Commit Message

David Sterba Oct. 13, 2015, 3:42 p.m. UTC
Signed-off-by: David Sterba <dsterba@suse.com>
---
 cmds-balance.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Patch
diff mbox

diff --git a/cmds-balance.c b/cmds-balance.c
index 72714b23b45c..dba6613b1540 100644
--- a/cmds-balance.c
+++ b/cmds-balance.c
@@ -190,6 +190,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;