diff options
| author | Shehjar Tikoo <shehjart@zresearch.com> | 2009-04-20 12:30:36 -0700 | 
|---|---|---|
| committer | Anand V. Avati <avati@amp.gluster.com> | 2009-04-21 12:48:32 +0530 | 
| commit | 4074769dd2435ab3521ab39eb2775c3e80fc32b4 (patch) | |
| tree | ab3e7a3e0da941114cd331b1d586f2eb337faa56 /libglusterfsclient/src/libglusterfsclient.c | |
| parent | d875df0c5c095488db29a202eac74d10d540aa3b (diff) | |
libglusterfsclient: Add VMP-based creat
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'libglusterfsclient/src/libglusterfsclient.c')
| -rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.c | 25 | 
1 files changed, 22 insertions, 3 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index b7e278017d9..b5fa10159c0 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,  | 
