Loading fs/btrfs/ctree.c +1 −2 Original line number Original line Diff line number Diff line Loading @@ -4541,8 +4541,7 @@ int btrfs_duplicate_item(struct btrfs_trans_handle *trans, * off the end of the item or if we shift the item to chop bytes off * off the end of the item or if we shift the item to chop bytes off * the front. * the front. */ */ void btrfs_truncate_item(struct btrfs_fs_info *fs_info, void btrfs_truncate_item(struct btrfs_path *path, u32 new_size, int from_end) struct btrfs_path *path, u32 new_size, int from_end) { { int slot; int slot; struct extent_buffer *leaf; struct extent_buffer *leaf; Loading fs/btrfs/ctree.h +1 −2 Original line number Original line Diff line number Diff line Loading @@ -2932,8 +2932,7 @@ int btrfs_block_can_be_shared(struct btrfs_root *root, struct extent_buffer *buf); struct extent_buffer *buf); void btrfs_extend_item(struct btrfs_fs_info *fs_info, struct btrfs_path *path, void btrfs_extend_item(struct btrfs_fs_info *fs_info, struct btrfs_path *path, u32 data_size); u32 data_size); void btrfs_truncate_item(struct btrfs_fs_info *fs_info, void btrfs_truncate_item(struct btrfs_path *path, u32 new_size, int from_end); struct btrfs_path *path, u32 new_size, int from_end); int btrfs_split_item(struct btrfs_trans_handle *trans, int btrfs_split_item(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_root *root, struct btrfs_path *path, struct btrfs_path *path, Loading fs/btrfs/dir-item.c +1 −2 Original line number Original line Diff line number Diff line Loading @@ -429,8 +429,7 @@ int btrfs_delete_one_dir_name(struct btrfs_trans_handle *trans, start = btrfs_item_ptr_offset(leaf, path->slots[0]); start = btrfs_item_ptr_offset(leaf, path->slots[0]); memmove_extent_buffer(leaf, ptr, ptr + sub_item_len, memmove_extent_buffer(leaf, ptr, ptr + sub_item_len, item_len - (ptr + sub_item_len - start)); item_len - (ptr + sub_item_len - start)); btrfs_truncate_item(root->fs_info, path, btrfs_truncate_item(path, item_len - sub_item_len, 1); item_len - sub_item_len, 1); } } return ret; return ret; } } fs/btrfs/extent-tree.c +1 −2 Original line number Original line Diff line number Diff line Loading @@ -1780,7 +1780,6 @@ void update_inline_extent_backref(struct btrfs_path *path, int *last_ref) int *last_ref) { { struct extent_buffer *leaf = path->nodes[0]; struct extent_buffer *leaf = path->nodes[0]; struct btrfs_fs_info *fs_info = leaf->fs_info; struct btrfs_extent_item *ei; struct btrfs_extent_item *ei; struct btrfs_extent_data_ref *dref = NULL; struct btrfs_extent_data_ref *dref = NULL; struct btrfs_shared_data_ref *sref = NULL; struct btrfs_shared_data_ref *sref = NULL; Loading Loading @@ -1835,7 +1834,7 @@ void update_inline_extent_backref(struct btrfs_path *path, memmove_extent_buffer(leaf, ptr, ptr + size, memmove_extent_buffer(leaf, ptr, ptr + size, end - ptr - size); end - ptr - size); item_size -= size; item_size -= size; btrfs_truncate_item(fs_info, path, item_size, 1); btrfs_truncate_item(path, item_size, 1); } } btrfs_mark_buffer_dirty(leaf); btrfs_mark_buffer_dirty(leaf); } } Loading fs/btrfs/file-item.c +2 −2 Original line number Original line Diff line number Diff line Loading @@ -547,7 +547,7 @@ static noinline void truncate_one_csum(struct btrfs_fs_info *fs_info, */ */ u32 new_size = (bytenr - key->offset) >> blocksize_bits; u32 new_size = (bytenr - key->offset) >> blocksize_bits; new_size *= csum_size; new_size *= csum_size; btrfs_truncate_item(fs_info, path, new_size, 1); btrfs_truncate_item(path, new_size, 1); } else if (key->offset >= bytenr && csum_end > end_byte && } else if (key->offset >= bytenr && csum_end > end_byte && end_byte > key->offset) { end_byte > key->offset) { /* /* Loading @@ -559,7 +559,7 @@ static noinline void truncate_one_csum(struct btrfs_fs_info *fs_info, u32 new_size = (csum_end - end_byte) >> blocksize_bits; u32 new_size = (csum_end - end_byte) >> blocksize_bits; new_size *= csum_size; new_size *= csum_size; btrfs_truncate_item(fs_info, path, new_size, 0); btrfs_truncate_item(path, new_size, 0); key->offset = end_byte; key->offset = end_byte; btrfs_set_item_key_safe(fs_info, path, key); btrfs_set_item_key_safe(fs_info, path, key); Loading Loading
fs/btrfs/ctree.c +1 −2 Original line number Original line Diff line number Diff line Loading @@ -4541,8 +4541,7 @@ int btrfs_duplicate_item(struct btrfs_trans_handle *trans, * off the end of the item or if we shift the item to chop bytes off * off the end of the item or if we shift the item to chop bytes off * the front. * the front. */ */ void btrfs_truncate_item(struct btrfs_fs_info *fs_info, void btrfs_truncate_item(struct btrfs_path *path, u32 new_size, int from_end) struct btrfs_path *path, u32 new_size, int from_end) { { int slot; int slot; struct extent_buffer *leaf; struct extent_buffer *leaf; Loading
fs/btrfs/ctree.h +1 −2 Original line number Original line Diff line number Diff line Loading @@ -2932,8 +2932,7 @@ int btrfs_block_can_be_shared(struct btrfs_root *root, struct extent_buffer *buf); struct extent_buffer *buf); void btrfs_extend_item(struct btrfs_fs_info *fs_info, struct btrfs_path *path, void btrfs_extend_item(struct btrfs_fs_info *fs_info, struct btrfs_path *path, u32 data_size); u32 data_size); void btrfs_truncate_item(struct btrfs_fs_info *fs_info, void btrfs_truncate_item(struct btrfs_path *path, u32 new_size, int from_end); struct btrfs_path *path, u32 new_size, int from_end); int btrfs_split_item(struct btrfs_trans_handle *trans, int btrfs_split_item(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_root *root, struct btrfs_path *path, struct btrfs_path *path, Loading
fs/btrfs/dir-item.c +1 −2 Original line number Original line Diff line number Diff line Loading @@ -429,8 +429,7 @@ int btrfs_delete_one_dir_name(struct btrfs_trans_handle *trans, start = btrfs_item_ptr_offset(leaf, path->slots[0]); start = btrfs_item_ptr_offset(leaf, path->slots[0]); memmove_extent_buffer(leaf, ptr, ptr + sub_item_len, memmove_extent_buffer(leaf, ptr, ptr + sub_item_len, item_len - (ptr + sub_item_len - start)); item_len - (ptr + sub_item_len - start)); btrfs_truncate_item(root->fs_info, path, btrfs_truncate_item(path, item_len - sub_item_len, 1); item_len - sub_item_len, 1); } } return ret; return ret; } }
fs/btrfs/extent-tree.c +1 −2 Original line number Original line Diff line number Diff line Loading @@ -1780,7 +1780,6 @@ void update_inline_extent_backref(struct btrfs_path *path, int *last_ref) int *last_ref) { { struct extent_buffer *leaf = path->nodes[0]; struct extent_buffer *leaf = path->nodes[0]; struct btrfs_fs_info *fs_info = leaf->fs_info; struct btrfs_extent_item *ei; struct btrfs_extent_item *ei; struct btrfs_extent_data_ref *dref = NULL; struct btrfs_extent_data_ref *dref = NULL; struct btrfs_shared_data_ref *sref = NULL; struct btrfs_shared_data_ref *sref = NULL; Loading Loading @@ -1835,7 +1834,7 @@ void update_inline_extent_backref(struct btrfs_path *path, memmove_extent_buffer(leaf, ptr, ptr + size, memmove_extent_buffer(leaf, ptr, ptr + size, end - ptr - size); end - ptr - size); item_size -= size; item_size -= size; btrfs_truncate_item(fs_info, path, item_size, 1); btrfs_truncate_item(path, item_size, 1); } } btrfs_mark_buffer_dirty(leaf); btrfs_mark_buffer_dirty(leaf); } } Loading
fs/btrfs/file-item.c +2 −2 Original line number Original line Diff line number Diff line Loading @@ -547,7 +547,7 @@ static noinline void truncate_one_csum(struct btrfs_fs_info *fs_info, */ */ u32 new_size = (bytenr - key->offset) >> blocksize_bits; u32 new_size = (bytenr - key->offset) >> blocksize_bits; new_size *= csum_size; new_size *= csum_size; btrfs_truncate_item(fs_info, path, new_size, 1); btrfs_truncate_item(path, new_size, 1); } else if (key->offset >= bytenr && csum_end > end_byte && } else if (key->offset >= bytenr && csum_end > end_byte && end_byte > key->offset) { end_byte > key->offset) { /* /* Loading @@ -559,7 +559,7 @@ static noinline void truncate_one_csum(struct btrfs_fs_info *fs_info, u32 new_size = (csum_end - end_byte) >> blocksize_bits; u32 new_size = (csum_end - end_byte) >> blocksize_bits; new_size *= csum_size; new_size *= csum_size; btrfs_truncate_item(fs_info, path, new_size, 0); btrfs_truncate_item(path, new_size, 0); key->offset = end_byte; key->offset = end_byte; btrfs_set_item_key_safe(fs_info, path, key); btrfs_set_item_key_safe(fs_info, path, key); Loading