]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
md/raid5: Change or of some order to improve efficiency.
authormajianpeng <majianpeng@gmail.com>
Thu, 28 Feb 2013 07:50:47 +0000 (15:50 +0800)
committerNeilBrown <neilb@suse.de>
Wed, 27 Mar 2013 06:14:49 +0000 (17:14 +1100)
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 24909eb13fec1b0bf22e40caa4ff7a76967f80e4..89c549d3ff0f0948de989f0eab52d0e6889f483e 100644 (file)
@@ -4666,9 +4666,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;