diff options
author | David Sterba <dsterba@suse.com> | 2016-11-02 14:59:07 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-11-09 13:47:31 +0100 |
commit | 17a8c6d7e13b92f464b7a62a407182b8f2d98572 (patch) | |
tree | 4a07d790bf4ad5600ac6a17e6a3ede128951f278 /cmds-send.c | |
parent | 62fb1a5c14aeb77bda625047fdd3d0afa14d0514 (diff) |
btrfs-progs: send: cleanup use of ctransid delta temporary variable in find_good_parent
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-send.c')
-rw-r--r-- | cmds-send.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cmds-send.c b/cmds-send.c index 5e334cb9..ad06d5be 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); |