Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ffd96e35 authored by Namhyung Kim's avatar Namhyung Kim Committed by NeilBrown
Browse files

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: default avatarNamhyung Kim <namhyung@gmail.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 6ce32846
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -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_lo &&
			    logical_sector < mddev->suspend_hi) {
			    logical_sector < mddev->suspend_hi) {
				release_stripe(sh);
				release_stripe(sh);
@@ -4032,7 +4032,7 @@ static int make_request(mddev_t *mddev, struct bio * bi)
			}
			}


			if (test_bit(STRIPE_EXPANDING, &sh->state) ||
			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
				/* Stripe is busy expanding or
				 * add failed due to overlap.  Flush everything
				 * add failed due to overlap.  Flush everything
				 * and wait a while
				 * and wait a while