From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73939C4167B for ; Tue, 22 Feb 2022 15:52:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233824AbiBVPxR (ORCPT ); Tue, 22 Feb 2022 10:53:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233785AbiBVPwn (ORCPT ); Tue, 22 Feb 2022 10:52:43 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 280915620F; Tue, 22 Feb 2022 07:52:12 -0800 (PST) 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=ISvKp3WNThdGNNdE3CYZoY0ytkmqO3Mj6EgB8eb205Y=; b=EipywGk+8rUluKSC8VJJUrQ5mC KYd2nprYD3H2ROhE8ZIXmDUTrpFIxjjP/oau+TXm8s/WVq3PCNfEbV4ULA6kEV1JpOE1saNgFYc4W 2DBn4YhI22xv6nV0h+xGZQLeDtZongs1oQlQjjrV9Ie2q/k0YQCzlv4SBwfNhCEvXF/3ol66ADtc/ xBEadeDJN9vlSFQaCsj+bpdvXCrdFIn7bwmJM+IaA8Iq9VpGpo5gWvv0VUJXf9xy+r/0DphqCGwQ3 ZVMtViuZzKYYLlYXnCr6N3vjSrhFj9jyC4e5QkJEAOgnwCa5ipXwPNVMKQUWtaO9drkB6G9HuGeKC UB7j9zmQ==; Received: from [2001:4bb8:198:f8fc:c22a:ebfc:be8d:63c2] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMXSO-00APq7-Gi; Tue, 22 Feb 2022 15:52:04 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Chris Zankel , Max Filippov , Justin Sanders , Philipp Reisner , Lars Ellenberg , Denis Efremov , Minchan Kim , Nitin Gupta , Coly Li , Dan Williams , Vishal Verma , linux-xtensa@linux-xtensa.org, linux-block@vger.kernel.org, drbd-dev@lists.linbit.com, linux-bcache@vger.kernel.org, nvdimm@lists.linux.dev Subject: [PATCH 02/10] aoe: use bvec_kmap_local in bvcpy Date: Tue, 22 Feb 2022 16:51:48 +0100 Message-Id: <20220222155156.597597-3-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220222155156.597597-1-hch@lst.de> References: <20220222155156.597597-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-block@vger.kernel.org Using local kmaps slightly reduces the chances to stray writes, and the bvec interface cleans up the code a little bit. Signed-off-by: Christoph Hellwig --- drivers/block/aoe/aoecmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index cc11f89a0928f..093996961d452 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c @@ -1018,7 +1018,7 @@ bvcpy(struct sk_buff *skb, struct bio *bio, struct bvec_iter iter, long cnt) iter.bi_size = cnt; __bio_for_each_segment(bv, bio, iter, iter) { - char *p = kmap_atomic(bv.bv_page) + bv.bv_offset; + char *p = bvec_kmap_local(&bv); skb_copy_bits(skb, soff, p, bv.bv_len); kunmap_atomic(p); soff += bv.bv_len; -- 2.30.2