diff options
author | Alasdair Kergon <agk@redhat.com> | 2002-04-24 18:20:51 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2002-04-24 18:20:51 +0000 |
commit | 25b733809adcd2f6a8f288c100085068094dcc8a (patch) | |
tree | de7aea488a1c717d589134b324c664ba4aa505a7 /lib/uuid | |
parent | f06bdc437d7eab9569f80ba40cbfca55ffa27104 (diff) | |
download | lvm2-25b733809adcd2f6a8f288c100085068094dcc8a.tar.gz |
Merge with text format branch.
Lots of changes/very little testing so far => there'll be bugs!
Use 'vgcreate -M text' to create a volume group with its metadata stored
in text files. Text format metadata changes should be reasonably atomic,
with a (basic) automatic recovery mechanism if the system crashes while a
change is in progress.
Add a metadata section to lvm.conf to specify multiple directories if
you want (recommended) to keep multiple copies of the metadata (eg on
different filesystems).
e.g. metadata {
dirs = ["/etc/lvm/metadata1","/usr/local/lvm/metadata2"]
}
Plenty of refinements still in the pipeline.
Diffstat (limited to 'lib/uuid')
-rw-r--r-- | lib/uuid/uuid.c | 10 | ||||
-rw-r--r-- | lib/uuid/uuid.h | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/uuid/uuid.c b/lib/uuid/uuid.c index bc13775a8..bff912dec 100644 --- a/lib/uuid/uuid.c +++ b/lib/uuid/uuid.c @@ -19,6 +19,14 @@ static unsigned char _c[] = static int _built_inverse; static unsigned char _inverse_c[256]; +int lvid_create(union lvid *lvid, struct id *vgid) +{ + memcpy(lvid->id, vgid, sizeof(*lvid->id)); + id_create(&lvid->id[1]); + + return 1; +} + int lvid_from_lvnum(union lvid *lvid, struct id *vgid, int lv_num) { int i; @@ -116,7 +124,7 @@ int id_write_format(struct id *id, char *buffer, size_t size) { int i, tot; - static int group_size[] = {6, 4, 4, 4, 4, 4, 6}; + static int group_size[] = { 6, 4, 4, 4, 4, 4, 6 }; assert(ID_LEN == 32); diff --git a/lib/uuid/uuid.h b/lib/uuid/uuid.h index 810fc7c9e..78c451a25 100644 --- a/lib/uuid/uuid.h +++ b/lib/uuid/uuid.h @@ -28,6 +28,7 @@ union lvid { int lvid_from_lvnum(union lvid *lvid, struct id *vgid, int lv_num); int lvnum_from_lvid(union lvid *lvid); +int lvid_create(union lvid *lvid, struct id *vgid); int id_create(struct id *id); int id_valid(struct id *id); int id_equal(struct id *lhs, struct id *rhs); |