From patchwork Tue Jul 27 05:56:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 487959 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 4448AC4320A for ; Tue, 27 Jul 2021 06:07:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 26EB761102 for ; Tue, 27 Jul 2021 06:07:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235444AbhG0GHo (ORCPT ); Tue, 27 Jul 2021 02:07:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235063AbhG0GHo (ORCPT ); Tue, 27 Jul 2021 02:07:44 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6F6DC061757; Mon, 26 Jul 2021 23:07:44 -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=M2KGG6I0U2EZ5R+rEPh6yOtJDtRGWl8X6UKQ2IJBGZQ=; b=CRL1laGIBQmQ1ZR+XgfjfpB2n6 CI9D4xjMJHRNUpbpT5zdNb3ttNHIEZ062MFo8E26hr6xTyrjPMw8xu8qQ8bUvCSrghNbadb55mrWv 8fl5GN5mDWWAxkYRTHKunAmC1GPf/LzcJPgRZd1xURbB7YjQtGLz8xFwZD81kO9ApElpUe9KY2l38 s03fMuiKRxcZ+4mHQPgGbcwGO7Pwilw3rCGjYwva0cfs2myPpFX3YdyvVEaM5HazuvKr3hTp/Qk+m 9sV+2nK6xT8z63QQ956jcnxfk4PP9DXaGh6dEj7KaV4hO4J/FA/hrc9ELvPvPH6jfpGo/7VJGBobk NfxX31Fw==; 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 1m8GC8-00EijX-Cw; Tue, 27 Jul 2021 06:04:16 +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, Chaitanya Kulkarni , "Martin K . Petersen" Subject: [PATCH 05/15] block: use memzero_page in zero_fill_bio Date: Tue, 27 Jul 2021 07:56:36 +0200 Message-Id: <20210727055646.118787-6-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 memzero_bvec to zero each segment in the bio instead of manually mapping and zeroing the data. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny --- block/bio.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/block/bio.c b/block/bio.c index 1fab762e079b..2e436bccb1e2 100644 --- a/block/bio.c +++ b/block/bio.c @@ -495,16 +495,11 @@ EXPORT_SYMBOL(bio_kmalloc); void zero_fill_bio(struct bio *bio) { - unsigned long flags; struct bio_vec bv; struct bvec_iter iter; - bio_for_each_segment(bv, bio, iter) { - char *data = bvec_kmap_irq(&bv, &flags); - memset(data, 0, bv.bv_len); - flush_dcache_page(bv.bv_page); - bvec_kunmap_irq(data, &flags); - } + bio_for_each_segment(bv, bio, iter) + memzero_bvec(&bv); } EXPORT_SYMBOL(zero_fill_bio);