Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4221962pxj; Tue, 8 Jun 2021 09:11:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/sJHK8DuJBVRMpgQo8fmxW+XwSpTMS9PKjJFnZ8yniDAhfP8IUrH1d8JjayxTFy4T5IkL X-Received: by 2002:a17:906:5285:: with SMTP id c5mr23865001ejm.282.1623168714877; Tue, 08 Jun 2021 09:11:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623168714; cv=none; d=google.com; s=arc-20160816; b=M3z1qGibtaRYjafaDn8Ut+05a6nPaMJdG9ucbet087v2dQgBnzDYcxAOLXohuAJ3qq q49ABBFDF+Uzmb4UL7yzxbqPVBn1mWsTjkYT6dLDCMY3Pr/MZ+lpDe9JAmSvCGzy2+nB qG8zd2HYe68A+nxJ5mXZ0ayTf4XEHWvCMQaqWmO9S4woJ50AbHpmPhNUrVJoN9TtNwuU MadCMJywmjtUVeinV8Jd8abAMNtQEpVFtP00F63XXJRshDw2m/V0XaN/ylGL5Y9/FEVp viXRsrUI70RLgKeRPZeawDo1rAc/0CQviJ51iCi3Ze22y1QwZbPwmuxtWXJnfGjLKckp Mivw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6el1Xjjuiwoh8C5GaeWua1PePuQ0zzIn1YY3WglnD2c=; b=zIPsc2QLPcSevu4CmVbgxQo1BZmNizaVE3R0U3RT2sw4CHoaJjz2NYlBNbZcnIo48a Kq/O0rcaFVcE/K31LAaluqGA74+ANB8UUmdz6AIfBZBZQ7rdMVoxi+ASSLhOi8daL2AM irik0nFkuWq2zU9qh615+R1JyWWmRYrQEEZh9Qgom8yS4Cr+0Beh7kBPWf2yw97uKK92 x+nzI+7uzjzlDcv0fGtYlC8+YYTOG1MYZTGtsenlwvx66evJNCO1H6s0FdZx6dSyc4k9 MphQZnNRByrK07nRN92YXTBziJRGuRYuOSJJdpuh5joeroPQ3dyRGiJhha6y77tOxRVO /V6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=TR8lLAOI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr40si107853ejc.41.2021.06.08.09.11.30; Tue, 08 Jun 2021 09:11:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=TR8lLAOI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233853AbhFHQJs (ORCPT + 99 others); Tue, 8 Jun 2021 12:09:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229724AbhFHQIv (ORCPT ); Tue, 8 Jun 2021 12:08:51 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F130DC061574; Tue, 8 Jun 2021 09:06:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=6el1Xjjuiwoh8C5GaeWua1PePuQ0zzIn1YY3WglnD2c=; b=TR8lLAOIS9zH3xVLWrYC1kGQrQ ROk7bhb2bZD5SH4f4/jWv+orQvUCu6O+IRXa+J1jUD/m3jLMXUaQRfWEpokNpQbnjhRiIwrZHPhX6 mqTDg9EtUknw9+BRv3LMGaqTsoxZhj6anyleI8mez0H3rWdl6zeyQDKehV8SibcXYZxQqh1dJ45aP UrqbSNBFeSgMNn0L6wpo2G+b2mh2BiPBZpG7hA/S6gnshZkSIGD2I8luNyDg08Lb/CIZKzo9Cj3Uv twQB+yNrgflXuc4Ljp/nn/sL7L63WlwyhGpoeS7NAtisM+UES6NDhs5DFfhoHGgpwUw38okU/c+L4 KtOKoViA==; Received: from [2001:4bb8:192:ff5f:74ed:7c4f:a5ee:8dcb] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqeFa-009RjP-Qy; Tue, 08 Jun 2021 16:06:47 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Thomas Bogendoerfer , Geoff Levand , Ilya Dryomov , Dongsheng Yang , Mike Snitzer , Ira Weiny , dm-devel@redhat.com, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, ceph-devel@vger.kernel.org Subject: [PATCH 12/16] block: use memcpy_to_bvec in copy_to_high_bio_irq Date: Tue, 8 Jun 2021 18:05:59 +0200 Message-Id: <20210608160603.1535935-13-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210608160603.1535935-1-hch@lst.de> References: <20210608160603.1535935-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use memcpy_to_bvec instead of opencoding the logic. Signed-off-by: Christoph Hellwig --- block/bounce.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/block/bounce.c b/block/bounce.c index 94081e013c58..a2fc6326b6c9 100644 --- a/block/bounce.c +++ b/block/bounce.c @@ -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); -- 2.30.2