btrfs-progs: make btrfs_del_ptr a void

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>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Josef Bacik 2023-08-23 10:32:46 -04:00 committed by David Sterba
parent 0fa89a9da7
commit 5fa9f437e2
3 changed files with 8 additions and 17 deletions

View File

@ -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.
@ -7838,7 +7837,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);

View File

@ -970,9 +970,7 @@ static noinline 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,
@ -1017,9 +1015,7 @@ static noinline 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,
@ -2833,12 +2829,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) {
@ -2862,7 +2857,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;
}
/*
@ -2883,9 +2877,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);

View File

@ -948,7 +948,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);