btrfs: Remove unused arguments from btrfs_changed_cb_t
btrfs_changed_cb_t represents the signature of the callback being passed to btrfs_compare_trees. Currently there is only one such callback, namely changed_cb in send.c. This function doesn't really uses the first 2 parameters, i.e. the roots. Since there are not other functions implementing the btrfs_changed_cb_t let's remove the unused parameters from the prototype and implementation. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Reviewed-by: Josef Bacik <jbacik@fb.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
a0357511f2
commit
ee8c494f88
|
@ -5496,8 +5496,7 @@ int btrfs_compare_trees(struct btrfs_root *left_root,
|
||||||
goto out;
|
goto out;
|
||||||
} else if (left_end_reached) {
|
} else if (left_end_reached) {
|
||||||
if (right_level == 0) {
|
if (right_level == 0) {
|
||||||
ret = changed_cb(left_root, right_root,
|
ret = changed_cb(left_path, right_path,
|
||||||
left_path, right_path,
|
|
||||||
&right_key,
|
&right_key,
|
||||||
BTRFS_COMPARE_TREE_DELETED,
|
BTRFS_COMPARE_TREE_DELETED,
|
||||||
ctx);
|
ctx);
|
||||||
|
@ -5508,8 +5507,7 @@ int btrfs_compare_trees(struct btrfs_root *left_root,
|
||||||
continue;
|
continue;
|
||||||
} else if (right_end_reached) {
|
} else if (right_end_reached) {
|
||||||
if (left_level == 0) {
|
if (left_level == 0) {
|
||||||
ret = changed_cb(left_root, right_root,
|
ret = changed_cb(left_path, right_path,
|
||||||
left_path, right_path,
|
|
||||||
&left_key,
|
&left_key,
|
||||||
BTRFS_COMPARE_TREE_NEW,
|
BTRFS_COMPARE_TREE_NEW,
|
||||||
ctx);
|
ctx);
|
||||||
|
@ -5523,8 +5521,7 @@ int btrfs_compare_trees(struct btrfs_root *left_root,
|
||||||
if (left_level == 0 && right_level == 0) {
|
if (left_level == 0 && right_level == 0) {
|
||||||
cmp = btrfs_comp_cpu_keys(&left_key, &right_key);
|
cmp = btrfs_comp_cpu_keys(&left_key, &right_key);
|
||||||
if (cmp < 0) {
|
if (cmp < 0) {
|
||||||
ret = changed_cb(left_root, right_root,
|
ret = changed_cb(left_path, right_path,
|
||||||
left_path, right_path,
|
|
||||||
&left_key,
|
&left_key,
|
||||||
BTRFS_COMPARE_TREE_NEW,
|
BTRFS_COMPARE_TREE_NEW,
|
||||||
ctx);
|
ctx);
|
||||||
|
@ -5532,8 +5529,7 @@ int btrfs_compare_trees(struct btrfs_root *left_root,
|
||||||
goto out;
|
goto out;
|
||||||
advance_left = ADVANCE;
|
advance_left = ADVANCE;
|
||||||
} else if (cmp > 0) {
|
} else if (cmp > 0) {
|
||||||
ret = changed_cb(left_root, right_root,
|
ret = changed_cb(left_path, right_path,
|
||||||
left_path, right_path,
|
|
||||||
&right_key,
|
&right_key,
|
||||||
BTRFS_COMPARE_TREE_DELETED,
|
BTRFS_COMPARE_TREE_DELETED,
|
||||||
ctx);
|
ctx);
|
||||||
|
@ -5550,8 +5546,7 @@ int btrfs_compare_trees(struct btrfs_root *left_root,
|
||||||
result = BTRFS_COMPARE_TREE_CHANGED;
|
result = BTRFS_COMPARE_TREE_CHANGED;
|
||||||
else
|
else
|
||||||
result = BTRFS_COMPARE_TREE_SAME;
|
result = BTRFS_COMPARE_TREE_SAME;
|
||||||
ret = changed_cb(left_root, right_root,
|
ret = changed_cb(left_path, right_path,
|
||||||
left_path, right_path,
|
|
||||||
&left_key, result, ctx);
|
&left_key, result, ctx);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
@ -2821,9 +2821,7 @@ enum btrfs_compare_tree_result {
|
||||||
BTRFS_COMPARE_TREE_CHANGED,
|
BTRFS_COMPARE_TREE_CHANGED,
|
||||||
BTRFS_COMPARE_TREE_SAME,
|
BTRFS_COMPARE_TREE_SAME,
|
||||||
};
|
};
|
||||||
typedef int (*btrfs_changed_cb_t)(struct btrfs_root *left_root,
|
typedef int (*btrfs_changed_cb_t)(struct btrfs_path *left_path,
|
||||||
struct btrfs_root *right_root,
|
|
||||||
struct btrfs_path *left_path,
|
|
||||||
struct btrfs_path *right_path,
|
struct btrfs_path *right_path,
|
||||||
struct btrfs_key *key,
|
struct btrfs_key *key,
|
||||||
enum btrfs_compare_tree_result result,
|
enum btrfs_compare_tree_result result,
|
||||||
|
|
|
@ -6159,9 +6159,7 @@ out:
|
||||||
* Updates compare related fields in sctx and simply forwards to the actual
|
* Updates compare related fields in sctx and simply forwards to the actual
|
||||||
* changed_xxx functions.
|
* changed_xxx functions.
|
||||||
*/
|
*/
|
||||||
static int changed_cb(struct btrfs_root *left_root,
|
static int changed_cb(struct btrfs_path *left_path,
|
||||||
struct btrfs_root *right_root,
|
|
||||||
struct btrfs_path *left_path,
|
|
||||||
struct btrfs_path *right_path,
|
struct btrfs_path *right_path,
|
||||||
struct btrfs_key *key,
|
struct btrfs_key *key,
|
||||||
enum btrfs_compare_tree_result result,
|
enum btrfs_compare_tree_result result,
|
||||||
|
@ -6243,8 +6241,8 @@ static int full_send_tree(struct send_ctx *sctx)
|
||||||
slot = path->slots[0];
|
slot = path->slots[0];
|
||||||
btrfs_item_key_to_cpu(eb, &found_key, slot);
|
btrfs_item_key_to_cpu(eb, &found_key, slot);
|
||||||
|
|
||||||
ret = changed_cb(send_root, NULL, path, NULL,
|
ret = changed_cb(path, NULL, &found_key,
|
||||||
&found_key, BTRFS_COMPARE_TREE_NEW, sctx);
|
BTRFS_COMPARE_TREE_NEW, sctx);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue