All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yufen Yu <yuyufen@huawei.com>
To: song@kernel.org
Cc: linux-raid@vger.kernel.org, neilb@suse.com,
	guoqing.jiang@cloud.ionos.com, houtao1@huawei.com,
	yuyufen@huawei.com
Subject: [PATCH 03/12] md/raid5: make async_copy_data() to support different page offset
Date: Wed, 12 Aug 2020 08:49:22 -0400	[thread overview]
Message-ID: <20200812124931.2584743-4-yuyufen@huawei.com> (raw)
In-Reply-To: <20200812124931.2584743-1-yuyufen@huawei.com>

ops_run_biofill() and ops_run_biodrain() will call async_copy_data()
to copy sh->dev[i].page from or to bio page. For now, it implies the
offset of dev[i].page is 0. But we want to support different page offset
in the following.

Thus, pass page offset to these functions and replace 'page_offset'
with 'page_offset + poff'.

No functional change.

Signed-off-by: Yufen Yu <yuyufen@huawei.com>
---
 drivers/md/raid5.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 508dceafa533..4757d1b8f90d 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1227,7 +1227,7 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s)
 
 static struct dma_async_tx_descriptor *
 async_copy_data(int frombio, struct bio *bio, struct page **page,
-	sector_t sector, struct dma_async_tx_descriptor *tx,
+	unsigned int poff, sector_t sector, struct dma_async_tx_descriptor *tx,
 	struct stripe_head *sh, int no_skipcopy)
 {
 	struct bio_vec bvl;
@@ -1273,11 +1273,11 @@ async_copy_data(int frombio, struct bio *bio, struct page **page,
 				    !no_skipcopy)
 					*page = bio_page;
 				else
-					tx = async_memcpy(*page, bio_page, page_offset,
+					tx = async_memcpy(*page, bio_page, page_offset + poff,
 						  b_offset, clen, &submit);
 			} else
 				tx = async_memcpy(bio_page, *page, b_offset,
-						  page_offset, clen, &submit);
+						  page_offset + poff, clen, &submit);
 		}
 		/* chain the operations */
 		submit.depend_tx = tx;
@@ -1350,6 +1350,7 @@ static void ops_run_biofill(struct stripe_head *sh)
 			while (rbi && rbi->bi_iter.bi_sector <
 				dev->sector + RAID5_STRIPE_SECTORS(conf)) {
 				tx = async_copy_data(0, rbi, &dev->page,
+						     dev->offset,
 						     dev->sector, tx, sh, 0);
 				rbi = r5_next_bio(conf, rbi, dev->sector);
 			}
@@ -1790,6 +1791,7 @@ ops_run_biodrain(struct stripe_head *sh, struct dma_async_tx_descriptor *tx)
 					set_bit(R5_Discard, &dev->flags);
 				else {
 					tx = async_copy_data(1, wbi, &dev->page,
+							     dev->offset,
 							     dev->sector, tx, sh,
 							     r5c_is_writeback(conf->log));
 					if (dev->page != dev->orig_page &&
-- 
2.25.4

  parent reply	other threads:[~2020-08-12 12:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-12 12:49 [PATCH 00/12] Save memory for stripe_head buffer Yufen Yu
2020-08-12 12:49 ` [PATCH 01/12] md/raid5: add offset array in scribble buffer Yufen Yu
2020-08-12 12:49 ` [PATCH 02/12] md/raid5: add a new member of offset into r5dev Yufen Yu
2020-08-12 12:49 ` Yufen Yu [this message]
2020-08-12 12:49 ` [PATCH 04/12] md/raid5: add new xor function to support different page offset Yufen Yu
2020-08-12 12:49 ` [PATCH 05/12] md/raid5: convert to new xor compution interface Yufen Yu
2020-08-12 12:49 ` [PATCH 06/12] md/raid6: let syndrome computor support different page offset Yufen Yu
2020-08-12 12:49 ` [PATCH 07/12] md/raid6: let async recovery function " Yufen Yu
2020-08-12 12:49 ` [PATCH 08/12] md/raid6: convert to new syndrome and recovery interface Yufen Yu
2020-08-12 12:49 ` [PATCH 09/12] raid6test: adaptation with new syndrome function Yufen Yu
2020-08-12 12:49 ` [PATCH 10/12] md/raid5: let multiple devices of stripe_head share page Yufen Yu
2020-08-12 12:49 ` [PATCH 11/12] md/raid5: resize stripe_head when reshape array Yufen Yu
2020-08-12 12:49 ` [PATCH 12/12] md/raid5: reallocate page array after setting new stripe_size Yufen Yu
2020-08-20  0:25 ` [PATCH 00/12] Save memory for stripe_head buffer Song Liu
2020-08-20  6:30   ` Yufen Yu

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=20200812124931.2584743-4-yuyufen@huawei.com \
    --to=yuyufen@huawei.com \
    --cc=guoqing.jiang@cloud.ionos.com \
    --cc=houtao1@huawei.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.com \
    --cc=song@kernel.org \
    /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.