1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-11 09:18:25 +03:00
lvm2/lib
Dave Wysochanski 1dde89db69 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
..
activate Fix readahead calculation problems. 2009-06-01 12:43:31 +00:00
cache Fix pool leak in lvmcache_read_vg error path. 2009-04-24 12:03:55 +00:00
commands Fix error message when archive initialization fails. 2009-04-02 20:46:11 +00:00
config Use lvconvert --repair instead of vgreduce in mirror dmeventd DSO (mornfall) 2009-06-04 12:01:15 +00:00
datastruct more missing bits 2008-11-04 14:57:06 +00:00
device Use readahead of underlying device and not default (smaller) one. 2009-05-20 11:09:49 +00:00
display Merge lv_is_displayable and lv_is_visible. 2009-05-13 21:27:43 +00:00
error Fix last check-ins: seg can be NULL. 2009-02-28 20:04:24 +00:00
filters Add MMC device type to filters. 2009-04-16 10:16:14 +00:00
format1 Merge lv_is_displayable and lv_is_visible. 2009-05-13 21:27:43 +00:00
format_pool Introduce link_lv_to_vg and unlink_lv_from_vg functions. 2009-05-13 21:25:01 +00:00
format_text Use PV UUID in hash for device name when exporting metadata. 2009-05-19 09:48:32 +00:00
freeseg Fix reporting of LV fields alongside unallocated PV segments. 2008-06-25 16:52:27 +00:00
label Provide da and mda locations in debug message when writing text format label. 2009-02-20 23:19:28 +00:00
locking Pre-release cleanups. 2009-05-21 03:04:52 +00:00
log more tweaking to get things to compile - dmlib.h for log fns, list.h 2008-11-03 18:59:59 +00:00
metadata Add vg_lock_newname() library function. 2009-06-09 14:29:10 +00:00
mirror Fix last check-ins: seg can be NULL. 2009-02-28 20:04:24 +00:00
misc Attempt cleanup in child before execing new binary in exec_cmd() 2009-02-28 00:54:06 +00:00
mm fix setpriority int error 2008-05-28 23:12:45 +00:00
report Pre-release cleanups. 2009-05-21 03:04:52 +00:00
snapshot Fix snapshot segment import to not use duplicate segments & replace. 2009-05-13 21:21:58 +00:00
striped Fix last check-ins: seg can be NULL. 2009-02-28 20:04:24 +00:00
uuid Add generic function to read /dev/urandom, used in uuid calculation. 2008-12-07 04:23:37 +00:00
zero Attempt to load dm-zero module if zero target needed but not present. (mbroz) 2009-05-27 13:05:53 +00:00
Makefile.in Build shared parts with 'make' command (mpatocka) 2009-06-03 11:31:06 +00:00