From 8a3495e7d4b2273746d9e38aefbae583131951ca Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Tue, 5 May 2009 16:04:43 +0530 Subject: booster: Add remove API Signed-off-by: Anand V. Avati --- booster/src/booster.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'booster') diff --git a/booster/src/booster.c b/booster/src/booster.c index bd1161c3b57..df025b63a55 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 -- cgit