summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient/src/libglusterfsclient.c
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-04-20 12:34:20 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-21 12:49:49 +0530
commitb4259400090a28a5dbe27922ad8bc309db2a7c4a (patch)
tree38103bb84518954381768d08d9f67a275a822e44 /libglusterfsclient/src/libglusterfsclient.c
parent6cb3159ef38428572b81160e91e7c685ed44acb0 (diff)
libglusterfsclient: Add VMP-based statvfs
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'libglusterfsclient/src/libglusterfsclient.c')
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index 520735cf9..9b94484be 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,