btrfs: add optimized version of eb to eb copy
Using copy_extent_buffer is suitable for copying betwenn buffers from an arbitrary offset and deals with page boundaries. This is not necessary when doing a full extent_buffer-to-extent_buffer copy. We can utilize the copy_page helper as well. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
@@ -5546,6 +5546,20 @@ void memzero_extent_buffer(struct extent_buffer *eb, unsigned long start,
|
||||
}
|
||||
}
|
||||
|
||||
void copy_extent_buffer_full(struct extent_buffer *dst,
|
||||
struct extent_buffer *src)
|
||||
{
|
||||
int i;
|
||||
unsigned num_pages;
|
||||
|
||||
ASSERT(dst->len == src->len);
|
||||
|
||||
num_pages = num_extent_pages(dst->start, dst->len);
|
||||
for (i = 0; i < num_pages; i++)
|
||||
copy_page(page_address(dst->pages[i]),
|
||||
page_address(src->pages[i]));
|
||||
}
|
||||
|
||||
void copy_extent_buffer(struct extent_buffer *dst, struct extent_buffer *src,
|
||||
unsigned long dst_offset, unsigned long src_offset,
|
||||
unsigned long len)
|
||||
|
Reference in New Issue
Block a user