libvtoc: Introduce is_vol1() check

Introduce is_vol1() in vtoc.h and update the user in libzds.c

Signed-off-by: Eduard Shishkin <edward6@linux.ibm.com>
Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Eduard Shishkin
2022-11-22 12:46:25 +01:00
committed by Jan Höppner
parent 6bd93f475c
commit e09c675b70
2 changed files with 8 additions and 3 deletions
+7
View File
@@ -97,6 +97,13 @@ typedef struct volume_label
unsigned long long formatted_blocks; /* valid when ldl_version >= f2 */
} __attribute__ ((packed)) volume_label_t;
static inline int is_vol1(char *this)
{
char vol1[] = {0xe5, 0xd6, 0xd3, 0xf1, 0x00} /* "VOL1" in EBCDIC */;
return !strncmp(this, vol1, 4);
}
typedef struct extent
{
u_int8_t typeind; /* extent type indicator */