return 1;
}
- ioctl(fd, BLKFLSBUF, 0); /* make sure we read current data */
-
lseek(fd, 0, 0);
if (read(fd, super, sizeof(*super)) != sizeof(*super)) {
if (devname)
free(super);
return 1;
}
-
+
if (super->magic != MBR_SIGNATURE_MAGIC) {
if (devname)
pr_err("No partition table found on %s\n",
return 1;
}
- ioctl(fd, BLKFLSBUF, 0); /* make sure we read current data */
-
lseek(fd, 0, 0);
if (read(fd, old, sizeof(*old)) != sizeof(*old)) {
free(old);
for (i = 0; i < MBR_PARTITIONS ; i++)
if (sb->parts[i].blocks_num) {
- unsigned long last =
+ unsigned long last =
(unsigned long)__le32_to_cpu(sb->parts[i].blocks_num)
+ (unsigned long)__le32_to_cpu(sb->parts[i].first_sect_lba);
if (last > info->component_size)
static int validate_geometry(struct supertype *st, int level,
int layout, int raiddisks,
int *chunk, unsigned long long size,
+ unsigned long long data_offset,
char *subdev, unsigned long long *freesize,
int verbose)
{