All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ira Weiny <ira.weiny@intel.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@kernel.dk>, Chris Zankel <chris@zankel.net>,
	Max Filippov <jcmvbkbc@gmail.com>,
	Justin Sanders <justin@coraid.com>,
	Philipp Reisner <philipp.reisner@linbit.com>,
	Lars Ellenberg <lars.ellenberg@linbit.com>,
	Denis Efremov <efremov@linux.com>,
	Minchan Kim <minchan@kernel.org>, Nitin Gupta <ngupta@vflare.org>,
	Coly Li <colyli@suse.de>, Dan Williams <dan.j.williams@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	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: Re: [PATCH 06/10] nvdimm-btt: use bvec_kmap_local in btt_rw_integrity
Date: Wed, 2 Mar 2022 09:04:50 -0800	[thread overview]
Message-ID: <Yh+jshFsKMt+iI55@iweiny-desk3> (raw)
In-Reply-To: <20220301122042.GB3405@lst.de>

On Tue, Mar 01, 2022 at 01:20:42PM +0100, Christoph Hellwig wrote:
> On Mon, Feb 28, 2022 at 07:59:06PM -0800, Ira Weiny wrote:
> > On Tue, Feb 22, 2022 at 04:51:52PM +0100, Christoph Hellwig wrote:
> > > 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 <hch@lst.de>
> > > ---
> > >  drivers/nvdimm/btt.c | 10 ++++------
> > >  1 file changed, 4 insertions(+), 6 deletions(-)
> > > 
> > > diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c
> > > index cbd994f7f1fe6..9613e54c7a675 100644
> > > --- a/drivers/nvdimm/btt.c
> > > +++ b/drivers/nvdimm/btt.c
> > > @@ -1163,17 +1163,15 @@ static int btt_rw_integrity(struct btt *btt, struct bio_integrity_payload *bip,
> > >  		 */
> > >  
> > >  		cur_len = min(len, bv.bv_len);
> > > -		mem = kmap_atomic(bv.bv_page);
> > > +		mem = bvec_kmap_local(&bv);
> > >  		if (rw)
> > > -			ret = arena_write_bytes(arena, meta_nsoff,
> > > -					mem + bv.bv_offset, cur_len,
> > > +			ret = arena_write_bytes(arena, meta_nsoff, mem, cur_len,
> > 
> > Why drop bv.bv_offset here and below?
> 
> Because bvec_kmap_local includes bv_offset in the pointer that it
> returns.

Ah I missed that.  Thanks,
Ira

  reply	other threads:[~2022-03-02 17:06 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22 15:51 remove opencoded kmap of bio_vecs Christoph Hellwig
2022-02-22 15:51 ` [PATCH 01/10] iss-simdisk: use bvec_kmap_local in simdisk_submit_bio Christoph Hellwig
2022-03-01  0:30   ` Ira Weiny
2022-02-22 15:51 ` [PATCH 02/10] aoe: use bvec_kmap_local in bvcpy Christoph Hellwig
2022-03-01  0:31   ` Ira Weiny
2022-02-22 15:51 ` [PATCH 03/10] zram: use memcpy_to_bvec in zram_bvec_read Christoph Hellwig
2022-03-01  1:10   ` Ira Weiny
2022-03-01 12:19     ` Christoph Hellwig
2022-02-22 15:51 ` [PATCH 04/10] zram: use memcpy_from_bvec in zram_bvec_write Christoph Hellwig
2022-03-01  2:12   ` Ira Weiny
2022-02-22 15:51 ` [PATCH 05/10] nvdimm-blk: use bvec_kmap_local in nd_blk_rw_integrity Christoph Hellwig
2022-03-01  3:54   ` Ira Weiny
2022-02-22 15:51 ` [PATCH 06/10] nvdimm-btt: use bvec_kmap_local in btt_rw_integrity Christoph Hellwig
2022-03-01  3:59   ` Ira Weiny
2022-03-01 12:20     ` Christoph Hellwig
2022-03-02 17:04       ` Ira Weiny [this message]
2022-02-22 15:51 ` [PATCH 07/10] bcache: use bvec_kmap_local in bio_csum Christoph Hellwig
2022-03-01  4:00   ` Ira Weiny
2022-02-22 15:51 ` [PATCH 08/10] drbd: use bvec_kmap_local in drbd_csum_bio Christoph Hellwig
2022-03-01  4:06   ` Ira Weiny
2022-02-22 15:51 ` [PATCH 09/10] drbd: use bvec_kmap_local in recv_dless_read Christoph Hellwig
2022-03-01  4:09   ` Ira Weiny
2022-02-22 15:51 ` [PATCH 10/10] floppy: use memcpy_{to,from}_bvec Christoph Hellwig
2022-03-01  4:11   ` Ira Weiny
2022-02-22 16:25 ` remove opencoded kmap of bio_vecs Chaitanya Kulkarni
2022-03-03 11:18 remove opencoded kmap of bio_vecs v2 Christoph Hellwig
2022-03-03 11:19 ` [PATCH 06/10] nvdimm-btt: use bvec_kmap_local in btt_rw_integrity Christoph Hellwig
2022-03-04  3:05   ` Ira Weiny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yh+jshFsKMt+iI55@iweiny-desk3 \
    --to=ira.weiny@intel.com \
    --cc=axboe@kernel.dk \
    --cc=chris@zankel.net \
    --cc=colyli@suse.de \
    --cc=dan.j.williams@intel.com \
    --cc=drbd-dev@lists.linbit.com \
    --cc=efremov@linux.com \
    --cc=hch@lst.de \
    --cc=jcmvbkbc@gmail.com \
    --cc=justin@coraid.com \
    --cc=lars.ellenberg@linbit.com \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-xtensa@linux-xtensa.org \
    --cc=minchan@kernel.org \
    --cc=ngupta@vflare.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=philipp.reisner@linbit.com \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.