summaryrefslogtreecommitdiffstats
path: root/booster
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-05-05 16:02:10 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-05-05 17:45:56 +0530
commit11cdc6e5282d4c7d906da3e20b50df78ddba2efd (patch)
treef8d0cecf82849eaeabb57dcdf564f7159fb6caa8 /booster
parent9b012b098915c8bdbdcb8a4c38fb353fa39e82d4 (diff)
booster: Add link API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'booster')
-rw-r--r--booster/src/booster.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c
index a7a11edfffb..46305a5029a 100644
--- a/booster/src/booster.c
+++ b/booster/src/booster.c
@@ -156,6 +156,7 @@ static int (*real_fchmod) (int fd, mode_t mode);
static int (*real_fchown) (int fd, uid_t, gid_t gid);
static int (*real_fsync) (int fd);
static int (*real_ftruncate) (int fd, off_t length);
+static int (*real_link) (const char *oldpath, const char *newname);
#define RESOLVE(sym) do { \
if (!real_##sym) \
@@ -1290,6 +1291,25 @@ ftruncate (int fd, off_t length)
return ret;
}
+int
+link (const char *old, const char *new)
+{
+ int ret = -1;
+
+ ret = glusterfs_link (old, new);
+
+ if (((ret == -1) && (errno != ENODEV)) || (ret == 0))
+ return ret;
+
+ if (real_link == NULL) {
+ errno = ENOSYS;
+ ret = -1;
+ } else
+ ret = real_link (old, new);
+
+ return ret;
+}
+
pid_t
fork (void)
{
@@ -1347,6 +1367,7 @@ _init (void)
RESOLVE (fchown);
RESOLVE (fsync);
RESOLVE (ftruncate);
+ RESOLVE (link);
/* This must be called after resolving real functions
* above so that the socket based IO calls in libglusterfsclient