diff options
author | Filipe Manana <fdmanana@suse.com> | 2018-07-23 04:10:09 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-08-06 07:12:56 -0400 |
commit | ca5d2ba1ae2dfd651b798218d56c3277784fa499 (patch) | |
tree | 3b3a340395413502d9a3c5a2a374c1101adcd1b9 | |
parent | 5cdc84bfde22dc17b11ee7cb18cebd48f4a09f70 (diff) |
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 31db9f7c23fb ("Btrfs: introduce BTRFS_IOC_SEND for
btrfs send/receive").
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/send.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 6ff7a1315e52..42e04cd3cd95 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c | |||
@@ -6325,7 +6325,6 @@ static int full_send_tree(struct send_ctx *sctx) | |||
6325 | int ret; | 6325 | int ret; |
6326 | struct btrfs_root *send_root = sctx->send_root; | 6326 | struct btrfs_root *send_root = sctx->send_root; |
6327 | struct btrfs_key key; | 6327 | struct btrfs_key key; |
6328 | struct btrfs_key found_key; | ||
6329 | struct btrfs_path *path; | 6328 | struct btrfs_path *path; |
6330 | struct extent_buffer *eb; | 6329 | struct extent_buffer *eb; |
6331 | int slot; | 6330 | int slot; |
@@ -6347,17 +6346,13 @@ static int full_send_tree(struct send_ctx *sctx) | |||
6347 | while (1) { | 6346 | while (1) { |
6348 | eb = path->nodes[0]; | 6347 | eb = path->nodes[0]; |
6349 | slot = path->slots[0]; | 6348 | slot = path->slots[0]; |
6350 | btrfs_item_key_to_cpu(eb, &found_key, slot); | 6349 | btrfs_item_key_to_cpu(eb, &key, slot); |
6351 | 6350 | ||
6352 | ret = changed_cb(path, NULL, &found_key, | 6351 | ret = changed_cb(path, NULL, &key, |
6353 | BTRFS_COMPARE_TREE_NEW, sctx); | 6352 | BTRFS_COMPARE_TREE_NEW, sctx); |
6354 | if (ret < 0) | 6353 | if (ret < 0) |
6355 | goto out; | 6354 | goto out; |
6356 | 6355 | ||
6357 | key.objectid = found_key.objectid; | ||
6358 | key.type = found_key.type; | ||
6359 | key.offset = found_key.offset + 1; | ||
6360 | |||
6361 | ret = btrfs_next_item(send_root, path); | 6356 | ret = btrfs_next_item(send_root, path); |
6362 | if (ret < 0) | 6357 | if (ret < 0) |
6363 | goto out; | 6358 | goto out; |