summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-04-20 12:34:41 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-21 12:49:54 +0530
commite707afad9f6282bc425f8b0262ea5a6db018ec92 (patch)
tree14891f33aa5efa3487e587322b1eb41de0536f86 /libglusterfsclient
parentb4259400090a28a5dbe27922ad8bc309db2a7c4a (diff)
libglusterfsclient: Add VMP-based utimes
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'libglusterfsclient')
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c25
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.h7
2 files changed, 30 insertions, 2 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index 9b94484be..da10c3b1b 100755
--- a/libglusterfsclient/src/libglusterfsclient.c
+++ b/libglusterfsclient/src/libglusterfsclient.c
@@ -4828,8 +4828,8 @@ out:
}
int
-glusterfs_utimes (glusterfs_handle_t handle, const char *path,
- const struct timeval times[2])
+glusterfs_glh_utimes (glusterfs_handle_t handle, const char *path,
+ const struct timeval times[2])
{
int32_t op_ret = -1;
loc_t loc = {0, };
@@ -4873,6 +4873,27 @@ out:
}
int
+glusterfs_utimes (const char *path, const struct timeval times[2])
+{
+ struct vmp_entry *entry = NULL;
+ char *vpath = NULL;
+ int op_ret = -1;
+
+ 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);
+ op_ret = glusterfs_glh_utimes (entry->handle, vpath, times);
+out:
+ return op_ret;
+}
+
+int
glusterfs_utime (glusterfs_handle_t handle, const char *path,
const struct utimbuf *buf)
{
diff --git a/libglusterfsclient/src/libglusterfsclient.h b/libglusterfsclient/src/libglusterfsclient.h
index 0d79fa504..0381650c3 100755
--- a/libglusterfsclient/src/libglusterfsclient.h
+++ b/libglusterfsclient/src/libglusterfsclient.h
@@ -299,6 +299,13 @@ glusterfs_glh_statvfs (glusterfs_handle_t handle, const char *path,
int
glusterfs_statvfs (const char *path, struct statvfs *buf);
+
+int
+glusterfs_glh_utimes (glusterfs_handle_t handle, const char *path,
+ const struct timeval times[2]);
+
+int
+glusterfs_utimes (const char *path, const struct timeval times[2]);
/* FIXME: review the need for these apis */
/* added for log related initialization in booster fork implementation */
void