diff options
author | Raghavendra G <raghavendra@zresearch.com> | 2009-04-22 07:32:53 -0700 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-04-23 10:41:49 +0530 |
commit | 3c68984b6f8dbb772a858fcf829d6c6f81503912 (patch) | |
tree | f1a1eacf9b714ec22d32b245603a68ffa2ce3e72 | |
parent | b817670c609dda2a1038fb94bd5a7dc6fa522518 (diff) | |
download | glusterfs-3c68984b6f8dbb772a858fcf829d6c6f81503912.tar.gz glusterfs-3c68984b6f8dbb772a858fcf829d6c6f81503912.tar.xz glusterfs-3c68984b6f8dbb772a858fcf829d6c6f81503912.zip |
libglusterfsclient: implement glusterfs_umount
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.c | 38 | ||||
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.h | 3 |
2 files changed, 41 insertions, 0 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index 160df1cb33..46208a8ee3 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -875,6 +875,13 @@ libgf_init_vmpentry (char *vmp, glusterfs_handle_t *vmphandle) return entry; } +void +libgf_free_vmp_entry (struct vmp_entry *entry) +{ + FREE (entry->vmp); + FREE (entry); +} + int libgf_vmp_map_ghandle (char *vmp, glusterfs_handle_t *vmphandle) { @@ -1005,6 +1012,37 @@ out: return ret; } +int +glusterfs_umount (char *vmp) +{ + struct vmp_entry *entry= NULL; + int ret = -1; + GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, vmp, out); + + entry = libgf_vmp_search_entry (vmp); + if (entry == NULL) { + gf_log ("libglusterfsclient", GF_LOG_ERROR, + "path (%s) not mounted", vmp); + goto out; + } + + /* FIXME: make this thread safe */ + list_del_init (&entry->list); + + if (entry->handle == NULL) { + gf_log ("libglusterfsclient", GF_LOG_ERROR, + "path (%s) has no corresponding glusterfs handle", + vmp); + goto out; + } + + ret = glusterfs_fini (entry->handle); + libgf_free_vmp_entry (entry); + +out: + return ret; +} + void glusterfs_reset (void) { diff --git a/libglusterfsclient/src/libglusterfsclient.h b/libglusterfsclient/src/libglusterfsclient.h index 93476a6a29..defbec8786 100755 --- a/libglusterfsclient/src/libglusterfsclient.h +++ b/libglusterfsclient/src/libglusterfsclient.h @@ -269,6 +269,9 @@ int glusterfs_mount (char *vmp, glusterfs_init_params_t *ipars); int +glusterfs_umount (char *vmp); + +int glusterfs_glh_chmod (glusterfs_handle_t handle, const char *path, mode_t mode); int |