From: Namhyung Kim Date: Mon, 18 Jul 2011 07:38:51 +0000 (+1000) Subject: md/raid5: get rid of duplicated call to bio_data_dir() X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=ffd96e35c16a99fdb490cc5723b8e32135ae5883;p=~shefty%2Frdma-dev.git md/raid5: get rid of duplicated call to bio_data_dir() In raid5::make_request(), once bio_data_dir(@bi) is detected it never (and couldn't) be changed. Use the result always. Signed-off-by: Namhyung Kim Signed-off-by: NeilBrown --- diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 0f71aa9a07c..71480646a45 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -4014,7 +4014,7 @@ static int make_request(mddev_t *mddev, struct bio * bi) } } - if (bio_data_dir(bi) == WRITE && + if (rw == WRITE && logical_sector >= mddev->suspend_lo && logical_sector < mddev->suspend_hi) { release_stripe(sh); @@ -4032,7 +4032,7 @@ static int make_request(mddev_t *mddev, struct bio * bi) } if (test_bit(STRIPE_EXPANDING, &sh->state) || - !add_stripe_bio(sh, bi, dd_idx, (bi->bi_rw&RW_MASK))) { + !add_stripe_bio(sh, bi, dd_idx, rw)) { /* Stripe is busy expanding or * add failed due to overlap. Flush everything * and wait a while