Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mail19.linbit.com (LINBIT Mail Daemon) with ESMTP id 7104F4217A1 for ; Tue, 1 Mar 2022 02:10:11 +0100 (CET) Date: Mon, 28 Feb 2022 17:10:09 -0800 From: Ira Weiny To: Christoph Hellwig Message-ID: References: <20220222155156.597597-1-hch@lst.de> <20220222155156.597597-4-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220222155156.597597-4-hch@lst.de> Cc: Jens Axboe , 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 , Dan Williams , Nitin Gupta , drbd-dev@lists.linbit.com Subject: Re: [Drbd-dev] [PATCH 03/10] zram: use memcpy_to_bvec in zram_bvec_read 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: , On Tue, Feb 22, 2022 at 04:51:49PM +0100, Christoph Hellwig wrote: > Use the proper helper instead of open coding the copy. > > Signed-off-by: Christoph Hellwig Looks fine but I don't see a reason to keep the other operation atomic. Could the src map also use kmap_local_page()? Reviewed-by: Ira Weiny > --- > drivers/block/zram/zram_drv.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c > index a3a5e1e713268..14becdf2815df 100644 > --- a/drivers/block/zram/zram_drv.c > +++ b/drivers/block/zram/zram_drv.c > @@ -1331,12 +1331,10 @@ static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec, > goto out; > > if (is_partial_io(bvec)) { > - void *dst = kmap_atomic(bvec->bv_page); > void *src = kmap_atomic(page); > > - memcpy(dst + bvec->bv_offset, src + offset, bvec->bv_len); > + memcpy_to_bvec(bvec, src + offset); > kunmap_atomic(src); > - kunmap_atomic(dst); > } > out: > if (is_partial_io(bvec)) > -- > 2.30.2 > >