diff options
author | Shehjar Tikoo <shehjart@gluster.com> | 2009-10-01 06:59:01 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-10-01 07:23:39 -0700 |
commit | 5c61f94b00e4fcc8199126f03816896e015eb511 (patch) | |
tree | 91213d5f9898d47a20d77d7e5c24281653e17016 | |
parent | 7c1bdb3aad6063f69338d92490cd4d11d4d578f1 (diff) |
symlink-cache: NFS-friendly logic changes
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 145 (NFSv3 related additions to 2.1 task list)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=145
-rw-r--r-- | xlators/performance/symlink-cache/src/symlink-cache.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/xlators/performance/symlink-cache/src/symlink-cache.c b/xlators/performance/symlink-cache/src/symlink-cache.c index 791fde3c5..722639718 100644 --- a/xlators/performance/symlink-cache/src/symlink-cache.c +++ b/xlators/performance/symlink-cache/src/symlink-cache.c @@ -250,7 +250,7 @@ sc_readlink_cbk (call_frame_t *frame, void *cookie, inode_unref (frame->local); frame->local = NULL; - STACK_UNWIND (frame, op_ret, op_errno, link); + STACK_UNWIND (frame, op_ret, op_errno, link, sbuf); return 0; } @@ -260,6 +260,7 @@ sc_readlink (call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size) { char *link = NULL; + struct stat buf = {0, }; sc_cache_get (this, loc->inode, &link); @@ -268,7 +269,13 @@ sc_readlink (call_frame_t *frame, xlator_t *this, gf_log (this->name, GF_LOG_DEBUG, "cache hit %s -> %s", loc->path, link); - STACK_UNWIND (frame, strlen (link), 0, link); + + /* + libglusterfsclient, nfs or any other translators + using buf in readlink_cbk should be aware that @buf + is 0 filled + */ + STACK_UNWIND (frame, strlen (link), 0, link, &buf); FREE (link); return 0; } @@ -296,7 +303,8 @@ sc_symlink_cbk (call_frame_t *frame, void *cookie, } } - STACK_UNWIND (frame, op_ret, op_errno, inode, buf); + STACK_UNWIND (frame, op_ret, op_errno, inode, buf, preparent, + postparent); return 0; } @@ -327,7 +335,7 @@ sc_lookup_cbk (call_frame_t *frame, void *cookie, else sc_cache_flush (this, inode); - STACK_UNWIND (frame, op_ret, op_errno, inode, buf, xattr); + STACK_UNWIND (frame, op_ret, op_errno, inode, buf, xattr, postparent); return 0; } |