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 v4 07/15] md/raid5: set correct page offset for async_copy_data()
Date: Fri, 12 Jun 2020 19:42:12 +0800 [thread overview]
Message-ID: <20200612114220.13126-8-yuyufen@huawei.com> (raw)
In-Reply-To: <20200612114220.13126-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. It also need to set correct
page offset for dev->page when use r5pages.
Without modifying original code logic, we replace 'page_offset' with
'page_offset + poff' simplify. In case of that wihtout using r5pages,
poff is zero.
Signed-off-by: Yufen Yu <yuyufen@huawei.com>
---
drivers/md/raid5.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 9ab7f99406d6..289e7a7eecdf 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1296,7 +1296,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;
@@ -1342,11 +1342,13 @@ 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,
- b_offset, clen, &submit);
+ 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;
@@ -1418,7 +1420,8 @@ static void ops_run_biofill(struct stripe_head *sh)
while (rbi && rbi->bi_iter.bi_sector <
dev->sector + sh->raid_conf->stripe_sectors) {
tx = async_copy_data(0, rbi, &dev->page,
- dev->sector, tx, sh, 0);
+ dev->offset,
+ dev->sector, tx, sh, 0);
rbi = r5_next_bio(sh->raid_conf, rbi,
dev->sector);
}
@@ -1846,6 +1849,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.21.3
next prev parent reply other threads:[~2020-06-12 11:42 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-12 11:42 [PATCH v4 00/15] md/raid5: set STRIPE_SIZE as a configurable value Yufen Yu
2020-06-12 11:42 ` [PATCH v4 01/15] md/raid456: covert macro define of STRIPE_* as members of struct r5conf Yufen Yu
2020-06-14 2:28 ` Xiao Ni
2020-06-15 7:17 ` Yufen Yu
2020-06-12 11:42 ` [PATCH v4 02/15] md/raid5: add sysfs entry to set and show stripe_size Yufen Yu
2020-06-12 11:42 ` [PATCH v4 03/15] md/raid5: set default stripe_size as 4096 Yufen Yu
2020-06-12 11:42 ` [PATCH v4 04/15] md/raid5: add a member of r5pages for struct stripe_head Yufen Yu
2020-06-12 11:42 ` [PATCH v4 05/15] md/raid5: allocate and free shared pages of r5pages Yufen Yu
2020-06-12 11:42 ` [PATCH v4 06/15] md/raid5: set correct page offset for bi_io_vec in ops_run_io() Yufen Yu
2020-06-12 11:42 ` Yufen Yu [this message]
2020-06-12 11:42 ` [PATCH v4 08/15] md/raid5: resize stripes and set correct offset when reshape array Yufen Yu
2020-06-12 11:42 ` [PATCH v4 09/15] md/raid5: add new xor function to support different page offset Yufen Yu
2020-06-12 11:42 ` [PATCH v4 10/15] md/raid5: add offset array in scribble buffer Yufen Yu
2020-06-12 11:42 ` [PATCH v4 11/15] md/raid5: compute xor with correct page offset Yufen Yu
2020-06-12 11:42 ` [PATCH v4 12/15] md/raid5: support config stripe_size by sysfs entry Yufen Yu
2020-06-12 11:42 ` [PATCH v4 13/15] md/raid6: let syndrome computor support different page offset Yufen Yu
2020-06-12 11:42 ` [PATCH v4 14/15] md/raid6: compute syndrome with correct " Yufen Yu
2020-06-12 11:42 ` [PATCH v4 15/15] raid6test: adaptation with syndrome function 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=20200612114220.13126-8-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox