1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-10-15 19:33:17 +03:00
Files
lvm2/lib/label/label.h
Patrick Caulfield 676b401294 - Change label format to include a string disk_type and a version number.
- The iterator can find labels by string and also appropriate version number (==,
  <= or any) if you want.
- Add labels_match() call that compares the two labels and returns an error if
  they do not match.
- Write labels in sector 1 & last rather than 2 & last as per Joe.
2001-12-11 16:49:40 +00:00

32 lines
864 B
C

/*
* Copyright (C) 2001 Sistina Software (UK) Limited.
*
* This file is released under the GPL.
*/
struct label
{
uint32_t magic;
uint32_t checksum;
uint16_t datalen;
char disk_type[32];
uint32_t version[3];
char *data; /* Should be freed with label_free() */
};
#define VERSION_MATCH_EQUAL 1
#define VERSION_MATCH_LESSTHAN 2
#define VERSION_MATCH_LESSEQUAL 3
#define VERSION_MATCH_ANY 4
extern int label_write(struct device *dev, struct label *label);
extern int label_read(struct device *dev, struct label *label);
extern void label_free(struct label *label);
extern int is_labelled(struct device *dev);
extern int labels_match(struct device *dev);
extern struct dev_filter *label_filter_create();
extern struct dev_filter *label_format_filter_create(char *disk_type, uint32_t version[3], int match_type);