]> www.infradead.org Git - users/hch/block.git/commitdiff
block: use memcpy_to_bvec in copy_to_high_bio_irq
authorChristoph Hellwig <hch@lst.de>
Thu, 20 May 2021 12:30:56 +0000 (14:30 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 21 May 2021 05:55:28 +0000 (07:55 +0200)
Use memcpy_to_bvec instead of opencoding the logic.

Signed-off-by: Christoph Hellwig <hch@lst.de>
block/bounce.c

index 94081e013c58cc9daa47a5c476d631a18911eb2d..a2fc6326b6c92bf4b969dfb8a858f3754e91f5f7 100644 (file)
@@ -67,18 +67,6 @@ static __init int init_emergency_pool(void)
 
 __initcall(init_emergency_pool);
 
-/*
- * highmem version, map in to vec
- */
-static void bounce_copy_vec(struct bio_vec *to, unsigned char *vfrom)
-{
-       unsigned char *vto;
-
-       vto = kmap_atomic(to->bv_page);
-       memcpy(vto + to->bv_offset, vfrom, to->bv_len);
-       kunmap_atomic(vto);
-}
-
 /*
  * Simple bounce buffer support for highmem pages. Depending on the
  * queue gfp mask set, *to may or may not be a highmem page. kmap it
@@ -107,7 +95,7 @@ static void copy_to_high_bio_irq(struct bio *to, struct bio *from)
                        vfrom = page_address(fromvec.bv_page) +
                                tovec.bv_offset;
 
-                       bounce_copy_vec(&tovec, vfrom);
+                       memcpy_to_bvec(&tovec, vfrom);
                        flush_dcache_page(tovec.bv_page);
                }
                bio_advance_iter(from, &from_iter, tovec.bv_len);