diff options
author | srs5694 <srs5694@users.sourceforge.net> | 2010-03-19 14:21:59 -0400 |
---|---|---|
committer | srs5694 <srs5694@users.sourceforge.net> | 2010-03-19 14:21:59 -0400 |
commit | a8582cfe6c1aa5e5f80458ac72d881a04ae0ba44 (patch) | |
tree | 93cbbc9e8013e2404ab2fe7740eccdf28dc966cf /gpt.h | |
parent | 55d926192adc984462509b2966e23bc0d1129bbd (diff) | |
download | sgdisk-a8582cfe6c1aa5e5f80458ac72d881a04ae0ba44.tar.gz |
Changes to sector alignment policies and behavior when restoring a
backup fails
Diffstat (limited to 'gpt.h')
-rw-r--r-- | gpt.h | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -16,7 +16,7 @@ #ifndef __GPTSTRUCTS #define __GPTSTRUCTS -#define GPTFDISK_VERSION "0.6.5" +#define GPTFDISK_VERSION "0.6.6-pre1" // Constants used by GPTData::PartsToMBR(). MBR_EMPTY must be the lowest- // numbered value to refer to partition numbers. (Most will be 0 or positive, @@ -24,6 +24,16 @@ #define MBR_EFI_GPT -1 #define MBR_EMPTY -2 +// Default values for sector alignment +#define DEFAULT_ALIGNMENT 2048 +#define MAX_ALIGNMENT 32768 + +// Below constant corresponds to an 800GB disk -- a somewhat arbitrary +// cutoff +//#define SMALLEST_ADVANCED_FORMAT UINT64_C(1677721600) +// Now ~596GiB (640MB), since WD has introduced a smaller Advanced Format drive +#define SMALLEST_ADVANCED_FORMAT UINT64_C(1250263728) + using namespace std; class PartNotes; @@ -79,7 +89,7 @@ protected: int secondPartsCrcOk; int apmFound; // set to 1 if APM detected int bsdFound; // set to 1 if BSD disklabel detected in MBR - int sectorAlignment; // Start & end partitions at multiples of sectorAlignment + uint32_t sectorAlignment; // Start & end partitions at multiples of sectorAlignment int beQuiet; WhichToUse whichWasUsed; @@ -177,8 +187,9 @@ public: int IsFreePartNum(uint32_t partNum); // Change how functions work, or return information on same - void SetAlignment(int n) {sectorAlignment = n;} - int GetAlignment(void) {return sectorAlignment;} + void SetAlignment(uint32_t n); + uint32_t ComputeAlignment(void); // Set alignment based on current partitions + uint32_t GetAlignment(void) {return sectorAlignment;} void JustLooking(int i = 1) {justLooking = i;} void BeQuiet(int i = 1) {beQuiet = i;} WhichToUse WhichWasUsed(void) {return whichWasUsed;} |