1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

raid: Detect whether or not kernel supports raid0.

This commit is contained in:
Heinz Mauelshagen 2015-09-24 19:52:22 +01:00 committed by Alasdair G Kergon
parent 4a74e19f80
commit 028715b0f0
2 changed files with 4 additions and 0 deletions

View File

@ -60,6 +60,7 @@ struct dev_manager;
#define SEG_TYPE_NAME_FREE "free" #define SEG_TYPE_NAME_FREE "free"
#define SEG_TYPE_NAME_ZERO "zero" #define SEG_TYPE_NAME_ZERO "zero"
#define SEG_TYPE_NAME_RAID "raid" #define SEG_TYPE_NAME_RAID "raid"
#define SEG_TYPE_NAME_RAID0 "raid0"
#define SEG_TYPE_NAME_RAID1 "raid1" #define SEG_TYPE_NAME_RAID1 "raid1"
#define SEG_TYPE_NAME_RAID10 "raid10" #define SEG_TYPE_NAME_RAID10 "raid10"
#define SEG_TYPE_NAME_RAID4 "raid4" #define SEG_TYPE_NAME_RAID4 "raid4"
@ -205,6 +206,8 @@ struct segment_type *init_unknown_segtype(struct cmd_context *cmd,
const char *name); const char *name);
#define RAID_FEATURE_RAID10 (1U << 0) /* version 1.3 */ #define RAID_FEATURE_RAID10 (1U << 0) /* version 1.3 */
#define RAID_FEATURE_RAID0 (1U << 1) /* version 1.7 */
#define RAID_FEATURE_RESHAPING (1U << 2) /* version 1.8 */
#ifdef RAID_INTERNAL #ifdef RAID_INTERNAL
int init_raid_segtypes(struct cmd_context *cmd, struct segtype_library *seglib); int init_raid_segtypes(struct cmd_context *cmd, struct segtype_library *seglib);

View File

@ -331,6 +331,7 @@ static int _raid_target_present(struct cmd_context *cmd,
const char *feature; const char *feature;
} _features[] = { } _features[] = {
{ 1, 3, RAID_FEATURE_RAID10, SEG_TYPE_NAME_RAID10 }, { 1, 3, RAID_FEATURE_RAID10, SEG_TYPE_NAME_RAID10 },
{ 1, 7, RAID_FEATURE_RAID0, SEG_TYPE_NAME_RAID0 },
}; };
static int _raid_checked = 0; static int _raid_checked = 0;