diff options
author | Shehjar Tikoo <shehjart@zresearch.com> | 2009-05-05 16:02:31 +0530 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-05-05 17:46:10 +0530 |
commit | 4311e7f01dc244baa1a1b8fc50f74a823dbd38c4 (patch) | |
tree | 607b40579315297229008b9348ac2239b9b9d03a | |
parent | 48ee90ab87cf0c01fee0188728d70d67c6724b97 (diff) |
booster: Add utime API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
-rw-r--r-- | booster/src/booster.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c index 80bac3a2f..7bb2b64e2 100644 --- a/booster/src/booster.c +++ b/booster/src/booster.c @@ -39,6 +39,7 @@ #include <errno.h> #include <ctype.h> #include <logging.h> +#include <utime.h> #ifndef GF_UNIT_KB #define GF_UNIT_KB 1024 @@ -159,6 +160,7 @@ static int (*real_ftruncate) (int fd, off_t length); static int (*real_link) (const char *oldpath, const char *newname); static int (*real_rename) (const char *oldpath, const char *newpath); static int (*real_utimes) (const char *path, const struct timeval times[2]); +static int (*real_utime) (const char *path, const struct utimbuf *buf); #define RESOLVE(sym) do { \ if (!real_##sym) \ @@ -1349,6 +1351,25 @@ utimes (const char *path, const struct timeval times[2]) return ret; } +int +utime (const char *path, const struct utimbuf *buf) +{ + int ret = -1; + + ret = glusterfs_utime (path, buf); + + if (((ret == -1) && (errno != ENODEV)) || (ret == 0)) + return ret; + + if (real_utime == NULL) { + errno = ENOSYS; + ret = -1; + } else + ret = real_utime (path, buf); + + return ret; +} + pid_t fork (void) { @@ -1409,6 +1430,7 @@ _init (void) RESOLVE (link); RESOLVE (rename); RESOLVE (utimes); + RESOLVE (utime); /* This must be called after resolving real functions * above so that the socket based IO calls in libglusterfsclient |