diff options
author | NeilBrown <neilb@suse.de> | 2011-12-22 18:17:52 -0500 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-12-22 18:17:52 -0500 |
commit | 995c4275a7e14b8752f301e4570831a108ae4303 (patch) | |
tree | 2bee4c8daf14b6453371bb348b18d37d7e3cdb07 /drivers/md/raid5.c | |
parent | ede7ee8b4d007f308aa033be676b1a048f99e9db (diff) |
md/raid5: remove redundant bio initialisations.
We current initialise some fields of a bio when preparing a
stripe_head, and again just before submitting the request.
Remove the duplication by only setting the fields that lower level
devices don't touch in raid5_build_block, and only set the changeable
fields in ops_run_io.
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r-- | drivers/md/raid5.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 94bc35ba4c81..2d2aaf6e98e2 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -574,10 +574,7 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s) | |||
574 | atomic_inc(&sh->count); | 574 | atomic_inc(&sh->count); |
575 | bi->bi_sector = sh->sector + rdev->data_offset; | 575 | bi->bi_sector = sh->sector + rdev->data_offset; |
576 | bi->bi_flags = 1 << BIO_UPTODATE; | 576 | bi->bi_flags = 1 << BIO_UPTODATE; |
577 | bi->bi_vcnt = 1; | ||
578 | bi->bi_max_vecs = 1; | ||
579 | bi->bi_idx = 0; | 577 | bi->bi_idx = 0; |
580 | bi->bi_io_vec = &sh->dev[i].vec; | ||
581 | bi->bi_io_vec[0].bv_len = STRIPE_SIZE; | 578 | bi->bi_io_vec[0].bv_len = STRIPE_SIZE; |
582 | bi->bi_io_vec[0].bv_offset = 0; | 579 | bi->bi_io_vec[0].bv_offset = 0; |
583 | bi->bi_size = STRIPE_SIZE; | 580 | bi->bi_size = STRIPE_SIZE; |
@@ -1720,12 +1717,8 @@ static void raid5_build_block(struct stripe_head *sh, int i, int previous) | |||
1720 | dev->req.bi_io_vec = &dev->vec; | 1717 | dev->req.bi_io_vec = &dev->vec; |
1721 | dev->req.bi_vcnt++; | 1718 | dev->req.bi_vcnt++; |
1722 | dev->req.bi_max_vecs++; | 1719 | dev->req.bi_max_vecs++; |
1723 | dev->vec.bv_page = dev->page; | ||
1724 | dev->vec.bv_len = STRIPE_SIZE; | ||
1725 | dev->vec.bv_offset = 0; | ||
1726 | |||
1727 | dev->req.bi_sector = sh->sector; | ||
1728 | dev->req.bi_private = sh; | 1720 | dev->req.bi_private = sh; |
1721 | dev->vec.bv_page = dev->page; | ||
1729 | 1722 | ||
1730 | dev->flags = 0; | 1723 | dev->flags = 0; |
1731 | dev->sector = compute_blocknr(sh, i, previous); | 1724 | dev->sector = compute_blocknr(sh, i, previous); |