From 9d3d9754e7af4799aa5872f5ab394f93c725f0fe Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 4 Feb 2013 18:29:05 +0100 Subject: [PATCH] libblkid: rename in sun_disklabel for compatibility with fdisk Signed-off-by: Karel Zak --- include/pt-sun.h | 18 ++++++++++-------- libblkid/src/partitions/sun.c | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/include/pt-sun.h b/include/pt-sun.h index 8ced5801d..b085268ca 100644 --- a/include/pt-sun.h +++ b/include/pt-sun.h @@ -3,17 +3,19 @@ #include +#define SUN_LABEL_MAGIC 0xDABE + /* Supported VTOC setting */ #define SUN_VTOC_SANITY 0x600DDEEE /* magic number */ #define SUN_VTOC_VERSION 1 #define SUN_MAXPARTITIONS 8 struct sun_disklabel { - unsigned char info[128]; /* Informative text string */ + unsigned char label_id[128]; /* Informative text string */ struct sun_vtoc { uint32_t version; /* version */ - char volume[8]; /* volume name */ + char volume_id[8];/* volume name */ uint16_t nparts; /* num of partitions */ struct sun_info { /* partition information */ @@ -31,15 +33,15 @@ struct sun_disklabel { uint32_t write_reinstruct; /* sectors to skip, writes */ uint32_t read_reinstruct; /* sectors to skip, reads */ unsigned char spare[148]; /* padding */ - uint16_t rspeed; /* disk rotational speed */ - uint16_t pcylcount; /* physical cylinder count */ - uint16_t sparecyl; /* extra sects per cylinder */ + uint16_t rpm; /* disk rotational speed */ + uint16_t pcyl; /* physical cylinder count */ + uint16_t apc; /* extra sects per cylinder */ uint16_t obs1; uint16_t obs2; - uint16_t ilfact; /* interleave factor */ + uint16_t intrlv; /* interleave factor */ uint16_t ncyl; /* data cylinder count */ - uint16_t nacyl; /* alt. cylinder count */ - uint16_t ntrks; /* tracks per cylinder <---- */ + uint16_t acyl; /* alt. cylinder count */ + uint16_t nhead; /* tracks per cylinder <---- */ uint16_t nsect; /* sectors per track <---- */ uint16_t obs3; uint16_t obs4; diff --git a/libblkid/src/partitions/sun.c b/libblkid/src/partitions/sun.c index f1b839258..c2c700d96 100644 --- a/libblkid/src/partitions/sun.c +++ b/libblkid/src/partitions/sun.c @@ -49,7 +49,7 @@ static int probe_sun_pt(blkid_probe pr, goto err; /* sectors per cylinder (partition offset is in cylinders...) */ - spc = be16_to_cpu(l->ntrks) * be16_to_cpu(l->nsect); + spc = be16_to_cpu(l->nhead) * be16_to_cpu(l->nsect); DBG(DEBUG_LOWPROBE, printf("Sun VTOC sanity=%u version=%u nparts=%u\n",