Browse Source

btrfs: Remove unused parameters from various functions

iterate_dir_item:found_key - introduced in 31db9f7c23fb ("Btrfs:
  introduce BTRFS_IOC_SEND for btrfs send/receive"), yet never used.

record_ref:num - ditto

This is a first pass with the low-hanging fruit. There are still quite a
few unsued parameters in some function which have to abide by a callback
interface.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Nikolay Borisov 8 years ago
parent
commit
a0357511f2
1 changed files with 11 additions and 14 deletions
  1. 11 14
      fs/btrfs/send.c

+ 11 - 14
fs/btrfs/send.c

@@ -992,7 +992,6 @@ typedef int (*iterate_dir_item_t)(int num, struct btrfs_key *di_key,
  * path must point to the dir item when called.
  * path must point to the dir item when called.
  */
  */
 static int iterate_dir_item(struct btrfs_root *root, struct btrfs_path *path,
 static int iterate_dir_item(struct btrfs_root *root, struct btrfs_path *path,
-			    struct btrfs_key *found_key,
 			    iterate_dir_item_t iterate, void *ctx)
 			    iterate_dir_item_t iterate, void *ctx)
 {
 {
 	int ret = 0;
 	int ret = 0;
@@ -4106,8 +4105,8 @@ out:
 	return ret;
 	return ret;
 }
 }
 
 
-static int record_ref(struct btrfs_root *root, int num, u64 dir, int index,
-		      struct fs_path *name, void *ctx, struct list_head *refs)
+static int record_ref(struct btrfs_root *root, u64 dir, struct fs_path *name,
+		      void *ctx, struct list_head *refs)
 {
 {
 	int ret = 0;
 	int ret = 0;
 	struct send_ctx *sctx = ctx;
 	struct send_ctx *sctx = ctx;
@@ -4143,8 +4142,7 @@ static int __record_new_ref(int num, u64 dir, int index,
 			    void *ctx)
 			    void *ctx)
 {
 {
 	struct send_ctx *sctx = ctx;
 	struct send_ctx *sctx = ctx;
-	return record_ref(sctx->send_root, num, dir, index, name,
-			  ctx, &sctx->new_refs);
+	return record_ref(sctx->send_root, dir, name, ctx, &sctx->new_refs);
 }
 }
 
 
 
 
@@ -4153,8 +4151,8 @@ static int __record_deleted_ref(int num, u64 dir, int index,
 				void *ctx)
 				void *ctx)
 {
 {
 	struct send_ctx *sctx = ctx;
 	struct send_ctx *sctx = ctx;
-	return record_ref(sctx->parent_root, num, dir, index, name,
-			  ctx, &sctx->deleted_refs);
+	return record_ref(sctx->parent_root, dir, name, ctx,
+			  &sctx->deleted_refs);
 }
 }
 
 
 static int record_new_ref(struct send_ctx *sctx)
 static int record_new_ref(struct send_ctx *sctx)
@@ -4498,7 +4496,7 @@ static int process_new_xattr(struct send_ctx *sctx)
 	int ret = 0;
 	int ret = 0;
 
 
 	ret = iterate_dir_item(sctx->send_root, sctx->left_path,
 	ret = iterate_dir_item(sctx->send_root, sctx->left_path,
-			       sctx->cmp_key, __process_new_xattr, sctx);
+			       __process_new_xattr, sctx);
 
 
 	return ret;
 	return ret;
 }
 }
@@ -4506,7 +4504,7 @@ static int process_new_xattr(struct send_ctx *sctx)
 static int process_deleted_xattr(struct send_ctx *sctx)
 static int process_deleted_xattr(struct send_ctx *sctx)
 {
 {
 	return iterate_dir_item(sctx->parent_root, sctx->right_path,
 	return iterate_dir_item(sctx->parent_root, sctx->right_path,
-				sctx->cmp_key, __process_deleted_xattr, sctx);
+				__process_deleted_xattr, sctx);
 }
 }
 
 
 struct find_xattr_ctx {
 struct find_xattr_ctx {
@@ -4551,7 +4549,7 @@ static int find_xattr(struct btrfs_root *root,
 	ctx.found_data = NULL;
 	ctx.found_data = NULL;
 	ctx.found_data_len = 0;
 	ctx.found_data_len = 0;
 
 
-	ret = iterate_dir_item(root, path, key, __find_xattr, &ctx);
+	ret = iterate_dir_item(root, path, __find_xattr, &ctx);
 	if (ret < 0)
 	if (ret < 0)
 		return ret;
 		return ret;
 
 
@@ -4621,11 +4619,11 @@ static int process_changed_xattr(struct send_ctx *sctx)
 	int ret = 0;
 	int ret = 0;
 
 
 	ret = iterate_dir_item(sctx->send_root, sctx->left_path,
 	ret = iterate_dir_item(sctx->send_root, sctx->left_path,
-			sctx->cmp_key, __process_changed_new_xattr, sctx);
+			__process_changed_new_xattr, sctx);
 	if (ret < 0)
 	if (ret < 0)
 		goto out;
 		goto out;
 	ret = iterate_dir_item(sctx->parent_root, sctx->right_path,
 	ret = iterate_dir_item(sctx->parent_root, sctx->right_path,
-			sctx->cmp_key, __process_changed_deleted_xattr, sctx);
+			__process_changed_deleted_xattr, sctx);
 
 
 out:
 out:
 	return ret;
 	return ret;
@@ -4675,8 +4673,7 @@ static int process_all_new_xattrs(struct send_ctx *sctx)
 			goto out;
 			goto out;
 		}
 		}
 
 
-		ret = iterate_dir_item(root, path, &found_key,
-				       __process_new_xattr, sctx);
+		ret = iterate_dir_item(root, path, __process_new_xattr, sctx);
 		if (ret < 0)
 		if (ret < 0)
 			goto out;
 			goto out;