size = __le32_to_cpu(sb->bblog_size)* 512;
if (posix_memalign((void**)&bbl, 4096, size) != 0) {
- pr_err("%s could not allocate badblocks list\n", __func__);
+ pr_err("could not allocate badblocks list\n");
return 0;
}
offset = __le64_to_cpu(sb->super_offset) +
/* set data_size to device size less data_offset */
struct misc_dev_info *misc = (struct misc_dev_info*)
(st->sb + MAX_SB_SIZE + BM_SUPER_SIZE);
- printf("Size was %llu\n", (unsigned long long)
- __le64_to_cpu(sb->data_size));
sb->data_size = __cpu_to_le64(
misc->device_size - __le64_to_cpu(sb->data_offset));
- printf("Size is %llu\n", (unsigned long long)
- __le64_to_cpu(sb->data_size));
} else if (strcmp(update, "revert-reshape") == 0) {
rv = -2;
if (!(sb->feature_map & __cpu_to_le32(MD_FEATURE_RESHAPE_ACTIVE)))
int sbsize;
if (posix_memalign((void**)&sb, 4096, SUPER1_SIZE) != 0) {
- pr_err("%s could not allocate superblock\n", __func__);
+ pr_err("could not allocate superblock\n");
return 0;
}
memset(sb, 0, SUPER1_SIZE);
if (!first) {
if (posix_memalign((void**)&first, 4096, SUPER1_SIZE) != 0) {
- pr_err("%s could not allocate superblock\n", __func__);
+ pr_err("could not allocate superblock\n");
return 1;
}
memcpy(first, second, SUPER1_SIZE);
}
if (posix_memalign((void**)&super, 4096, SUPER1_SIZE) != 0) {
- pr_err("%s could not allocate superblock\n",
- __func__);
+ pr_err("could not allocate superblock\n");
return 1;
}
* been left.
*/
offset = 0;
- room = choose_bm_space(__le64_to_cpu(sb->size));
bbl_size = 8;
+ room = choose_bm_space(__le64_to_cpu(sb->size)) + bbl_size;
} else {
room = __le64_to_cpu(sb->super_offset)
- __le64_to_cpu(sb->data_offset)
case 2: /* between superblock and data */
if (creating) {
offset = 4*2;
- room = choose_bm_space(__le64_to_cpu(sb->size));
bbl_size = 8;
+ room = choose_bm_space(__le64_to_cpu(sb->size)) + bbl_size;
} else {
room = __le64_to_cpu(sb->data_offset)
- __le64_to_cpu(sb->super_offset);