linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>, Thomas Gleixner <tglx@linutronix.de>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Geoff Levand <geoff@infradead.org>,
	Ilya Dryomov <idryomov@gmail.com>,
	Dongsheng Yang <dongsheng.yang@easystack.cn>,
	Mike Snitzer <snitzer@redhat.com>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	Ira Weiny <ira.weiny@intel.com>,
	dm-devel@redhat.com, linux-mips@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, ceph-devel@vger.kernel.org,
	linux-arch@vger.kernel.org,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Subject: [PATCH 08/15] ps3disk: use memcpy_{from,to}_bvec
Date: Tue, 27 Jul 2021 07:56:39 +0200	[thread overview]
Message-ID: <20210727055646.118787-9-hch@lst.de> (raw)
In-Reply-To: <20210727055646.118787-1-hch@lst.de>

Use the bvec helpers instead of open coding the copy.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Tested-by: Geoff Levand <geoff@infradead.org>
---
 drivers/block/ps3disk.c | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c
index f374ea2c67ce..8d51efbe045d 100644
--- a/drivers/block/ps3disk.c
+++ b/drivers/block/ps3disk.c
@@ -83,26 +83,12 @@ static void ps3disk_scatter_gather(struct ps3_storage_device *dev,
 	unsigned int offset = 0;
 	struct req_iterator iter;
 	struct bio_vec bvec;
-	unsigned int i = 0;
-	size_t size;
-	void *buf;
 
 	rq_for_each_segment(bvec, req, iter) {
-		unsigned long flags;
-		dev_dbg(&dev->sbd.core, "%s:%u: bio %u: %u sectors from %llu\n",
-			__func__, __LINE__, i, bio_sectors(iter.bio),
-			iter.bio->bi_iter.bi_sector);
-
-		size = bvec.bv_len;
-		buf = bvec_kmap_irq(&bvec, &flags);
 		if (gather)
-			memcpy(dev->bounce_buf+offset, buf, size);
+			memcpy_from_bvec(dev->bounce_buf + offset, &bvec);
 		else
-			memcpy(buf, dev->bounce_buf+offset, size);
-		offset += size;
-		flush_kernel_dcache_page(bvec.bv_page);
-		bvec_kunmap_irq(buf, &flags);
-		i++;
+			memcpy_to_bvec(&bvec, dev->bounce_buf + offset);
 	}
 }
 
-- 
2.30.2


  parent reply	other threads:[~2021-07-27  6:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27  5:56 switch the block layer to use kmap_local_page v3 Christoph Hellwig
2021-07-27  5:56 ` [PATCH 01/15] MIPS: don't include <linux/genhd.h> in <asm/mach-rc32434/rb.h> Christoph Hellwig
2021-07-27  5:56 ` [PATCH 02/15] bvec: fix the include guards for bvec.h Christoph Hellwig
2021-07-27  5:56 ` [PATCH 03/15] bvec: add a bvec_kmap_local helper Christoph Hellwig
2021-07-27  5:56 ` [PATCH 04/15] bvec: add memcpy_{from,to}_bvec and memzero_bvec helper Christoph Hellwig
2021-07-27  5:56 ` [PATCH 05/15] block: use memzero_page in zero_fill_bio Christoph Hellwig
2021-07-27  5:56 ` [PATCH 06/15] rbd: use memzero_bvec Christoph Hellwig
2021-07-27  5:56 ` [PATCH 07/15] dm-writecache: use bvec_kmap_local instead of bvec_kmap_irq Christoph Hellwig
2021-07-27  5:56 ` Christoph Hellwig [this message]
2021-07-27  5:56 ` [PATCH 09/15] block: remove bvec_kmap_irq and bvec_kunmap_irq Christoph Hellwig
2021-07-27  5:56 ` [PATCH 10/15] block: rewrite bio_copy_data_iter to use bvec_kmap_local and memcpy_to_bvec Christoph Hellwig
2021-07-27  5:56 ` [PATCH 11/15] block: use memcpy_to_bvec in copy_to_high_bio_irq Christoph Hellwig
2021-07-27  5:56 ` [PATCH 12/15] block: use memcpy_from_bvec in bio_copy_kern_endio_read Christoph Hellwig
2021-07-27  5:56 ` [PATCH 13/15] block: use memcpy_from_bvec in __blk_queue_bounce Christoph Hellwig
2021-07-27  5:56 ` [PATCH 14/15] block: use bvec_kmap_local in t10_pi_type1_{prepare,complete} Christoph Hellwig
2021-07-27  5:56 ` [PATCH 15/15] block: use bvec_kmap_local in bio_integrity_process Christoph Hellwig
2021-07-28  1:31 ` switch the block layer to use kmap_local_page v3 Jens Axboe

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=20210727055646.118787-9-hch@lst.de \
    --to=hch@lst.de \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=ceph-devel@vger.kernel.org \
    --cc=dm-devel@redhat.com \
    --cc=dongsheng.yang@easystack.cn \
    --cc=geoff@infradead.org \
    --cc=idryomov@gmail.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=martin.petersen@oracle.com \
    --cc=snitzer@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tsbogend@alpha.franken.de \
    --subject='Re: [PATCH 08/15] ps3disk: use memcpy_{from,to}_bvec' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).