From 29a3619d6bb5680213c817b13dad7d8ad6e2903b Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Wed, 10 Jun 2009 06:59:50 +0000 Subject: libglusterfsclient: add glusterfs_umount_all. - unmounts all the entries in the vmplist. - this api helps booster to cleanup all the mounts in a single call. Signed-off-by: Anand V. Avati --- libglusterfsclient/src/libglusterfsclient.c | 19 +++++++++++++++++++ libglusterfsclient/src/libglusterfsclient.h | 4 ++++ 2 files changed, 23 insertions(+) (limited to 'libglusterfsclient') diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index 26d9a5234dc..8dc63a6eb64 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -1483,6 +1483,25 @@ out: return ret; } +int +glusterfs_umount_all (void) +{ + struct vmp_entry *entry = NULL, *tmp = NULL; + + pthread_mutex_lock (&lock); + { + list_for_each_entry_safe (entry, tmp, &vmplist.list, list) { + /* even if there are errors, continue with other + mounts + */ + _libgf_umount (entry->vmp); + } + } + pthread_mutex_unlock (&lock); + + return 0; +} + void glusterfs_reset (void) { diff --git a/libglusterfsclient/src/libglusterfsclient.h b/libglusterfsclient/src/libglusterfsclient.h index a2c9a0fa5f2..9e03a8c59ac 100755 --- a/libglusterfsclient/src/libglusterfsclient.h +++ b/libglusterfsclient/src/libglusterfsclient.h @@ -199,6 +199,10 @@ int glusterfs_umount (char *vmp); +/* glusterfs_umount_all unmounts all the mounts */ +int +glusterfs_umount_all (void); + /* For smaller files, application can use just * glusterfs_get/glusterfs_get_async -- cgit