Lines Matching full:layout
220 * raid set level, layout and chunk sectors backup/restore
298 …aid4 (dedicated first parity disk)", 1, 2, 5, ALGORITHM_PARITY_0}, /* raid4 layout = raid5_0 */
429 static bool __is_raid10_far(int layout);
525 #define RAID10_FAR_COPIES_SHIFT 8 /* raid10 # far copies shift (2nd byte of layout) */
527 /* Return md raid10 near copies for @layout */
528 static unsigned int __raid10_near_copies(int layout) in __raid10_near_copies() argument
530 return layout & 0xFF; in __raid10_near_copies()
533 /* Return md raid10 far copies for @layout */
534 static unsigned int __raid10_far_copies(int layout) in __raid10_far_copies() argument
536 return __raid10_near_copies(layout >> RAID10_FAR_COPIES_SHIFT); in __raid10_far_copies()
539 /* Return true if md raid10 offset for @layout */
540 static bool __is_raid10_offset(int layout) in __is_raid10_offset() argument
542 return !!(layout & RAID10_OFFSET); in __is_raid10_offset()
545 /* Return true if md raid10 near for @layout */
546 static bool __is_raid10_near(int layout) in __is_raid10_near() argument
548 return !__is_raid10_offset(layout) && __raid10_near_copies(layout) > 1; in __is_raid10_near()
551 /* Return true if md raid10 far for @layout */
552 static bool __is_raid10_far(int layout) in __is_raid10_far() argument
554 return !__is_raid10_offset(layout) && __raid10_far_copies(layout) > 1; in __is_raid10_far()
557 /* Return md raid10 layout string for @layout */
558 static const char *raid10_md_layout_to_format(int layout) in raid10_md_layout_to_format() argument
566 if (__is_raid10_offset(layout)) in raid10_md_layout_to_format()
569 if (__raid10_near_copies(layout) > 1) in raid10_md_layout_to_format()
572 if (__raid10_far_copies(layout) > 1) in raid10_md_layout_to_format()
591 /* Return md raid10 copies for @layout */
592 static unsigned int raid10_md_layout_to_copies(int layout) in raid10_md_layout_to_copies() argument
594 return max(__raid10_near_copies(layout), __raid10_far_copies(layout)); in raid10_md_layout_to_copies()
635 static bool __got_raid10(struct raid_type *rtp, const int layout) in __got_raid10() argument
641 return __is_raid10_near(layout); in __got_raid10()
643 return __is_raid10_offset(layout); in __got_raid10()
645 return __is_raid10_far(layout); in __got_raid10()
666 /* Return raid_type for @name based derived from @level and @layout */
667 static struct raid_type *get_raid_type_by_ll(const int level, const int layout) in get_raid_type_by_ll() argument
672 /* RAID10 special checks based on @layout flags/properties */ in get_raid_type_by_ll()
674 (__got_raid10(rtp, layout) || rtp->algorithm == layout)) in get_raid_type_by_ll()
716 mddev->new_layout = mddev->layout; in rs_set_cur()
729 mddev->layout = mddev->new_layout; in rs_set_new()
763 rs->md.layout = raid_type->algorithm; in raid_set_alloc()
764 rs->md.new_layout = rs->md.layout; in raid_set_alloc()
1120 * [raid10_format <near|far|offset>] Layout algorithm. (Default: near)
1510 rs->ti->error = "Failed to recognize new raid10 layout"; in parse_raid_params()
1750 if (__is_raid10_offset(mddev->layout)) in rs_check_takeover()
1753 near_copies = __raid10_near_copies(mddev->layout); in rs_check_takeover()
1767 __raid10_far_copies(mddev->layout) > 1) in rs_check_takeover()
1775 max(near_copies, __raid10_far_copies(mddev->layout)) == mddev->raid_disks) in rs_check_takeover()
1814 mddev->layout == ALGORITHM_PARITY_N) in rs_check_takeover()
1821 mddev->layout == ALGORITHM_PARITY_N) in rs_check_takeover()
1826 mddev->layout == ALGORITHM_PARITY_N) in rs_check_takeover()
1836 ((mddev->layout == ALGORITHM_PARITY_N && mddev->new_layout == ALGORITHM_PARITY_N) || in rs_check_takeover()
1844 mddev->layout == ALGORITHM_PARITY_N) in rs_check_takeover()
1849 mddev->layout == ALGORITHM_PARITY_N) in rs_check_takeover()
1854 ((mddev->layout == ALGORITHM_PARITY_N && mddev->new_layout == ALGORITHM_PARITY_N) || in rs_check_takeover()
1884 change = mddev->new_layout != mddev->layout || in rs_reshape_requested()
1944 __le32 layout; member
1975 * them from old to new layout
2112 sb->layout = cpu_to_le32(mddev->layout); in super_sync()
2224 mddev->layout = le32_to_cpu(sb->layout); in super_init_validation()
2232 /* Superblock is authoritative wrt given raid set layout! */ in super_init_validation()
2253 rs->raid_type = get_raid_type_by_ll(mddev->level, mddev->layout); in super_init_validation()
2260 struct raid_type *rt_cur = get_raid_type_by_ll(mddev->level, mddev->layout); in super_init_validation()
2271 DMERR("Reshaping raid sets not yet supported by metadata. (raid layout change keeping level)"); in super_init_validation()
2272 if (mddev->layout != mddev->new_layout) { in super_init_validation()
2274 DMERR(" current layout %s vs new layout %s", in super_init_validation()
2277 DMERR(" current layout 0x%X vs new layout 0x%X", in super_init_validation()
2278 le32_to_cpu(sb->layout), mddev->new_layout); in super_init_validation()
2287 DMERR(" Old layout: %s w/ %u copies", in super_init_validation()
2288 raid10_md_layout_to_format(mddev->layout), in super_init_validation()
2289 raid10_md_layout_to_copies(mddev->layout)); in super_init_validation()
2290 DMERR(" New layout: %s w/ %u copies", in super_init_validation()
2392 if (rs_is_raid10(rs) && __is_raid10_near(mddev->layout)) { in super_init_validation()
2393 if (mddev->raid_disks % __raid10_near_copies(mddev->layout) || in super_init_validation()
2637 * Changing RAID layout or chunk size -> toggle offsets in rs_adjust_data_offsets()
2712 /* raid0 -> raid10_far layout */ in rs_setup_takeover()
2713 mddev->layout = raid10_format_to_md_layout(rs, ALGORITHM_RAID10_FAR, in rs_setup_takeover()
2716 /* raid1 -> raid10_near layout */ in rs_setup_takeover()
2717 mddev->layout = raid10_format_to_md_layout(rs, ALGORITHM_RAID10_NEAR, in rs_setup_takeover()
2752 __is_raid10_near(mddev->layout) && in rs_prepare_reshape()
2754 rs->raid10_copies != __raid10_near_copies(mddev->layout)) { in rs_prepare_reshape()
2768 mddev->layout = raid10_format_to_md_layout(rs, ALGORITHM_RAID10_NEAR, in rs_prepare_reshape()
2770 mddev->new_layout = mddev->layout; in rs_prepare_reshape()
2822 * - change raid layout
2838 /* Ignore impossible layout change whilst adding/removing disks */ in rs_setup_reshape()
2840 mddev->layout != mddev->new_layout) { in rs_setup_reshape()
2841 DMINFO("Ignoring invalid layout change with delta_disks=%d", rs->delta_disks); in rs_setup_reshape()
2842 mddev->new_layout = mddev->layout; in rs_setup_reshape()
2892 /* Change layout and/or chunk size */ in rs_setup_reshape()
2895 * Reshape layout (e.g. raid5_ls -> raid5_n) and/or chunk size: in rs_setup_reshape()
2897 * keeping number of disks and do layout change -> in rs_setup_reshape()
2908 * case of layout/chunksize change (for disk in rs_setup_reshape()
3053 * Backup any new raid set level, layout, ... in raid_ctr()
3084 /* Restore any requested new layout for conversion decision */ in raid_ctr()
3267 /* Restore new, ctr requested layout to perform check */ in raid_ctr()
3536 * changing the raid layout or the number of in raid_status()
3632 raid10_md_layout_to_copies(mddev->layout)); in raid_status()
3635 raid10_md_layout_to_format(mddev->layout)); in raid_status()