btrfs: use specialized page copying helpers in btrfs_clone_extent_buffer
authorDavid Sterba <dsterba@suse.com>
Tue, 8 Nov 2016 16:56:24 +0000 (17:56 +0100)
committerDavid Sterba <dsterba@suse.com>
Wed, 30 Nov 2016 12:45:17 +0000 (13:45 +0100)
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

index 2ae731a0058ad2da34fc86b47bd377f553daeb08..bf719e3bcaf25a67af3ccd5834417c885cda8525 100644 (file)
@@ -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);