diff options
author | Shehjar Tikoo <shehjart@zresearch.com> | 2009-04-20 12:34:20 -0700 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-04-21 12:49:49 +0530 |
commit | b4259400090a28a5dbe27922ad8bc309db2a7c4a (patch) | |
tree | 38103bb84518954381768d08d9f67a275a822e44 /libglusterfsclient/src | |
parent | 6cb3159ef38428572b81160e91e7c685ed44acb0 (diff) |
libglusterfsclient: Add VMP-based statvfs
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'libglusterfsclient/src')
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.c | 27 | ||||
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.h | 8 |
2 files changed, 33 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, diff --git a/libglusterfsclient/src/libglusterfsclient.h b/libglusterfsclient/src/libglusterfsclient.h index e587fcc8e0d..0d79fa5044a 100755 --- a/libglusterfsclient/src/libglusterfsclient.h +++ b/libglusterfsclient/src/libglusterfsclient.h @@ -29,6 +29,7 @@ __BEGIN_DECLS #include <sys/stat.h> #include <dirent.h> #include <sys/vfs.h> +#include <sys/statvfs.h> typedef struct { struct iovec *vector; @@ -291,6 +292,13 @@ glusterfs_glh_statfs (glusterfs_handle_t handle, const char *path, int glusterfs_statfs (const char *path, struct statfs *buf); + +int +glusterfs_glh_statvfs (glusterfs_handle_t handle, const char *path, + struct statvfs *buf); + +int +glusterfs_statvfs (const char *path, struct statvfs *buf); /* FIXME: review the need for these apis */ /* added for log related initialization in booster fork implementation */ void |