mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-09 18:51:16 +00:00
btrfs-progs: update btrfs_del_ptr to match the kernel
The kernel version of btrfs_del_ptr takes a trans handle as an argument and returns an error in the case of tree-mod-log, update our version to match to make syncing ctree.c more straightforward. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
cc8904e8b5
commit
298eebd439
@ -3569,7 +3569,7 @@ static int repair_btree(struct btrfs_root *root,
|
||||
path.slots[level]);
|
||||
|
||||
/* Remove the ptr */
|
||||
btrfs_del_ptr(root, &path, level, path.slots[level]);
|
||||
btrfs_del_ptr(trans, root, &path, level, path.slots[level]);
|
||||
|
||||
/*
|
||||
* Remove the corresponding extent
|
||||
@ -7837,7 +7837,7 @@ again:
|
||||
|
||||
del_ptr:
|
||||
printk("deleting pointer to block %llu\n", corrupt->cache.start);
|
||||
btrfs_del_ptr(extent_root, &path, level, slot);
|
||||
btrfs_del_ptr(trans, extent_root, &path, level, slot);
|
||||
|
||||
out:
|
||||
btrfs_release_path(&path);
|
||||
|
@ -972,7 +972,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
|
||||
btrfs_clear_buffer_dirty(trans, right);
|
||||
free_extent_buffer(right);
|
||||
right = NULL;
|
||||
btrfs_del_ptr(root, path, level + 1, pslot + 1);
|
||||
btrfs_del_ptr(trans, root, path, level + 1, pslot + 1);
|
||||
|
||||
root_sub_used(root, blocksize);
|
||||
wret = btrfs_free_extent(trans, bytenr, blocksize, 0,
|
||||
@ -1017,7 +1017,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
|
||||
btrfs_clear_buffer_dirty(trans, mid);
|
||||
free_extent_buffer(mid);
|
||||
mid = NULL;
|
||||
btrfs_del_ptr(root, path, level + 1, pslot);
|
||||
btrfs_del_ptr(trans, root, path, level + 1, pslot);
|
||||
|
||||
root_sub_used(root, blocksize);
|
||||
wret = btrfs_free_extent(trans, bytenr, blocksize, 0,
|
||||
@ -2828,8 +2828,8 @@ 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.
|
||||
*/
|
||||
void btrfs_del_ptr(struct btrfs_root *root, struct btrfs_path *path,
|
||||
int level, int slot)
|
||||
int btrfs_del_ptr(struct btrfs_trans_handle *trans, struct btrfs_root *root,
|
||||
struct btrfs_path *path, int level, int slot)
|
||||
{
|
||||
struct extent_buffer *parent = path->nodes[level];
|
||||
u32 nritems;
|
||||
@ -2856,6 +2856,8 @@ void 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 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2876,7 +2878,7 @@ static noinline int btrfs_del_leaf(struct btrfs_trans_handle *trans,
|
||||
int ret;
|
||||
|
||||
WARN_ON(btrfs_header_generation(leaf) != trans->transid);
|
||||
btrfs_del_ptr(root, path, 1, path->slots[1]);
|
||||
btrfs_del_ptr(trans, root, path, 1, path->slots[1]);
|
||||
|
||||
root_sub_used(root, leaf->len);
|
||||
|
||||
|
@ -951,8 +951,8 @@ 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);
|
||||
void btrfs_del_ptr(struct btrfs_root *root, struct btrfs_path *path,
|
||||
int level, int slot);
|
||||
int btrfs_del_ptr(struct btrfs_trans_handle *trans, 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);
|
||||
int btrfs_previous_item(struct btrfs_root *root,
|
||||
|
Loading…
Reference in New Issue
Block a user