summaryrefslogtreecommitdiffstats
path: root/booster
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-05-05 16:04:43 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-05-05 17:51:12 +0530
commit8a3495e7d4b2273746d9e38aefbae583131951ca (patch)
tree0ec7c631f43c391f24806fd591fc4db6cf80d40f /booster
parentbddbe5f7a4437fc4c295b7830fa2916011ab799a (diff)
booster: Add remove API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'booster')
-rw-r--r--booster/src/booster.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c
index bd1161c3b..df025b63a 100644
--- a/booster/src/booster.c
+++ b/booster/src/booster.c
@@ -192,6 +192,7 @@ static ssize_t (*real_getxattr) (const char *path, const char *name,
void *value, size_t size);
static ssize_t (*real_lgetxattr) (const char *path, const char *name,
void *value, size_t size);
+static int (*real_remove) (const char* path);
#define RESOLVE(sym) do { \
if (!real_##sym) \
@@ -2015,6 +2016,26 @@ out:
return ret;
}
+int
+remove (const char *path)
+{
+ int ret = -1;
+ ret = glusterfs_remove (path);
+ if (((ret == -1) && (errno != ENODEV)) || (ret == 0))
+ goto out;
+
+ if (real_remove == NULL) {
+ errno = ENOSYS;
+ ret = -1;
+ goto out;
+ }
+
+ ret = real_remove (path);
+
+out:
+ return ret;
+}
+
pid_t
fork (void)
{
@@ -2103,6 +2124,7 @@ _init (void)
RESOLVE (statvfs64);
RESOLVE (getxattr);
RESOLVE (lgetxattr);
+ RESOLVE (remove);
/* This must be called after resolving real functions
* above so that the socket based IO calls in libglusterfsclient