1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 11:55:55 +03:00
lvm2/lib/metadata
Dave Wysochanski 07b0c948ee Add vg_lock_newname() library function.
Various tools need to check for existence of a VG before doing something
(vgsplit, vgrename, vgcreate).  Currently we don't have an interface to
check for existence, but the existence check is part of the vg_read* call(s).
This patch is an attempt to pull out some of that functionality into a
separate function, and hopefully simplify our vg_read interface, and
move those patches along.

vg_lock_newname() is only concerned about checking whether a vg exists in
the system.  Unfortunately, we cannot just scan the system, but we must first
obtain a lock.  Since we are reserving a vgname, we take a WRITE lock on
the vgname.  Once obtained, we scan the system to ensure the name does
not exist.  The return codes and behavior is in the function header.
You might think of this function as similar to an open() call with
O_CREAT and O_EXCL flags (returns failure with -EEXIST if file already
exists).

NOTE: I think including the word "lock" in the function name is important,
as it clearly states the function obtains a lock and makes the code more
readable, especially when it comes to cleanup / unlocking.  The ultimate
function name is somewhat open for debate though so later we may rename.
2009-06-09 14:29:10 +00:00
..
lv_alloc.h Calculate mirror log size instead of hardcoding 1 extent size. 2008-12-19 15:24:52 +00:00
lv_manip.c Suspend virtual origin before real snapshot. 2009-06-06 16:37:15 +00:00
merge.c Right, a simple build (without options) is working again. 2008-11-03 22:14:30 +00:00
metadata-exported.h Add vg_lock_newname() library function. 2009-06-09 14:29:10 +00:00
metadata.c Add vg_lock_newname() library function. 2009-06-09 14:29:10 +00:00
metadata.h Fix readahead calculation problems. 2009-06-01 12:43:31 +00:00
mirror.c Fix convert polling to ignore LV with different UUID. 2009-06-01 14:43:27 +00:00
pv_alloc.h Right, a simple build (without options) is working again. 2008-11-03 22:14:30 +00:00
pv_manip.c Right, a simple build (without options) is working again. 2008-11-03 22:14:30 +00:00
pv_map.c Do not include MISSING_PVs in allocation maps. 2009-04-23 16:41:27 +00:00
pv_map.h Right, a simple build (without options) is working again. 2008-11-03 22:14:30 +00:00
segtype.c Right, a simple build (without options) is working again. 2008-11-03 22:14:30 +00:00
segtype.h Fix last check-ins: seg can be NULL. 2009-02-28 20:04:24 +00:00
snapshot_manip.c Pre-release cleanups. 2009-05-21 03:04:52 +00:00