diff options
author | Anand Avati <avati@redhat.com> | 2013-04-14 02:58:34 -0700 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-04-19 04:41:35 -0700 |
commit | a1db18cf7a6cde96f2e5b920ffbbf88e72a21fd4 (patch) | |
tree | 0c0ee87231c345b7619bf97c1bdc13eaafa6b83a /api/src/glfs.c | |
parent | 1fc9b98a4eb6eda8db30940a8bb07d206e2fa049 (diff) |
gfapi: support for chdir() and family
Add support for chdir, fchdir, getcwd, realpath equivalents in
GFAPI. These are required for the Samba VFS plugin.
Change-Id: I91d2db9146994403c98961c489c7640c51d5add2
BUG: 953694
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/4853
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'api/src/glfs.c')
-rw-r--r-- | api/src/glfs.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/api/src/glfs.c b/api/src/glfs.c index 705702d0da0..21cded39c69 100644 --- a/api/src/glfs.c +++ b/api/src/glfs.c @@ -11,6 +11,7 @@ /* TODO: + - refresh fs->cwd inode on graph switch - set proper pid/lk_owner to call frames (currently buried in syncop) - fix logging.c/h to store logfp and loglevel in glusterfs_ctx_t and reach it via THIS. @@ -280,7 +281,22 @@ out: struct glfs * glfs_from_glfd (struct glfs_fd *glfd) { - return ((xlator_t *)glfd->fd->inode->table->xl->ctx->master)->private; + return glfd->fs; +} + + +struct glfs_fd * +glfs_fd_new (struct glfs *fs) +{ + struct glfs_fd *glfd = NULL; + + glfd = GF_CALLOC (1, sizeof (*glfd), glfs_mt_glfs_fd_t); + if (!glfd) + return NULL; + + glfd->fs = fs; + + return glfd; } |