btrfs: zlib: use copy_page for full page copy
authorDavid Sterba <dsterba@suse.com>
Mon, 31 Oct 2022 19:33:40 +0000 (20:33 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 5 Dec 2022 17:00:51 +0000 (18:00 +0100)
The copy_page helper may use an optimized version for full page copy
(eg. on s390 there's a special instruction for that), there's one more
left to convert.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/zlib.c

index b4f4466..c5275cb 100644 (file)
@@ -155,8 +155,8 @@ int zlib_compress_pages(struct list_head *ws, struct address_space *mapping,
                                        in_page = find_get_page(mapping,
                                                                start >> PAGE_SHIFT);
                                        data_in = kmap_local_page(in_page);
-                                       memcpy(workspace->buf + i * PAGE_SIZE,
-                                              data_in, PAGE_SIZE);
+                                       copy_page(workspace->buf + i * PAGE_SIZE,
+                                                 data_in);
                                        start += PAGE_SIZE;
                                }
                                workspace->strm.next_in = workspace->buf;