btrfs-progs: remove root argument from btrfs_truncate_item

This function lies in the kernel-shared directory and is supposed to be
close to 1:1 copy with its kernel counterpart, yet it takes one extra
argument - root. But this is now unused to simply remove it.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Nikolay Borisov 2021-09-14 12:05:54 +03:00 committed by David Sterba
parent c3584b4fc0
commit 97640a5b81
6 changed files with 8 additions and 10 deletions

View File

@ -2613,8 +2613,7 @@ split:
return ret;
}
int btrfs_truncate_item(struct btrfs_root *root, struct btrfs_path *path,
u32 new_size, int from_end)
int btrfs_truncate_item(struct btrfs_path *path, u32 new_size, int from_end)
{
int ret = 0;
int slot;

View File

@ -2677,8 +2677,7 @@ int btrfs_create_root(struct btrfs_trans_handle *trans,
struct btrfs_fs_info *fs_info, u64 objectid);
int btrfs_extend_item(struct btrfs_root *root, struct btrfs_path *path,
u32 data_size);
int btrfs_truncate_item(struct btrfs_root *root, struct btrfs_path *path,
u32 new_size, int from_end);
int btrfs_truncate_item(struct btrfs_path *path, u32 new_size, int from_end);
int btrfs_split_item(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
struct btrfs_path *path,

View File

@ -284,7 +284,7 @@ int btrfs_delete_one_dir_name(struct btrfs_trans_handle *trans,
start = btrfs_item_ptr_offset(leaf, path->slots[0]);
memmove_extent_buffer(leaf, ptr, ptr + sub_item_len,
item_len - (ptr + sub_item_len - start));
btrfs_truncate_item(root, path, item_len - sub_item_len, 1);
btrfs_truncate_item(path, item_len - sub_item_len, 1);
}
return ret;
}

View File

@ -1166,7 +1166,7 @@ static int update_inline_extent_backref(struct btrfs_trans_handle *trans,
memmove_extent_buffer(leaf, ptr, ptr + size,
end - ptr - size);
item_size -= size;
ret = btrfs_truncate_item(root, path, item_size, 1);
ret = btrfs_truncate_item(path, item_size, 1);
BUG_ON(ret);
}
btrfs_mark_buffer_dirty(leaf);

View File

@ -362,7 +362,7 @@ static noinline int truncate_one_csum(struct btrfs_root *root,
*/
u32 new_size = (bytenr - key->offset) / blocksize;
new_size *= csum_size;
ret = btrfs_truncate_item(root, path, new_size, 1);
ret = btrfs_truncate_item(path, new_size, 1);
BUG_ON(ret);
} else if (key->offset >= bytenr && csum_end > end_byte &&
end_byte > key->offset) {
@ -375,7 +375,7 @@ static noinline int truncate_one_csum(struct btrfs_root *root,
u32 new_size = (csum_end - end_byte) / blocksize;
new_size *= csum_size;
ret = btrfs_truncate_item(root, path, new_size, 0);
ret = btrfs_truncate_item(path, new_size, 0);
BUG_ON(ret);
key->offset = end_byte;

View File

@ -311,7 +311,7 @@ int btrfs_del_inode_extref(struct btrfs_trans_handle *trans,
memmove_extent_buffer(leaf, ptr, ptr + del_len,
item_size - (ptr + del_len - item_start));
btrfs_truncate_item(root, path, item_size - del_len, 1);
btrfs_truncate_item(path, item_size - del_len, 1);
out:
btrfs_free_path(path);
@ -432,7 +432,7 @@ int btrfs_del_inode_ref(struct btrfs_trans_handle *trans,
item_start = btrfs_item_ptr_offset(leaf, path->slots[0]);
memmove_extent_buffer(leaf, ptr, ptr + sub_item_len,
item_size - (ptr + sub_item_len - item_start));
btrfs_truncate_item(root, path, item_size - sub_item_len, 1);
btrfs_truncate_item(path, item_size - sub_item_len, 1);
btrfs_mark_buffer_dirty(path->nodes[0]);
out:
btrfs_free_path(path);