diff options
Diffstat (limited to 'libglusterfsclient/src/libglusterfsclient.c')
| -rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.c | 27 | 
1 files changed, 25 insertions, 2 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index 520735cf994..9b94484be39 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -45,6 +45,7 @@  #include <sys/param.h>  #include <list.h>  #include <stdarg.h> +#include <sys/statvfs.h>  #define LIBGF_XL_NAME "libglusterfsclient"  #define LIBGLUSTERFS_INODE_TABLE_LRU_LIMIT 1000 //14057 @@ -4617,8 +4618,8 @@ out:  }  int -glusterfs_statvfs (glusterfs_handle_t handle, const char *path, -                   struct statvfs *buf) +glusterfs_glh_statvfs (glusterfs_handle_t handle, const char *path, +                                struct statvfs *buf)  {          int32_t                         op_ret = -1;          loc_t                           loc = {0, }; @@ -4655,6 +4656,28 @@ out:          return op_ret;  } +int +glusterfs_statvfs (const char *path, struct statvfs *buf) +{ +        struct vmp_entry        *entry = NULL; +        char                    *vpath = NULL; +        int                     op_ret = -1; + +        GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, path, out); +        GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, buf, out); + +        entry = libgf_vmp_search_entry ((char *)path); +        if (!entry) { +                errno = ENODEV; +                goto out; +        } + +        vpath = libgf_vmp_virtual_path (entry, path); +        op_ret = glusterfs_glh_statvfs (entry->handle, vpath, buf); +out: +        return op_ret; +} +  int32_t  libgf_client_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this,                                  int32_t op_ret, int32_t op_errno,  | 
