Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by mail19.linbit.com (LINBIT Mail Daemon) with ESMTP id 1863B421786 for ; Thu, 3 Mar 2022 12:20:13 +0100 (CET) From: Christoph Hellwig To: Jens Axboe Date: Thu, 3 Mar 2022 14:19:02 +0300 Message-Id: <20220303111905.321089-8-hch@lst.de> In-Reply-To: <20220303111905.321089-1-hch@lst.de> References: <20220303111905.321089-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: Chris Zankel , Justin Sanders , Minchan Kim , Vishal Verma , linux-xtensa@linux-xtensa.org, Philipp Reisner , Denis Efremov , Coly Li , linux-block@vger.kernel.org, Max Filippov , linux-bcache@vger.kernel.org, nvdimm@lists.linux.dev, Lars Ellenberg , Ira Weiny , Dan Williams , Nitin Gupta , drbd-dev@lists.linbit.com Subject: [Drbd-dev] [PATCH 07/10] bcache: use bvec_kmap_local in bio_csum List-Id: "*Coordination* of development, patches, contributions -- *Questions* \(even to developers\) go to drbd-user, please." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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/md/bcache/request.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index 6869e010475a3..fdd0194f84dd0 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c @@ -44,10 +44,10 @@ static void bio_csum(struct bio *bio, struct bkey *k) uint64_t csum = 0; bio_for_each_segment(bv, bio, iter) { - void *d = kmap(bv.bv_page) + bv.bv_offset; + void *d = bvec_kmap_local(&bv); csum = crc64_be(csum, d, bv.bv_len); - kunmap(bv.bv_page); + kunmap_local(d); } k->ptr[KEY_PTRS(k)] = csum & (~0ULL >> 1); -- 2.30.2