From patchwork Tue Jul 27 05:56:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 486805 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78C44C19F31 for ; Tue, 27 Jul 2021 06:20:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5B2FA610A0 for ; Tue, 27 Jul 2021 06:20:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235747AbhG0GUI (ORCPT ); Tue, 27 Jul 2021 02:20:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235723AbhG0GTx (ORCPT ); Tue, 27 Jul 2021 02:19:53 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 519A1C061757; Mon, 26 Jul 2021 23:19:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=rX7drtdaBtTt+oUMB7i7NB3GQLkG9veEPdnbKTIN9Nc=; b=h5Nh6boXqyqKbrcu+tlfPSrCXh VF2tSW60oXkDeGf4l1TXTSjnwO+vMl9frgs1qHBZCFfeIGWSopNaafY0XAW+op+iwVhxjYNEuBo9r U6yyPSPuXVKbUvvBSklZVwi94j079LB+TEkL2I7bPDMlvdx7veNFjr/FDbae9/V62E7Kz5/Dh5uB5 eL17xHcwEIDbGwVKvrtnJWaHmQmnegnpG0DIPb/GhRAB5378OZIU1PsaihsJ2oufmCXLLXD/10BWZ aWXkLsEJcq5UqEnkkk5kxSHymlnz9VtpWaxkCMD4AVRHgkf23j4GrgAsd9Q0JItvIYFBRg6KhsgC9 2/mEjzDA==; Received: from [2001:4bb8:184:87c5:b7fb:1299:a9e5:ff56] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8GMn-00EjNF-Gn; Tue, 27 Jul 2021 06:15:42 +0000 From: Christoph Hellwig To: Jens Axboe , Thomas Gleixner Cc: Thomas Bogendoerfer , Andrew Morton , Geoff Levand , Ilya Dryomov , Dongsheng Yang , Mike Snitzer , "James E.J. Bottomley" , 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, linux-arch@vger.kernel.org, "Martin K . Petersen" Subject: [PATCH 12/15] block: use memcpy_from_bvec in bio_copy_kern_endio_read Date: Tue, 27 Jul 2021 07:56:43 +0200 Message-Id: <20210727055646.118787-13-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210727055646.118787-1-hch@lst.de> References: <20210727055646.118787-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Use memcpy_from_bvec instead of open coding the logic. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/blk-map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-map.c b/block/blk-map.c index 3743158ddaeb..d1448aaad980 100644 --- a/block/blk-map.c +++ b/block/blk-map.c @@ -400,7 +400,7 @@ static void bio_copy_kern_endio_read(struct bio *bio) struct bvec_iter_all iter_all; bio_for_each_segment_all(bvec, bio, iter_all) { - memcpy(p, page_address(bvec->bv_page), bvec->bv_len); + memcpy_from_bvec(p, bvec); p += bvec->bv_len; }