Commit ca5d2ba1 authored by Filipe Manana's avatar Filipe Manana Committed by David Sterba

Btrfs: remove unused key assignment when doing a full send

At send.c:full_send_tree() we were setting the 'key' variable in the loop
while never using it later. We were also using two btrfs_key variables
to store the initial key for search and the key found in every iteration
of the loop. So remove this useless key assignment and use the same
btrfs_key variable to store the initial search key and the key found in
each iteration. This was introduced in the initial send commit but was
never used (commit 31db9f7c ("Btrfs: introduce BTRFS_IOC_SEND for
btrfs send/receive").
Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 5cdc84bf
...@@ -6325,7 +6325,6 @@ static int full_send_tree(struct send_ctx *sctx) ...@@ -6325,7 +6325,6 @@ static int full_send_tree(struct send_ctx *sctx)
int ret; int ret;
struct btrfs_root *send_root = sctx->send_root; struct btrfs_root *send_root = sctx->send_root;
struct btrfs_key key; struct btrfs_key key;
struct btrfs_key found_key;
struct btrfs_path *path; struct btrfs_path *path;
struct extent_buffer *eb; struct extent_buffer *eb;
int slot; int slot;
...@@ -6347,17 +6346,13 @@ static int full_send_tree(struct send_ctx *sctx) ...@@ -6347,17 +6346,13 @@ static int full_send_tree(struct send_ctx *sctx)
while (1) { while (1) {
eb = path->nodes[0]; eb = path->nodes[0];
slot = path->slots[0]; slot = path->slots[0];
btrfs_item_key_to_cpu(eb, &found_key, slot); btrfs_item_key_to_cpu(eb, &key, slot);
ret = changed_cb(path, NULL, &found_key, ret = changed_cb(path, NULL, &key,
BTRFS_COMPARE_TREE_NEW, sctx); BTRFS_COMPARE_TREE_NEW, sctx);
if (ret < 0) if (ret < 0)
goto out; goto out;
key.objectid = found_key.objectid;
key.type = found_key.type;
key.offset = found_key.offset + 1;
ret = btrfs_next_item(send_root, path); ret = btrfs_next_item(send_root, path);
if (ret < 0) if (ret < 0)
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment