diff mbox series

[21/26] btrfs-progs: make btrfs_del_ptr a void

Message ID 846c93398a45417a0f9cd0fb8e7bd8aeec2bfa93.1682799405.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: sync ctree.c into btrfs-progs | expand

Commit Message

Josef Bacik April 29, 2023, 8:19 p.m. UTC
This always returns 0, and in the kernel is a void.  Update the
definition to match the kernel and then update all of the callers.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 check/main.c          |  7 +++----
 kernel-shared/ctree.c | 16 ++++------------
 kernel-shared/ctree.h |  2 +-
 3 files changed, 8 insertions(+), 17 deletions(-)
diff mbox series

Patch

diff --git a/check/main.c b/check/main.c
index 5e4f5827..2643244f 100644
--- a/check/main.c
+++ b/check/main.c
@@ -3569,9 +3569,8 @@  static int repair_btree(struct btrfs_root *root,
 					     path.slots[level]);
 
 		/* Remove the ptr */
-		ret = btrfs_del_ptr(root, &path, level, path.slots[level]);
-		if (ret < 0)
-			goto out;
+		btrfs_del_ptr(root, &path, level, path.slots[level]);
+
 		/*
 		 * Remove the corresponding extent
 		 * return value is not concerned.
@@ -7829,7 +7828,7 @@  again:
 
 del_ptr:
 	printk("deleting pointer to block %llu\n", corrupt->cache.start);
-	ret = btrfs_del_ptr(extent_root, &path, level, slot);
+	btrfs_del_ptr(extent_root, &path, level, slot);
 
 out:
 	btrfs_release_path(&path);
diff --git a/kernel-shared/ctree.c b/kernel-shared/ctree.c
index 9cb58908..f9cf78da 100644
--- a/kernel-shared/ctree.c
+++ b/kernel-shared/ctree.c
@@ -685,9 +685,7 @@  static int balance_level(struct btrfs_trans_handle *trans,
 			btrfs_clear_buffer_dirty(trans, right);
 			free_extent_buffer(right);
 			right = NULL;
-			wret = btrfs_del_ptr(root, path, level + 1, pslot + 1);
-			if (wret)
-				ret = wret;
+			btrfs_del_ptr(root, path, level + 1, pslot + 1);
 
 			root_sub_used(root, blocksize);
 			wret = btrfs_free_extent(trans, bytenr, blocksize, 0,
@@ -732,9 +730,7 @@  static int balance_level(struct btrfs_trans_handle *trans,
 		btrfs_clear_buffer_dirty(trans, mid);
 		free_extent_buffer(mid);
 		mid = NULL;
-		wret = btrfs_del_ptr(root, path, level + 1, pslot);
-		if (wret)
-			ret = wret;
+		btrfs_del_ptr(root, path, level + 1, pslot);
 
 		root_sub_used(root, blocksize);
 		wret = btrfs_free_extent(trans, bytenr, blocksize, 0,
@@ -2557,12 +2553,11 @@  int btrfs_insert_item(struct btrfs_trans_handle *trans, struct btrfs_root
  * continuing all the way the root if required.  The root is converted into
  * a leaf if all the nodes are emptied.
  */
-int btrfs_del_ptr(struct btrfs_root *root, struct btrfs_path *path,
+void btrfs_del_ptr(struct btrfs_root *root, struct btrfs_path *path,
 		int level, int slot)
 {
 	struct extent_buffer *parent = path->nodes[level];
 	u32 nritems;
-	int ret = 0;
 
 	nritems = btrfs_header_nritems(parent);
 	if (slot < nritems - 1) {
@@ -2586,7 +2581,6 @@  int btrfs_del_ptr(struct btrfs_root *root, struct btrfs_path *path,
 		fixup_low_keys(path, &disk_key, level + 1);
 	}
 	btrfs_mark_buffer_dirty(parent);
-	return ret;
 }
 
 /*
@@ -2607,9 +2601,7 @@  static noinline int btrfs_del_leaf(struct btrfs_trans_handle *trans,
 	int ret;
 
 	WARN_ON(btrfs_header_generation(leaf) != trans->transid);
-	ret = btrfs_del_ptr(root, path, 1, path->slots[1]);
-	if (ret)
-		return ret;
+	btrfs_del_ptr(root, path, 1, path->slots[1]);
 
 	root_sub_used(root, leaf->len);
 
diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h
index 40b8854c..88a105ab 100644
--- a/kernel-shared/ctree.h
+++ b/kernel-shared/ctree.h
@@ -941,7 +941,7 @@  int btrfs_convert_one_bg(struct btrfs_trans_handle *trans, u64 bytenr);
 
 /* ctree.c */
 int btrfs_comp_cpu_keys(const struct btrfs_key *k1, const struct btrfs_key *k2);
-int btrfs_del_ptr(struct btrfs_root *root, struct btrfs_path *path,
+void btrfs_del_ptr(struct btrfs_root *root, struct btrfs_path *path,
 		int level, int slot);
 struct extent_buffer *btrfs_read_node_slot(struct extent_buffer *parent,
 					   int slot);