From: "majianpeng" <majianpeng@gmail.com>
To: Neil Brown <neilb@suse.de>
Cc: linux-raid <linux-raid@vger.kernel.org>
Subject: [PATCH] md/raid456:Remove the judgement atomic_read(&rdev->read_errors).
Date: Wed, 23 May 2012 20:38:16 +0800 [thread overview]
Message-ID: <201205232038121562929@gmail.com> (raw)
It isn't necessary to judge.Because the atomic_read and atomic_set is excuce same cpu. So
read_errors is zero or not, directly set it zero.
Signed-off-by: majianpeng <majianpeng@gmail.com>
---
drivers/md/raid5.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index f351422..1fe2def 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1690,8 +1690,7 @@ static void raid5_end_read_request(struct bio * bi, int error)
clear_bit(R5_ReadError, &sh->dev[i].flags);
clear_bit(R5_ReWrite, &sh->dev[i].flags);
}
- if (atomic_read(&rdev->read_errors))
- atomic_set(&rdev->read_errors, 0);
+ atomic_set(&rdev->read_errors, 0);
} else {
const char *bdn = bdevname(rdev->bdev, b);
int retry = 0;
--
1.7.5.4
--------------
majianpeng
2012-05-23
next reply other threads:[~2012-05-23 12:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-23 12:38 majianpeng [this message]
2012-05-23 23:40 ` [PATCH] md/raid456:Remove the judgement atomic_read(&rdev->read_errors) NeilBrown
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=201205232038121562929@gmail.com \
--to=majianpeng@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.