Add device sector size to partition object
The device sector size is needed in all calculations that convert between sectors and bytes. The device sector_size is included in the partition object because this object is used to contain operation information in addition to actual partitions and unallocated space. A second option was considered to pass the device object to many methods, but this was considered a much larger task that might not provide significant gains in maintainability.
This commit is contained in:
parent
acd29683a9
commit
4bcd0a3704
|
@ -115,7 +115,9 @@ public:
|
|||
|
||||
bool strict ; //Indicator if start and end sectors must stay unchanged
|
||||
bool strict_start ; //Indicator if start sector must stay unchanged
|
||||
|
||||
|
||||
Byte_Value sector_size ; //Sector size of the disk device needed for converting to/from sectors and bytes.
|
||||
|
||||
private:
|
||||
void sort_paths_and_remove_duplicates() ;
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ void Partition::Reset()
|
|||
label .clear() ;
|
||||
uuid .clear() ;
|
||||
partition_number = sector_start = sector_end = sectors_used = sectors_unused = -1;
|
||||
sector_size = 0 ;
|
||||
color .set( "black" ) ;
|
||||
inside_extended = busy = strict = strict_start = false ;
|
||||
logicals .clear() ;
|
||||
|
|
Loading…
Reference in New Issue