summaryrefslogtreecommitdiffstats
path: root/daemons
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2011-01-10 14:02:30 +0000
committerZdenek Kabelac <zkabelac@redhat.com>2011-01-10 14:02:30 +0000
commit937a21f0d23edbc47fb618a86339cd35006e801f (patch)
treec23ee8a28a17d968cfa32f50835af69fcaa0f19e /daemons
parentf6fdfd56e408e81a8f035beba92fa59f2986b453 (diff)
downloadlvm2-937a21f0d23edbc47fb618a86339cd35006e801f.tar.gz
lvm2-937a21f0d23edbc47fb618a86339cd35006e801f.tar.xz
lvm2-937a21f0d23edbc47fb618a86339cd35006e801f.zip
Speedup consequent activation calls
Stop calling fs_unlock() from lv_de/activate(). Start using internal lvm fs cookie for dm_tree. Stop directly calling dm_udev_wait() and dm_tree_set/get_cookie() from activate code - it's now called through fs_unlock() function. Add lvm_do_fs_unlock() Call fs_unlock() when unlocking vg where implicit unlock solves the problem also for cluster - thus no extra command for clustering environment is required - only lvm_do_fs_unlock() function is added to call lvm's fs_unlock() while holding lvm_lock mutex in clvmd. Add fs_unlock() also to set_lv() so the command waits until devices are ready for regular open (i.e. wiping its begining). Move fs_unlock() prototype to activation.h to keep fs.h private in lib/activate dir and not expose other functions from this header.
Diffstat (limited to 'daemons')
-rw-r--r--daemons/clvmd/clvmd-command.c1
-rw-r--r--daemons/clvmd/lvm-functions.c7
-rw-r--r--daemons/clvmd/lvm-functions.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/daemons/clvmd/clvmd-command.c b/daemons/clvmd/clvmd-command.c
index 73c82579..bd6f348f 100644
--- a/daemons/clvmd/clvmd-command.c
+++ b/daemons/clvmd/clvmd-command.c
@@ -214,6 +214,7 @@ static int lock_vg(struct local_client *client)
if (lkid == 0)
return EINVAL;
+ lvm_do_fs_unlock(); /* Wait for devices */
status = sync_unlock(lockname, lkid);
if (status)
status = errno;
diff --git a/daemons/clvmd/lvm-functions.c b/daemons/clvmd/lvm-functions.c
index 214f2295..cba6f445 100644
--- a/daemons/clvmd/lvm-functions.c
+++ b/daemons/clvmd/lvm-functions.c
@@ -894,6 +894,13 @@ struct dm_hash_node *get_next_excl_lock(struct dm_hash_node *v, char **name)
return v;
}
+void lvm_do_fs_unlock(void)
+{
+ pthread_mutex_lock(&lvm_lock);
+ fs_unlock();
+ pthread_mutex_unlock(&lvm_lock);
+}
+
/* Called to initialise the LVM context of the daemon */
int init_clvm(int using_gulm, char **argv)
{
diff --git a/daemons/clvmd/lvm-functions.h b/daemons/clvmd/lvm-functions.h
index 97153d49..a132f4af 100644
--- a/daemons/clvmd/lvm-functions.h
+++ b/daemons/clvmd/lvm-functions.h
@@ -36,5 +36,6 @@ extern char *get_last_lvm_error(void);
extern void do_lock_vg(unsigned char command, unsigned char lock_flags,
char *resource);
extern struct dm_hash_node *get_next_excl_lock(struct dm_hash_node *v, char **name);
+void lvm_do_fs_unlock(void);
#endif