From: Namhyung Kim <namhyung@gmail.com>
To: Neil Brown <neilb@suse.de>
Cc: linux-raid@vger.kernel.org
Subject: [PATCH 5/5] md/raid5: get rid of duplicated call to bio_data_dir()
Date: Wed, 22 Jun 2011 13:50:30 +0900 [thread overview]
Message-ID: <1308718230-2536-6-git-send-email-namhyung@gmail.com> (raw)
In-Reply-To: <1308718230-2536-1-git-send-email-namhyung@gmail.com>
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 <namhyung@gmail.com>
---
drivers/md/raid5.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 6b92e8549e9b..ccaa1102057d 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -4016,7 +4016,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);
@@ -4034,7 +4034,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
--
1.7.5.2
next prev parent reply other threads:[~2011-06-22 4:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-22 4:50 [PATCH 0/5] misc cleanups for RAID5 Namhyung Kim
2011-06-22 4:50 ` [PATCH 1/5] md/raid5: use kmem_cache_zalloc() Namhyung Kim
2011-06-22 4:50 ` [PATCH 2/5] md/raid5: factor out dev_need_read() Namhyung Kim
2011-06-22 4:50 ` [PATCH 3/5] md/raid5: factor out dev_need_for_write() Namhyung Kim
2011-06-22 4:50 ` [PATCH 4/5] md/raid5: use r5_for_each_bio() Namhyung Kim
2011-06-22 4:50 ` Namhyung Kim [this message]
2011-06-23 0:55 ` [PATCH 0/5] misc cleanups for RAID5 NeilBrown
2011-06-23 7:30 ` Namhyung Kim
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=1308718230-2536-6-git-send-email-namhyung@gmail.com \
--to=namhyung@gmail.com \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
/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;
as well as URLs for NNTP newsgroup(s).