Remove superfluous STAT_FORMATTED

STAT_FORMATTED is only used inside snap_to_mebibyte() to suppress
enforcement that partition boundaries must not overlay the MBR or EBRs
when merely formatting existing partitions.  However since commit [1],
snap_to_mebibyte() is only called inside the dialogs composing Create
New, Copy / Paste into New and Resize / Move operations and never when
composing a Format operation or any other operation which doesn't change
partition boundaries.  Therefore remove STAT_FORMATTED.

[1] 7c94b7d920
    Snap partition boundaries before dialogs update FS usage (#48)
This commit is contained in:
Mike Fleetwood 2020-04-05 10:10:12 +01:00 committed by Curtis Gedak
parent c8b4df5879
commit eb6a77c4fd
3 changed files with 4 additions and 9 deletions

View File

@ -43,8 +43,7 @@ enum PartitionType {
enum PartitionStatus {
STAT_REAL = 0,
STAT_NEW = 1,
STAT_COPY = 2,
STAT_FORMATTED = 3
STAT_COPY = 2
};
enum PartitionAlignment {

View File

@ -330,12 +330,9 @@ void Dialog_Base_Partition::snap_to_mebibyte(const Device& device, Partition& pa
// (A) the Master Boot Record sector and the first primary/extended partition, and
// (B) the Extended Boot Record sector and the logical partition.
// If strict_start is set then do not adjust sector start.
// If this partition is not simply queued for a reformat then
// add space minimum to force alignment to next mebibyte.
if (! partition.strict_start &&
partition.free_space_before == 0 &&
partition.status != STAT_FORMATTED )
// If moving the starting sector and no preceding space then add minimum
// space to force alignment to next mebibyte.
if (! partition.strict_start && partition.free_space_before == 0)
{
// Unless specifically told otherwise, the Linux kernel considers extended
// boot records to be two sectors long, in order to "leave room for LILO".

View File

@ -2616,7 +2616,6 @@ void Win_GParted::activate_format( FSType new_fs )
// file system case apart from resize case.
}
temp_ptn->name = selected_partition_ptr->name;
temp_ptn->status = STAT_FORMATTED;
// Generate minimum and maximum partition size limits for the new file system.
FS_Limits fs_limits = gparted_core.get_filesystem_limits( new_fs, temp_ptn->get_filesystem_partition() );