Skip to content

Commit

Permalink
md/raid5: Change or of some order to improve efficiency.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: NeilBrown <[email protected]>
  • Loading branch information
majianpeng authored and neilbrown committed Apr 24, 2013
1 parent 3f810b6 commit 6f60804
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6f60804

Please sign in to comment.