mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-28 17:12:17 +00:00
btrfs-progs: kernel-shared: use copy_extent_buffer_full where possible
We already have the helper for full extent buffer copy but don't use it everywhere. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
53b64cc366
commit
f094e35d63
@ -321,7 +321,7 @@ int btrfs_copy_root(struct btrfs_trans_handle *trans,
|
||||
return PTR_ERR(cow);
|
||||
}
|
||||
|
||||
copy_extent_buffer(cow, buf, 0, 0, cow->len);
|
||||
copy_extent_buffer_full(cow, buf);
|
||||
btrfs_set_header_bytenr(cow, cow->start);
|
||||
btrfs_set_header_generation(cow, trans->transid);
|
||||
btrfs_set_header_backref_rev(cow, BTRFS_MIXED_BACKREF_REV);
|
||||
@ -622,7 +622,7 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans,
|
||||
if (IS_ERR(cow))
|
||||
return PTR_ERR(cow);
|
||||
|
||||
copy_extent_buffer(cow, buf, 0, 0, cow->len);
|
||||
copy_extent_buffer_full(cow, buf);
|
||||
btrfs_set_header_bytenr(cow, cow->start);
|
||||
btrfs_set_header_generation(cow, trans->transid);
|
||||
btrfs_set_header_backref_rev(cow, BTRFS_MIXED_BACKREF_REV);
|
||||
|
@ -157,7 +157,7 @@ struct extent_buffer *btrfs_clone_extent_buffer(struct extent_buffer *src)
|
||||
if (!new)
|
||||
return NULL;
|
||||
|
||||
copy_extent_buffer(new, src, 0, 0, src->len);
|
||||
copy_extent_buffer_full(new, src);
|
||||
new->flags |= EXTENT_BUFFER_DUMMY;
|
||||
|
||||
return new;
|
||||
@ -615,6 +615,12 @@ void write_extent_buffer(const struct extent_buffer *eb, const void *src,
|
||||
memcpy((void *)eb->data + start, src, len);
|
||||
}
|
||||
|
||||
void copy_extent_buffer_full(const struct extent_buffer *dst,
|
||||
const struct extent_buffer *src)
|
||||
{
|
||||
copy_extent_buffer(dst, src, 0, 0, src->len);
|
||||
}
|
||||
|
||||
void copy_extent_buffer(const struct extent_buffer *dst,
|
||||
const struct extent_buffer *src,
|
||||
unsigned long dst_offset, unsigned long src_offset,
|
||||
@ -623,12 +629,6 @@ void copy_extent_buffer(const struct extent_buffer *dst,
|
||||
memcpy((void *)dst->data + dst_offset, src->data + src_offset, len);
|
||||
}
|
||||
|
||||
void copy_extent_buffer_full(const struct extent_buffer *dst,
|
||||
const struct extent_buffer *src)
|
||||
{
|
||||
copy_extent_buffer(dst, src, 0, 0, src->len);
|
||||
}
|
||||
|
||||
void memmove_extent_buffer(const struct extent_buffer *dst, unsigned long dst_offset,
|
||||
unsigned long src_offset, unsigned long len)
|
||||
{
|
||||
|
@ -111,12 +111,12 @@ void read_extent_buffer(const struct extent_buffer *eb, void *dst,
|
||||
unsigned long start, unsigned long len);
|
||||
void write_extent_buffer(const struct extent_buffer *eb, const void *src,
|
||||
unsigned long start, unsigned long len);
|
||||
void copy_extent_buffer_full(const struct extent_buffer *dst,
|
||||
const struct extent_buffer *src);
|
||||
void copy_extent_buffer(const struct extent_buffer *dst,
|
||||
const struct extent_buffer *src,
|
||||
unsigned long dst_offset, unsigned long src_offset,
|
||||
unsigned long len);
|
||||
void copy_extent_buffer_full(const struct extent_buffer *dst,
|
||||
const struct extent_buffer *src);
|
||||
void memmove_extent_buffer(const struct extent_buffer *dst,
|
||||
const unsigned long dst_offset,
|
||||
unsigned long src_offset, unsigned long len);
|
||||
|
Loading…
Reference in New Issue
Block a user