diff options
author | NeilBrown <neilb@suse.de> | 2012-03-18 21:46:40 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-03-18 21:46:40 -0400 |
commit | 278c1ca2f254d0695d2eba79793d20ce785323ea (patch) | |
tree | 42be282251b17c16e030d7083eef4bbeefe60b41 /drivers/md/bitmap.c | |
parent | 57148964d946614ffc6621539096ded1e7d896ab (diff) |
md/bitmap: change a 'goto' to a normal 'if' construct.
The use of a goto makes the control flow more obscure here.
So make it a normal:
if (x) {
Y;
}
No functional change.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/bitmap.c')
-rw-r--r-- | drivers/md/bitmap.c | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 04df18e8885f..fcf3c9465fd8 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -633,26 +633,28 @@ static int bitmap_read_sb(struct bitmap *bitmap) | |||
633 | /* keep the array size field of the bitmap superblock up to date */ | 633 | /* keep the array size field of the bitmap superblock up to date */ |
634 | sb->sync_size = cpu_to_le64(bitmap->mddev->resync_max_sectors); | 634 | sb->sync_size = cpu_to_le64(bitmap->mddev->resync_max_sectors); |
635 | 635 | ||
636 | if (!bitmap->mddev->persistent) | 636 | if (bitmap->mddev->persistent) { |
637 | goto success; | 637 | /* |
638 | 638 | * We have a persistent array superblock, so compare the | |
639 | /* | 639 | * bitmap's UUID and event counter to the mddev's |
640 | * if we have a persistent array superblock, compare the | 640 | */ |
641 | * bitmap's UUID and event counter to the mddev's | 641 | if (memcmp(sb->uuid, bitmap->mddev->uuid, 16)) { |
642 | */ | 642 | printk(KERN_INFO |
643 | if (memcmp(sb->uuid, bitmap->mddev->uuid, 16)) { | 643 | "%s: bitmap superblock UUID mismatch\n", |
644 | printk(KERN_INFO "%s: bitmap superblock UUID mismatch\n", | 644 | bmname(bitmap)); |
645 | bmname(bitmap)); | 645 | goto out; |
646 | goto out; | 646 | } |
647 | } | 647 | events = le64_to_cpu(sb->events); |
648 | events = le64_to_cpu(sb->events); | 648 | if (events < bitmap->mddev->events) { |
649 | if (events < bitmap->mddev->events) { | 649 | printk(KERN_INFO |
650 | printk(KERN_INFO "%s: bitmap file is out of date (%llu < %llu) " | 650 | "%s: bitmap file is out of date (%llu < %llu) " |
651 | "-- forcing full recovery\n", bmname(bitmap), events, | 651 | "-- forcing full recovery\n", |
652 | (unsigned long long) bitmap->mddev->events); | 652 | bmname(bitmap), events, |
653 | sb->state |= cpu_to_le32(BITMAP_STALE); | 653 | (unsigned long long) bitmap->mddev->events); |
654 | sb->state |= cpu_to_le32(BITMAP_STALE); | ||
655 | } | ||
654 | } | 656 | } |
655 | success: | 657 | |
656 | /* assign fields using values from superblock */ | 658 | /* assign fields using values from superblock */ |
657 | bitmap->mddev->bitmap_info.chunksize = chunksize; | 659 | bitmap->mddev->bitmap_info.chunksize = chunksize; |
658 | bitmap->mddev->bitmap_info.daemon_sleep = daemon_sleep; | 660 | bitmap->mddev->bitmap_info.daemon_sleep = daemon_sleep; |