diff options
author | Patrick Caulfield <pcaulfie@redhat.com> | 2001-12-11 16:49:40 +0000 |
---|---|---|
committer | Patrick Caulfield <pcaulfie@redhat.com> | 2001-12-11 16:49:40 +0000 |
commit | f4a7ce7c49ef3048865901ceb139af08d8a91ae1 (patch) | |
tree | 37285338c3dad08c2a8cf56640a3f93b305a812f /lib/label/label.h | |
parent | 5b82db9a17914cf7df60632cb3ce971c9289de7d (diff) | |
download | lvm2-f4a7ce7c49ef3048865901ceb139af08d8a91ae1.tar.gz lvm2-f4a7ce7c49ef3048865901ceb139af08d8a91ae1.tar.xz lvm2-f4a7ce7c49ef3048865901ceb139af08d8a91ae1.zip |
- 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.
Diffstat (limited to 'lib/label/label.h')
-rw-r--r-- | lib/label/label.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/lib/label/label.h b/lib/label/label.h index c58f07c3..0177976d 100644 --- a/lib/label/label.h +++ b/lib/label/label.h @@ -7,18 +7,25 @@ struct label { uint32_t magic; - uint32_t format_type; uint32_t checksum; uint16_t datalen; - char *data; - void *pool; /* Pool that data is allocated from */ -}; + 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 int is_labelled(struct device *dev); +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(uint32_t format_type); +extern struct dev_filter *label_format_filter_create(char *disk_type, uint32_t version[3], int match_type); |