}
if (array.level == 10) {
- int ncopies = (array.layout&255)*(array.layout>>8);
+ int ncopies = (array.layout&255)*((array.layout>>8)&255);
bitmapsize = bitmapsize * array.raid_disks / ncopies;
}
* The bitmap comes immediately after the superblock and must be 60K in size
* at most. The default size is between 30K and 60K
*
- * size is in K, chunk is in bytes !!!
+ * size is in sectors, chunk is in bytes !!!
*/
unsigned long long bits;
unsigned long long max_bits = 60*1024*8;
min_chunk = 4096; /* sub-page chunks don't work yet.. */
- bits = (size * 512)/ min_chunk +1;
+ bits = (size * 512) / min_chunk + 1;
while (bits > max_bits) {
min_chunk *= 2;
bits = (bits+1)/2;
bms->sync_size = __cpu_to_le64(size);
bms->write_behind = __cpu_to_le32(write_behind);
-
-
return 1;
}
* size field is only 32bits.
* So look in /sys/block/mdXXX/md/component_size
*
- * WARNING: this returns in units of Kilobytes.
+ * This returns in units of sectors.
*/
struct stat stb;
char fname[50];
if (n == sizeof(fname))
return 0;
fname[n] = 0;
- return strtoull(fname, NULL, 10);
+ return strtoull(fname, NULL, 10) * 2;
}
int sysfs_set_str(struct sysarray *sra, struct sysdev *dev,