summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-05-05 16:01:40 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-05-05 17:45:39 +0530
commit8fa2a984c315418b940c481ea7729c00ed0b033a (patch)
tree239a2c64089722d63cfe1009ff055eb1677b1e42
parentad4f864c448a3bbcec67d3fb3c44e07993cd70e7 (diff)
booster: Add fchmod API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
-rw-r--r--booster/src/booster.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c
index eb4f8111469..680d456684f 100644
--- a/booster/src/booster.c
+++ b/booster/src/booster.c
@@ -152,7 +152,7 @@ static int (*real_mkdir) (const char *pathname, mode_t mode);
static int (*real_rmdir) (const char *pathname);
static int (*real_chmod) (const char *pathname, mode_t mode);
static int (*real_chown) (const char *pathname, uid_t owner, gid_t group);
-
+static int (*real_fchmod) (int fd, mode_t mode);
#define RESOLVE(sym) do { \
if (!real_##sym) \
real_##sym = dlsym (RTLD_NEXT, #sym); \
@@ -1201,7 +1201,26 @@ booster_cleanup (void)
booster_mount_table = NULL;
}
+int
+fchmod (int fd, mode_t mode)
+{
+ int ret = -1;
+ glusterfs_file_t fh = NULL;
+
+ fh = booster_get_glfs_fd (booster_glfs_fdtable, fd);
+ if (!fh) {
+ if (real_fchmod == NULL) {
+ errno = ENOSYS;
+ ret = -1;
+ } else
+ ret = real_fchmod (fd, mode);
+ } else {
+ ret = glusterfs_fchmod (fh, mode);
+ booster_put_glfs_fd (fh);
+ }
+ return ret;
+}
pid_t
fork (void)
@@ -1256,6 +1275,7 @@ _init (void)
RESOLVE (rmdir);
RESOLVE (chmod);
RESOLVE (chown);
+ RESOLVE (fchmod);
/* This must be called after resolving real functions
* above so that the socket based IO calls in libglusterfsclient