From patchwork Tue Feb 22 15:51:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12755522 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E44966A1 for ; Tue, 22 Feb 2022 15:52:11 +0000 (UTC) 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=aN/osrpoBd93lFAdSfaCdvaW2yQTD+I1EmrK67O47xo=; b=ymFEIIWRPVZXMO4JkLMfHN4H+o 7lzhP/9wb5ws8ulA8vXqpL6Gnf5WCXLcVGI7F2t9VyOMuRbtoPZlJVUhojPyi+S4FRfvDhJWxlhnd VoASMEVXyotQDu2MRwUOaAP5BrK3099mEr7Jx/fY5YXGi0w9SHbxIv6Snf6d6iK3gNnUorFTXZot/ m/T+Fcpv85Pv+MVabQuyRdgiQ73dUKa2KA4SAOoGctusaJfKEqtvWoZtDXyoogI4YAAk1XTAR0yMg lTynV8r5Vd22j5Svs1gzYSKHlSLIpZlXBew3dr8n26Py8vMubO6fI98CHaLTcF7Kd9TMcWgLC3mKk XYuBufXQ==; 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 1nMXSL-00APog-La; Tue, 22 Feb 2022 15:52:02 +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 01/10] iss-simdisk: use bvec_kmap_local in simdisk_submit_bio Date: Tue, 22 Feb 2022 16:51:47 +0100 Message-Id: <20220222155156.597597-2-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> Precedence: bulk X-Mailing-List: nvdimm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html 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 Reviewed-by: Ira Weiny --- arch/xtensa/platforms/iss/simdisk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/xtensa/platforms/iss/simdisk.c b/arch/xtensa/platforms/iss/simdisk.c index 8eb6ad1a3a1de..0f0e0724397f4 100644 --- a/arch/xtensa/platforms/iss/simdisk.c +++ b/arch/xtensa/platforms/iss/simdisk.c @@ -108,13 +108,13 @@ static void simdisk_submit_bio(struct bio *bio) sector_t sector = bio->bi_iter.bi_sector; bio_for_each_segment(bvec, bio, iter) { - char *buffer = kmap_atomic(bvec.bv_page) + bvec.bv_offset; + char *buffer = bvec_kmap_local(&bvec); unsigned len = bvec.bv_len >> SECTOR_SHIFT; simdisk_transfer(dev, sector, len, buffer, bio_data_dir(bio) == WRITE); sector += len; - kunmap_atomic(buffer); + kunmap_local(buffer); } bio_endio(bio);