__u32 *p = (__u32 *) mpb;
__u32 sum = 0;
- while (end--) {
- sum += __le32_to_cpu(*p);
+ while (end--) {
+ sum += __le32_to_cpu(*p);
p++;
}
- return sum - __le32_to_cpu(mpb->check_sum);
+ return sum - __le32_to_cpu(mpb->check_sum);
}
static size_t sizeof_imsm_map(struct imsm_map *map)
struct intel_super *first = st->sb;
struct intel_super *sec = tst->sb;
- if (!first) {
- st->sb = tst->sb;
- tst->sb = NULL;
- return 0;
- }
+ if (!first) {
+ st->sb = tst->sb;
+ tst->sb = NULL;
+ return 0;
+ }
/* in platform dependent environment test if the disks
* use the same Intel hba
+ * If not on Intel hba at all, allow anything.
*/
if (!check_env("IMSM_NO_PLATFORM")) {
- if (!first->hba || !sec->hba ||
- (first->hba->type != sec->hba->type)) {
+ if (first->hba && sec->hba &&
+ first->hba->type != sec->hba->type) {
fprintf(stderr,
"HBAs of devices does not match %s != %s\n",
first->hba ? get_sys_dev_type(first->hba->type) : NULL,
struct intel_super*s = NULL;
char nm[32];
int dfd = -1;
- int rv;
int err = 0;
int retry;
goto error;
}
- rv = find_intel_hba_capability(dfd, s, devname);
- /* no orom/efi or non-intel hba of the disk */
- if (rv != 0) {
- err = 4;
- goto error;
- }
-
+ find_intel_hba_capability(dfd, s, devname);
err = load_and_parse_mpb(dfd, s, NULL, keep_fd);
/* retry the load if we might have raced against mdmon */
static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info,
unsigned long long size, char *name,
- char *homehost, int *uuid)
+ char *homehost, int *uuid,
+ long long data_offset)
{
/* We are creating a volume inside a pre-existing container.
* so st->sb is already set.
map->blocks_per_strip = __cpu_to_le16(info_to_blocks_per_strip(info));
map->failed_disk_num = ~0;
if (info->level > 0)
- map->map_state = IMSM_T_STATE_UNINITIALIZED;
+ map->map_state = (info->state ? IMSM_T_STATE_NORMAL
+ : IMSM_T_STATE_UNINITIALIZED);
else
map->map_state = info->failed_disks ? IMSM_T_STATE_FAILED :
IMSM_T_STATE_NORMAL;
static int init_super_imsm(struct supertype *st, mdu_array_info_t *info,
unsigned long long size, char *name,
- char *homehost, int *uuid)
+ char *homehost, int *uuid,
+ unsigned long long data_offset)
{
/* This is primarily called by Create when creating a new array.
* We will then get add_to_super called for each component, and then
size_t mpb_size;
char *version;
+ if (data_offset != INVALID_SECTORS) {
+ fprintf(stderr, Name ": data-offset not supported by imsm\n");
+ return 0;
+ }
+
if (st->sb)
- return init_super_imsm_volume(st, info, size, name, homehost, uuid);
+ return init_super_imsm_volume(st, info, size, name, homehost, uuid,
+ data_offset);
if (info)
mpb_size = disks_to_mpb_size(info->nr_disks);
}
static int add_to_super_imsm(struct supertype *st, mdu_disk_info_t *dk,
- int fd, char *devname)
+ int fd, char *devname,
+ unsigned long long data_offset)
{
struct intel_super *super = st->sb;
struct dl *dd;
return 0;
}
- /* capabilities of OROM tested - copied from validate_geometry_imsm_volume */
+ /* capabilities of OROM tested - copied from validate_geometry_imsm_volume */
if (!is_raid_level_supported(super->orom, level, raiddisks)) {
pr_vrb(": platform does not support raid%d with %d disk%s\n",
level, raiddisks, raiddisks > 1 ? "s" : "");