md/raid5: Change or of some order to improve efficiency.
authormajianpeng <majianpeng@gmail.com>
Wed, 24 Apr 2013 01:42:41 +0000 (11:42 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 24 Apr 2013 01:42:41 +0000 (11:42 +1000)
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>
drivers/md/raid5.c

index f4e87bfc7567923944d2fce13da4c7d636479566..f31882c1197a82b58e004000f1aea3a32fce1b35 100644 (file)
@@ -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;