summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
authormajianpeng <majianpeng@gmail.com>2013-04-24 03:42:41 +0200
committerNeilBrown <neilb@suse.de>2013-04-24 03:42:41 +0200
commit6f608040ce6cf37475dd2f6f3c97b009dab7c1d1 (patch)
tree9aac3a9fe0a3090ac1425a95e50565b356d3d585 /drivers/md/raid5.c
parentmd: use set_bit_le and clear_bit_le (diff)
downloadlinux-6f608040ce6cf37475dd2f6f3c97b009dab7c1d1.tar.xz
linux-6f608040ce6cf37475dd2f6f3c97b009dab7c1d1.zip
md/raid5: Change or of some order to improve efficiency.
As the function call is the most expensive of these tests it should be done later in the chain so that it can be avoided in some cases. Signed-off-by: Jianpeng Ma <majianpeng@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r--drivers/md/raid5.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index f4e87bfc7567..f31882c1197a 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -4672,9 +4672,10 @@ static inline sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int
*skipped = 1;
return rv;
}
- if (!bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 1) &&
- !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery) &&
- !conf->fullsync && sync_blocks >= STRIPE_SECTORS) {
+ if (!test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery) &&
+ !conf->fullsync &&
+ !bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 1) &&
+ sync_blocks >= STRIPE_SECTORS) {
/* we can skip this block, and probably more */
sync_blocks /= STRIPE_SECTORS;
*skipped = 1;