From 17a8c6d7e13b92f464b7a62a407182b8f2d98572 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Wed, 2 Nov 2016 14:59:07 +0100 Subject: [PATCH] btrfs-progs: send: cleanup use of ctransid delta temporary variable in find_good_parent Signed-off-by: David Sterba --- cmds-send.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmds-send.c b/cmds-send.c index 5e334cb..ad06d5b 100644 --- a/cmds-send.c +++ b/cmds-send.c @@ -101,7 +101,6 @@ static int find_good_parent(struct btrfs_send *sctx, u64 root_id, u64 *found) struct subvol_info *parent = NULL; struct subvol_info *parent2 = NULL; struct subvol_info *best_parent = NULL; - __s64 tmp; u64 best_diff = (u64)-1; int i; @@ -120,6 +119,8 @@ static int find_good_parent(struct btrfs_send *sctx, u64 root_id, u64 *found) } for (i = 0; i < sctx->clone_sources_count; i++) { + s64 tmp; + parent2 = get_parent(sctx, sctx->clone_sources[i]); if (!parent2) continue; @@ -142,7 +143,7 @@ static int find_good_parent(struct btrfs_send *sctx, u64 root_id, u64 *found) } tmp = parent2->ctransid - parent->ctransid; if (tmp < 0) - tmp *= -1; + tmp = -tmp; if (tmp < best_diff) { if (best_parent) { free(best_parent->path); -- 2.7.4