int sectors = 0;
long long cylinders = 0;
int cylinder_size = 0; /* heads * sectors */
-long long total_size = 0; /* actual_size rounded down */
long long actual_size = 0; /* (in 512-byte sectors) - set using ioctl */
/* explicitly given user values */
int user_heads = 0, user_sectors = 0;
if (i < num_parts - 1)
p_info[i].last_sector = p_info[i+1].first_sector - 1;
else
- p_info[i].last_sector = total_size - 1;
+ p_info[i].last_sector = actual_size - 1;
p_info[i].offset = 0;
p_info[i].flags = 0;
return -1;
}
- if (first >= total_size) {
+ if (first >= actual_size) {
*errmsg = _("Partition begins after end-of-disk");
return -1;
}
return -1;
}
- if (last >= total_size) {
- *errmsg = _("Partition ends in the final partial cylinder");
- return -1;
- }
-
for (i = 0; i < num_parts; i++) {
if (p_info[i].id > 0 && IS_PRIMARY(p_info[i].num))
pri++;
if (user_cylinders > 0)
cylinders = user_cylinders;
- total_size = cylinder_size*cylinders;
- if (total_size > actual_size)
+ if (cylinder_size * cylinders > actual_size)
print_warning(_("You specified more cylinders than fit on disk"));
}
clear_p_info(void) {
num_parts = 1;
p_info[0].first_sector = 0;
- p_info[0].last_sector = total_size - 1;
+ p_info[0].last_sector = actual_size - 1;
p_info[0].offset = 0;
p_info[0].flags = 0;
p_info[0].id = FREE_SPACE;
if (ret_val) {
long long disk_end;
- disk_end = total_size-1;
+ disk_end = actual_size-1;
if (p_info[num_parts-1].last_sector > disk_end) {
while (p_info[num_parts-1].first_sector > disk_end) {