summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfsclient')
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c25
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.h5
2 files changed, 26 insertions, 4 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index b7e278017..b5fa10159 100755
--- a/libglusterfsclient/src/libglusterfsclient.c
+++ b/libglusterfsclient/src/libglusterfsclient.c
@@ -1944,14 +1944,33 @@ out:
}
glusterfs_file_t
-glusterfs_creat (glusterfs_handle_t handle,
- const char *path,
- mode_t mode)
+glusterfs_glh_creat (glusterfs_handle_t handle, const char *path, mode_t mode)
{
return glusterfs_glh_open (handle, path,
(O_CREAT | O_WRONLY | O_TRUNC), mode);
}
+glusterfs_file_t
+glusterfs_creat (const char *path, mode_t mode)
+{
+ struct vmp_entry *entry = NULL;
+ char *vpath = NULL;
+ glusterfs_file_t fh = NULL;
+
+ GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, path, out);
+
+ entry = libgf_vmp_search_entry ((char *)path);
+ if (!entry) {
+ errno = ENODEV;
+ goto out;
+ }
+
+ vpath = libgf_vmp_virtual_path (entry, path);
+ fh = glusterfs_glh_creat (entry->handle, vpath, mode);
+
+out:
+ return fh;
+}
int32_t
libgf_client_flush_cbk (call_frame_t *frame,
diff --git a/libglusterfsclient/src/libglusterfsclient.h b/libglusterfsclient/src/libglusterfsclient.h
index dabc288c1..d7ce4318e 100755
--- a/libglusterfsclient/src/libglusterfsclient.h
+++ b/libglusterfsclient/src/libglusterfsclient.h
@@ -109,7 +109,10 @@ glusterfs_file_t
glusterfs_open (const char *path, int flags, ...);
glusterfs_file_t
-glusterfs_creat (glusterfs_handle_t handle, const char *path, mode_t mode);
+glusterfs_glh_creat (glusterfs_handle_t handle, const char *path, mode_t mode);
+
+glusterfs_file_t
+glusterfs_creat (const char *path, mode_t mode);
int
glusterfs_mkdir (glusterfs_handle_t handle, const char *path, mode_t mode);