diff mbox

[10/12] btrfs: use specialized page copying helpers in btrfs_clone_extent_buffer

Message ID 412f7272c84e3bfd07f05b0cc8e31af68eabbabd.1478710770.git.dsterba@suse.com (mailing list archive)
State Accepted
Headers show

Commit Message

David Sterba Nov. 9, 2016, 5:04 p.m. UTC
The copy_page is usually optimized and can be faster than memcpy.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/extent_io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 45a986791fe0..0a71a85d103d 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -4720,9 +4720,9 @@  struct extent_buffer *btrfs_clone_extent_buffer(struct extent_buffer *src)
 		WARN_ON(PageDirty(p));
 		SetPageUptodate(p);
 		new->pages[i] = p;
+		copy_page(page_address(p), page_address(src->pages[i]));
 	}
 
-	copy_extent_buffer(new, src, 0, 0, src->len);
 	set_bit(EXTENT_BUFFER_UPTODATE, &new->bflags);
 	set_bit(EXTENT_BUFFER_DUMMY, &new->bflags);