Lines Matching refs:mddev

69 	struct mddev md;
241 rs->dev[i].rdev.mddev = &rs->md; in dev_parms()
798 md_error(rdev->mddev, rdev); in read_disk_sb()
807 static void super_sync(struct mddev *mddev, struct md_rdev *rdev) in super_sync() argument
812 struct raid_set *rs = container_of(mddev, struct raid_set, md); in super_sync()
817 for (i = 0; i < mddev->raid_disks; i++) in super_sync()
827 sb->num_devices = cpu_to_le32(mddev->raid_disks); in super_sync()
830 sb->events = cpu_to_le64(mddev->events); in super_sync()
834 sb->array_resync_offset = cpu_to_le64(mddev->recovery_cp); in super_sync()
836 sb->level = cpu_to_le32(mddev->level); in super_sync()
837 sb->layout = cpu_to_le32(mddev->layout); in super_sync()
838 sb->stripe_sectors = cpu_to_le32(mddev->chunk_sectors); in super_sync()
876 super_sync(rdev->mddev, rdev); in super_load()
881 set_bit(MD_CHANGE_DEVS, &rdev->mddev->flags); in super_load()
898 static int super_init_validation(struct mddev *mddev, struct md_rdev *rdev) in super_init_validation() argument
901 struct raid_set *rs = container_of(mddev, struct raid_set, md); in super_init_validation()
917 mddev->events = events_sb ? : 1; in super_init_validation()
922 if (le32_to_cpu(sb->level) != mddev->level) { in super_init_validation()
926 if (le32_to_cpu(sb->layout) != mddev->layout) { in super_init_validation()
928 DMERR(" 0x%X vs 0x%X", le32_to_cpu(sb->layout), mddev->layout); in super_init_validation()
933 raid10_md_layout_to_format(mddev->layout), in super_init_validation()
934 raid10_md_layout_to_copies(mddev->layout)); in super_init_validation()
937 if (le32_to_cpu(sb->stripe_sectors) != mddev->chunk_sectors) { in super_init_validation()
944 (le32_to_cpu(sb->num_devices) != mddev->raid_disks)) { in super_init_validation()
950 mddev->recovery_cp = le64_to_cpu(sb->array_resync_offset); in super_init_validation()
963 rdev_for_each(r, mddev) { in super_init_validation()
973 if (new_devs == mddev->raid_disks) { in super_init_validation()
975 set_bit(MD_ARRAY_FIRST_USE, &mddev->flags); in super_init_validation()
986 } else if (mddev->recovery_cp != MaxSector) { in super_init_validation()
995 rdev_for_each(r, mddev) { in super_init_validation()
1030 struct mddev *mddev = &rs->md; in super_validate() local
1037 if (!mddev->events && super_init_validation(mddev, rdev)) in super_validate()
1041 mddev->bitmap_info.offset = (rs->raid_type->level) ? to_sector(4096) : 0; in super_validate()
1042 rdev->mddev->bitmap_info.default_offset = mddev->bitmap_info.offset; in super_validate()
1073 struct mddev *mddev = &rs->md; in analyse_superblocks() local
1076 rdev_for_each_safe(rdev, tmp, mddev) { in analyse_superblocks()
1150 rdev_for_each(rdev, mddev) in analyse_superblocks()
1331 struct mddev *mddev = &rs->md; in raid_map() local
1333 mddev->pers->make_request(mddev, bio); in raid_map()
1338 static const char *decipher_sync_action(struct mddev *mddev) in decipher_sync_action() argument
1340 if (test_bit(MD_RECOVERY_FROZEN, &mddev->recovery)) in decipher_sync_action()
1343 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) || in decipher_sync_action()
1344 (!mddev->ro && test_bit(MD_RECOVERY_NEEDED, &mddev->recovery))) { in decipher_sync_action()
1345 if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery)) in decipher_sync_action()
1348 if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) { in decipher_sync_action()
1349 if (!test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) in decipher_sync_action()
1351 else if (test_bit(MD_RECOVERY_CHECK, &mddev->recovery)) in decipher_sync_action()
1356 if (test_bit(MD_RECOVERY_RECOVER, &mddev->recovery)) in decipher_sync_action()
1545 struct mddev *mddev = &rs->md; in raid_message() local
1552 if (!mddev->pers || !mddev->pers->sync_request) in raid_message()
1556 set_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in raid_message()
1558 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in raid_message()
1561 if (mddev->sync_thread) { in raid_message()
1562 set_bit(MD_RECOVERY_INTR, &mddev->recovery); in raid_message()
1563 md_reap_sync_thread(mddev); in raid_message()
1565 } else if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) || in raid_message()
1566 test_bit(MD_RECOVERY_NEEDED, &mddev->recovery)) in raid_message()
1569 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in raid_message()
1571 set_bit(MD_RECOVERY_RECOVER, &mddev->recovery); in raid_message()
1572 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in raid_message()
1575 set_bit(MD_RECOVERY_CHECK, &mddev->recovery); in raid_message()
1578 set_bit(MD_RECOVERY_REQUESTED, &mddev->recovery); in raid_message()
1579 set_bit(MD_RECOVERY_SYNC, &mddev->recovery); in raid_message()
1581 if (mddev->ro == 2) { in raid_message()
1585 mddev->ro = 0; in raid_message()
1586 if (!mddev->suspended) in raid_message()
1587 md_wakeup_thread(mddev->sync_thread); in raid_message()
1589 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in raid_message()
1590 if (!mddev->suspended) in raid_message()
1591 md_wakeup_thread(mddev->thread); in raid_message()
1664 (r->mddev->pers->hot_remove_disk(r->mddev, r) != 0)) in attempt_restore_of_faulty_devices()
1674 if (r->mddev->pers->hot_add_disk(r->mddev, r)) { in attempt_restore_of_faulty_devices()