diff options
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 0f11fd1417ab..09be637d52cb 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -736,6 +736,24 @@ struct super_type { | |||
736 | }; | 736 | }; |
737 | 737 | ||
738 | /* | 738 | /* |
739 | * Check that the given mddev has no bitmap. | ||
740 | * | ||
741 | * This function is called from the run method of all personalities that do not | ||
742 | * support bitmaps. It prints an error message and returns non-zero if mddev | ||
743 | * has a bitmap. Otherwise, it returns 0. | ||
744 | * | ||
745 | */ | ||
746 | int md_check_no_bitmap(mddev_t *mddev) | ||
747 | { | ||
748 | if (!mddev->bitmap_file && !mddev->bitmap_offset) | ||
749 | return 0; | ||
750 | printk(KERN_ERR "%s: bitmaps are not supported for %s\n", | ||
751 | mdname(mddev), mddev->pers->name); | ||
752 | return 1; | ||
753 | } | ||
754 | EXPORT_SYMBOL(md_check_no_bitmap); | ||
755 | |||
756 | /* | ||
739 | * load_super for 0.90.0 | 757 | * load_super for 0.90.0 |
740 | */ | 758 | */ |
741 | static int super_90_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version) | 759 | static int super_90_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version) |
@@ -788,17 +806,6 @@ static int super_90_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version | |||
788 | rdev->data_offset = 0; | 806 | rdev->data_offset = 0; |
789 | rdev->sb_size = MD_SB_BYTES; | 807 | rdev->sb_size = MD_SB_BYTES; |
790 | 808 | ||
791 | if (sb->state & (1<<MD_SB_BITMAP_PRESENT)) { | ||
792 | if (sb->level != 1 && sb->level != 4 | ||
793 | && sb->level != 5 && sb->level != 6 | ||
794 | && sb->level != 10) { | ||
795 | /* FIXME use a better test */ | ||
796 | printk(KERN_WARNING | ||
797 | "md: bitmaps not supported for this level.\n"); | ||
798 | goto abort; | ||
799 | } | ||
800 | } | ||
801 | |||
802 | if (sb->level == LEVEL_MULTIPATH) | 809 | if (sb->level == LEVEL_MULTIPATH) |
803 | rdev->desc_nr = -1; | 810 | rdev->desc_nr = -1; |
804 | else | 811 | else |
@@ -1176,17 +1183,6 @@ static int super_1_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version) | |||
1176 | bdevname(rdev->bdev,b)); | 1183 | bdevname(rdev->bdev,b)); |
1177 | return -EINVAL; | 1184 | return -EINVAL; |
1178 | } | 1185 | } |
1179 | if ((le32_to_cpu(sb->feature_map) & MD_FEATURE_BITMAP_OFFSET)) { | ||
1180 | if (sb->level != cpu_to_le32(1) && | ||
1181 | sb->level != cpu_to_le32(4) && | ||
1182 | sb->level != cpu_to_le32(5) && | ||
1183 | sb->level != cpu_to_le32(6) && | ||
1184 | sb->level != cpu_to_le32(10)) { | ||
1185 | printk(KERN_WARNING | ||
1186 | "md: bitmaps not supported for this level.\n"); | ||
1187 | return -EINVAL; | ||
1188 | } | ||
1189 | } | ||
1190 | 1186 | ||
1191 | rdev->preferred_minor = 0xffff; | 1187 | rdev->preferred_minor = 0xffff; |
1192 | rdev->data_offset = le64_to_cpu(sb->data_offset); | 1188 | rdev->data_offset = le64_to_cpu(sb->data_offset); |