1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 18:55:19 +03:00

toollib: Avoid a global lock in process_each_pv if lvmetad is used.

The motivation to grab the global lock is to avoid a scan and metadata parsing
for each PV, but the cost of obtaining metadata is _mostly_ mitigated by having
lvmetad around. Not taking the global lock improves throughput when multiple pvs
or related commands are running in parallel, like in RHEV.
This commit is contained in:
Petr Rockai 2012-12-12 14:39:52 +01:00
parent e5709a32be
commit b19f840af8

View File

@ -701,7 +701,7 @@ int process_each_pv(struct cmd_context *cmd, int argc, char **argv,
int opt = 0;
int ret_max = ECMD_PROCESSED;
int ret = 0;
int lock_global = !(flags & READ_WITHOUT_LOCK) && !(flags & READ_FOR_UPDATE);
int lock_global = !(flags & READ_WITHOUT_LOCK) && !(flags & READ_FOR_UPDATE) && !lvmetad_active();
struct pv_list *pvl;
struct physical_volume *pv;