Skip to content

Commit 248728d

Browse files
Yufen Yuliu-song-6
authored andcommitted
md/raid5: make async_copy_data() to support different page offset
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> Signed-off-by: Song Liu <songliubraving@fb.com>
1 parent 7aba13b commit 248728d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎drivers/md/raid5.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,7 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s)
12271227

12281228
static struct dma_async_tx_descriptor *
12291229
async_copy_data(int frombio, struct bio *bio, struct page **page,
1230-
sector_t sector, struct dma_async_tx_descriptor *tx,
1230+
unsigned int poff, sector_t sector, struct dma_async_tx_descriptor *tx,
12311231
struct stripe_head *sh, int no_skipcopy)
12321232
{
12331233
struct bio_vec bvl;
@@ -1273,11 +1273,11 @@ async_copy_data(int frombio, struct bio *bio, struct page **page,
12731273
!no_skipcopy)
12741274
*page = bio_page;
12751275
else
1276-
tx = async_memcpy(*page, bio_page, page_offset,
1276+
tx = async_memcpy(*page, bio_page, page_offset + poff,
12771277
b_offset, clen, &submit);
12781278
} else
12791279
tx = async_memcpy(bio_page, *page, b_offset,
1280-
page_offset, clen, &submit);
1280+
page_offset + poff, clen, &submit);
12811281
}
12821282
/* chain the operations */
12831283
submit.depend_tx = tx;
@@ -1350,6 +1350,7 @@ static void ops_run_biofill(struct stripe_head *sh)
13501350
while (rbi && rbi->bi_iter.bi_sector <
13511351
dev->sector + RAID5_STRIPE_SECTORS(conf)) {
13521352
tx = async_copy_data(0, rbi, &dev->page,
1353+
dev->offset,
13531354
dev->sector, tx, sh, 0);
13541355
rbi = r5_next_bio(conf, rbi, dev->sector);
13551356
}
@@ -1790,6 +1791,7 @@ ops_run_biodrain(struct stripe_head *sh, struct dma_async_tx_descriptor *tx)
17901791
set_bit(R5_Discard, &dev->flags);
17911792
else {
17921793
tx = async_copy_data(1, wbi, &dev->page,
1794+
dev->offset,
17931795
dev->sector, tx, sh,
17941796
r5c_is_writeback(conf->log));
17951797
if (dev->page != dev->orig_page &&

0 commit comments

Comments
 (0)