From patchwork Wed Aug 4 09:56:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 491723 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.8 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 9FDF2C43214 for ; Wed, 4 Aug 2021 10:04:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8143E601FC for ; Wed, 4 Aug 2021 10:04:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237352AbhHDKEl (ORCPT ); Wed, 4 Aug 2021 06:04:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235419AbhHDKEk (ORCPT ); Wed, 4 Aug 2021 06:04:40 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67631C0613D5; Wed, 4 Aug 2021 03:04:27 -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=OgN+TL2fi+1ZwR7PJxoMS2EK4Eu2vaMrEjV+dYXPObM=; b=jqeZ0Lxh+W2cclXMZXNwa2ndtK c8FElTE6VaKuvE87+FU9EPMjLAINUnTn1UZDhVkXSQt6HO+czDRw9JEod7R5qKU2vSDTc/aQHLTa3 3zmXmwLGvez4nxjDXqqsb2x0LwmqB/Gcqey5G3Rs1kFKAD0Cwi03UIrEPBuqQefZECCpTNCY0QVy1 qGiKEk07FqeB3BJOSmiOcsG1gQ/B3bCKa3cbabjOjyE/Hb9L3KLyWK5AaCgSYyF/UhlxhHwwbjDlz Sz6OlH7g9mkShsoIzFT9EAQt8FbzdDMgJdv9I4butvH9F/uOwHsZ3z0fLIpmhqo8kmb5GKCH4WbWF W2zNaDcQ==; Received: from [2a02:1205:5023:1f80:c068:bd3d:78b3:7d37] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mBDid-005fLT-QT; Wed, 04 Aug 2021 10:02:02 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Richard Weinberger , Anton Ivanov , Geoff Levand , Ilya Dryomov , Paolo Bonzini , Stefan Hajnoczi , Song Liu , Mike Snitzer , Coly Li , Stefan Haberland , Jan Hoeppner , "Martin K. Petersen" , Phillip Lougher , linux-block@vger.kernel.org, dm-devel@redhat.com, linux-um@lists.infradead.org, ceph-devel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-raid@vger.kernel.org, linux-bcache@vger.kernel.org, linux-nvme@lists.infradead.org, linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org Subject: [PATCH 07/15] rbd: use bvec_virt Date: Wed, 4 Aug 2021 11:56:26 +0200 Message-Id: <20210804095634.460779-8-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210804095634.460779-1-hch@lst.de> References: <20210804095634.460779-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 bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig Reviewed-by: Jeff Layton --- drivers/block/rbd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 6d596c2c2cd6..e65c9d706f6f 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -2986,8 +2986,7 @@ static bool is_zero_bvecs(struct bio_vec *bvecs, u32 bytes) }; ceph_bvec_iter_advance_step(&it, bytes, ({ - if (memchr_inv(page_address(bv.bv_page) + bv.bv_offset, 0, - bv.bv_len)) + if (memchr_inv(bvec_virt(&bv), 0, bv.bv_len)) return false; })); return true;