Blob Blame History Raw
From 269adc6bd2142681e5086f50c1b59214a9c39da6 Mon Sep 17 00:00:00 2001
From: Poornima G <pgurusid@redhat.com>
Date: Tue, 6 Dec 2016 14:43:10 +0530
Subject: [PATCH 356/361] dht: At places needed use STACK_WIND_COOKIE

Issue:
frame has a void * cookie pointer.
In case of STACK_WIND_COOKIE frame->cookie is assigned
to what is sent by the caller.
In case of STACK_WIND frame->cookie is assigned to point
point to the frame itself.

For ease of coding, at many places, the cookie in the cbk
is used to get the pointer to the next xl. This is
inconsistent when STACK_WIND_TAIL comes into picture.

Eg: dht_setxattr () {
    for (i = 0 ; i < conf->subvolume_cnt ; i++) {
       STACK_WIND (..dht_checking_pathinfo_cbk,
                   conf->subvolumes[i] ..);
    }

    dht_checking_pathinfo_cbk (...void *cookie...) {
        prev = cookie;
        ...
        for (i = 0; i < conf->subvolume_cnt; i++) {
            if (conf->subvolumes[i] == prev->this) {
                 ...
            }
        }
    }

    Consider the below graph:
    dht (parent)
    readdir-ahead  => Doesn't define setxattr and uses STACK_WIND_TAIL
    protocol-client

    With this graph, when dht_checking_pathinfo_cbk is called,
    cookie will have frame pointing to protocol-client.
    i.e. prev->this will be protocol-client. But dht was expecting
    it to be readdir-ahead as it has stored in conf->subvolumes[i]

Solution:
    Hence, as a thumb rule, if cbk is using cookie, then we explicitly
    call STACK_WIND_COOKIE.

mainline:
> BUG: 1401812
> Reviewed-on: http://review.gluster.org/16039
> Smoke: Gluster Build System <jenkins@build.gluster.org>
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
(cherry picked from commit 53c542bc26b3bd8db0a2c51191afcae31b7e22f4)

BUG: 1427096
Change-Id: I83aea1e24c809c5a91a0db7283e908e125471bd4
Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/101416
Tested-by: Milind Changire <mchangir@redhat.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
---
 libglusterfs/src/stack.h                  |   2 +-
 xlators/cluster/dht/src/dht-common.c      | 560 +++++++++++++++---------------
 xlators/cluster/dht/src/dht-diskusage.c   |  26 +-
 xlators/cluster/dht/src/dht-inode-read.c  |  83 ++---
 xlators/cluster/dht/src/dht-inode-write.c | 152 ++++----
 xlators/cluster/dht/src/dht-linkfile.c    |  31 +-
 xlators/cluster/dht/src/dht-rename.c      | 174 +++++-----
 xlators/cluster/dht/src/dht-selfheal.c    |  51 +--
 xlators/cluster/dht/src/nufa.c            |  57 +--
 xlators/cluster/dht/src/switch.c          |  73 ++--
 xlators/cluster/dht/src/tier-common.c     |  99 +++---
 11 files changed, 659 insertions(+), 649 deletions(-)

diff --git a/libglusterfs/src/stack.h b/libglusterfs/src/stack.h
index 393fdac..be7e900 100644
--- a/libglusterfs/src/stack.h
+++ b/libglusterfs/src/stack.h
@@ -326,7 +326,7 @@ STACK_RESET (call_stack_t *stack)
                               "winding from %s to %s",                  \
                               frame->root, old_THIS->name,              \
                               THIS->name);                              \
-                if (obj->ctx->measure_latency)                          \
+                if (obj->ctx->measure_latency)                  \
                         gf_latency_begin (_new, fn);                    \
                 fn (_new, obj, params);                                 \
                 THIS = old_THIS;                                        \
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index e40805a..131a4b1 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -588,7 +588,7 @@ dht_discover_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 {
         dht_local_t  *local                   = NULL;
         int           this_call_cnt           = 0;
-        call_frame_t *prev                    = NULL;
+        xlator_t     *prev                    = NULL;
         dht_layout_t *layout                  = NULL;
         int           ret                     = -1;
         int           is_dir                  = 0;
@@ -621,7 +621,7 @@ dht_discover_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         DHT_MSG_GFID_MISMATCH,
                         "%s: gfid different on %s, gfid local = %s"
                         "gfid other = %s",
-                        local->loc.path, prev->this->name,
+                        local->loc.path, prev->name,
                         gfid_local, gfid_node);
         }
 
@@ -633,19 +633,19 @@ dht_discover_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 
                    else mkdir/chmod/chown and fix
                 */
-                ret = dht_layout_merge (this, layout, prev->this,
+                ret = dht_layout_merge (this, layout, prev,
                                         op_ret, op_errno, xattr);
                 if (ret)
                         gf_msg (this->name, GF_LOG_WARNING, 0,
                                 DHT_MSG_LAYOUT_MERGE_FAILED,
                                 "%s: failed to merge layouts for subvol %s",
-                                local->loc.path, prev->this->name);
+                                local->loc.path, prev->name);
 
                 if (op_ret == -1) {
                         local->op_errno = op_errno;
                         gf_msg_debug (this->name, op_errno,
                                       "lookup of %s on %s returned error",
-                                      local->loc.path, prev->this->name);
+                                      local->loc.path, prev->name);
 
                         goto unlock;
                 }
@@ -661,7 +661,7 @@ dht_discover_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 
                         if (!is_linkfile) {
                                 /* real file */
-                                local->cached_subvol = prev->this;
+                                local->cached_subvol = prev;
                                 attempt_unwind = 1;
                         } else {
                                 goto unlock;
@@ -679,9 +679,9 @@ dht_discover_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 if (local->inode == NULL)
                         local->inode = inode_ref (inode);
 
-                dht_iatt_merge (this, &local->stbuf, stbuf, prev->this);
+                dht_iatt_merge (this, &local->stbuf, stbuf, prev);
                 dht_iatt_merge (this, &local->postparent, postparent,
-                                prev->this);
+                                prev);
         }
 unlock:
         UNLOCK (&frame->lock);
@@ -765,10 +765,10 @@ dht_discover (call_frame_t *frame, xlator_t *this, loc_t *loc)
         local->main_frame = frame;
 
         for (i = 0; i < call_cnt; i++) {
-                STACK_WIND (discover_frame, dht_discover_cbk,
-                            conf->subvolumes[i],
-                            conf->subvolumes[i]->fops->lookup,
-                            &local->loc, local->xattr_req);
+                STACK_WIND_COOKIE (discover_frame, dht_discover_cbk,
+                                   conf->subvolumes[i], conf->subvolumes[i],
+                                   conf->subvolumes[i]->fops->lookup,
+                                   &local->loc, local->xattr_req);
         }
 
         return 0;
@@ -789,7 +789,7 @@ dht_lookup_dir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 {
         dht_local_t  *local                   = NULL;
         int           this_call_cnt           = 0;
-        call_frame_t *prev                    = NULL;
+        xlator_t     *prev                    = NULL;
         dht_layout_t *layout                  = NULL;
         int           ret                     = -1;
         int           is_dir                  = 0;
@@ -822,7 +822,7 @@ dht_lookup_dir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         DHT_MSG_GFID_MISMATCH,
                         "%s: gfid different on %s."
                         " gfid local = %s, gfid subvol = %s",
-                        local->loc.path, prev->this->name,
+                        local->loc.path, prev->name,
                         gfid_local, gfid_node);
         }
 
@@ -833,14 +833,14 @@ dht_lookup_dir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 
                    else mkdir/chmod/chown and fix
                 */
-                ret = dht_layout_merge (this, layout, prev->this,
-                                        op_ret, op_errno, xattr);
+                ret = dht_layout_merge (this, layout, prev, op_ret, op_errno,
+                                        xattr);
 
                 if (op_ret == -1) {
                         local->op_errno = op_errno;
                         gf_msg_debug (this->name, op_errno,
                                       "lookup of %s on %s returned error",
-                                      local->loc.path, prev->this->name);
+                                      local->loc.path, prev->name);
 
                         goto unlock;
                 }
@@ -852,7 +852,7 @@ dht_lookup_dir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                                       "lookup of %s on %s returned non"
                                       "dir 0%o"
                                       "calling lookup_everywhere",
-                                      local->loc.path, prev->this->name,
+                                      local->loc.path, prev->name,
                                       stbuf->ia_type);
 
                         local->need_selfheal = 1;
@@ -869,9 +869,8 @@ dht_lookup_dir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 if (local->inode == NULL)
                         local->inode = inode_ref (inode);
 
-                dht_iatt_merge (this, &local->stbuf, stbuf, prev->this);
-                dht_iatt_merge (this, &local->postparent, postparent,
-                                prev->this);
+                dht_iatt_merge (this, &local->stbuf, stbuf, prev);
+                dht_iatt_merge (this, &local->postparent, postparent, prev);
         }
 unlock:
         UNLOCK (&frame->lock);
@@ -955,7 +954,7 @@ dht_revalidate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 {
         dht_local_t  *local         = NULL;
         int           this_call_cnt = 0;
-        call_frame_t *prev          = NULL;
+        xlator_t     *prev          = NULL;
         dht_layout_t *layout        = NULL;
         dht_conf_t   *conf          = NULL;
         int           ret  = -1;
@@ -1007,7 +1006,7 @@ dht_revalidate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                                         DHT_MSG_REVALIDATE_CBK_INFO,
                                         "Revalidate: subvolume %s for %s "
                                         "(gfid = %s) returned -1",
-                                        prev->this->name, local->loc.path,
+                                        prev->name, local->loc.path,
                                         gfid);
                         }
                         if (op_errno == ESTALE) {
@@ -1087,7 +1086,7 @@ dht_revalidate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                                 }
                         }
                         ret = dht_layout_dir_mismatch (this, layout,
-                                                       prev->this, &local->loc,
+                                                       prev, &local->loc,
                                                        xattr);
                         if (ret != 0) {
                                 gf_msg (this->name, GF_LOG_INFO, 0,
@@ -1110,9 +1109,9 @@ dht_revalidate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                     dht_dir_has_layout (xattr, conf->xattr_name) >= 0)
                     || conf->subvolume_cnt == 1) {
 
-                        dht_iatt_merge (this, &local->stbuf, stbuf, prev->this);
+                        dht_iatt_merge (this, &local->stbuf, stbuf, prev);
                         dht_iatt_merge (this, &local->postparent, postparent,
-                                        prev->this);
+                                        prev);
                 } else {
                         /* copy the gfid anyway */
                         gf_uuid_copy (local->stbuf.ia_gfid, stbuf->ia_gfid);
@@ -1138,9 +1137,9 @@ unlock:
                         local->op_ret = -1;
                 } else {
 
-                        STACK_WIND (frame, dht_lookup_linkfile_cbk,
-                        subvol, subvol->fops->lookup,
-                        &local->loc, local->xattr_req);
+                        STACK_WIND_COOKIE (frame, dht_lookup_linkfile_cbk,
+                                           subvol, subvol, subvol->fops->lookup,
+                                           &local->loc, local->xattr_req);
                         return 0;
                 }
         }
@@ -1835,7 +1834,7 @@ dht_lookup_everywhere_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 {
         dht_local_t  *local         = NULL;
         int           this_call_cnt = 0;
-        call_frame_t *prev          = NULL;
+        xlator_t     *prev          = NULL;
         int           is_linkfile   = 0;
         int           is_dir        = 0;
         xlator_t     *subvol        = NULL;
@@ -1858,7 +1857,7 @@ dht_lookup_everywhere_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         conf   = this->private;
 
         prev   = cookie;
-        subvol = prev->this;
+        subvol = prev;
 
         gf_msg_debug (this->name, 0,
                       "returned with op_ret %d and op_errno %d (%s) "
@@ -1883,7 +1882,7 @@ dht_lookup_everywhere_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                                 DHT_MSG_GFID_MISMATCH,
                                 "%s: gfid differs on subvolume %s,"
                                 " gfid local = %s, gfid node = %s",
-                                loc->path, prev->this->name, gfid,
+                                loc->path, prev->name, gfid,
                                 uuid_utoa(buf->ia_gfid));
                 }
 
@@ -2064,10 +2063,10 @@ dht_lookup_everywhere (call_frame_t *frame, xlator_t *this, loc_t *loc)
                       "winding lookup call to %d subvols", call_cnt);
 
         for (i = 0; i < call_cnt; i++) {
-                STACK_WIND (frame, dht_lookup_everywhere_cbk,
-                            conf->subvolumes[i],
-                            conf->subvolumes[i]->fops->lookup,
-                            loc, local->xattr_req);
+                STACK_WIND_COOKIE (frame, dht_lookup_everywhere_cbk,
+                                   conf->subvolumes[i], conf->subvolumes[i],
+                                   conf->subvolumes[i]->fops->lookup,
+                                   loc, local->xattr_req);
         }
 
         return 0;
@@ -2084,7 +2083,7 @@ dht_lookup_linkfile_cbk (call_frame_t *frame, void *cookie,
                          inode_t *inode, struct iatt *stbuf, dict_t *xattr,
                          struct iatt *postparent)
 {
-        call_frame_t *prev          = NULL;
+        xlator_t     *prev          = NULL;
         dht_local_t  *local         = NULL;
         xlator_t     *subvol        = NULL;
         loc_t        *loc           = NULL;
@@ -2099,7 +2098,7 @@ dht_lookup_linkfile_cbk (call_frame_t *frame, void *cookie,
         GF_VALIDATE_OR_GOTO ("dht", cookie, unwind);
 
         prev   = cookie;
-        subvol = prev->this;
+        subvol = prev;
         conf   = this->private;
         local  = frame->local;
         loc    = &local->loc;
@@ -2154,12 +2153,12 @@ dht_lookup_linkfile_cbk (call_frame_t *frame, void *cookie,
                 stbuf->ia_prot.sticky = 1;
         }
 
-        ret = dht_layout_preset (this, prev->this, inode);
+        ret = dht_layout_preset (this, prev, inode);
         if (ret < 0) {
                 gf_msg (this->name, GF_LOG_INFO, 0,
                         DHT_MSG_LAYOUT_PRESET_FAILED,
                         "Failed to set layout for subvolume %s,"
-                        "gfid = %s", prev->this->name, gfid);
+                        "gfid = %s", prev->name, gfid);
                 op_ret   = -1;
                 op_errno = EINVAL;
         }
@@ -2226,10 +2225,10 @@ dht_lookup_directory (call_frame_t *frame, xlator_t *this, loc_t *loc)
         }
 
         for (i = 0; i < call_cnt; i++) {
-                STACK_WIND (frame, dht_lookup_dir_cbk,
-                            conf->subvolumes[i],
-                            conf->subvolumes[i]->fops->lookup,
-                            &local->loc, local->xattr_req);
+                STACK_WIND_COOKIE (frame, dht_lookup_dir_cbk,
+                                   conf->subvolumes[i], conf->subvolumes[i],
+                                   conf->subvolumes[i]->fops->lookup,
+                                   &local->loc, local->xattr_req);
         }
         return 0;
 unwind:
@@ -2252,7 +2251,7 @@ dht_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         dht_conf_t   *conf          = NULL;
         dht_local_t  *local         = NULL;
         loc_t        *loc           = NULL;
-        call_frame_t *prev          = NULL;
+        xlator_t     *prev          = NULL;
         int           ret           = 0;
         dht_layout_t *parent_layout = NULL;
         uint32_t      vol_commit_hash = 0;
@@ -2290,7 +2289,7 @@ dht_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         if (ENTRY_MISSING (op_ret, op_errno)) {
                 gf_msg_debug (this->name, 0,
                               "Entry %s missing on subvol %s",
-                              loc->path, prev->this->name);
+                              loc->path, prev->name);
 
                 /* lookup-optimize supercedes lookup-unhashed settings,
                  *   - so if it is set, do not process search_unhashed
@@ -2357,7 +2356,7 @@ dht_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 gf_msg_debug (this->name, op_errno,
                               "Lookup of %s for subvolume"
                               " %s failed", loc->path,
-                              prev->this->name);
+                              prev->name);
                 goto out;
         }
 
@@ -2367,12 +2366,12 @@ dht_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         if (!is_linkfile) {
                 /* non-directory and not a linkfile */
 
-                ret = dht_layout_preset (this, prev->this, inode);
+                ret = dht_layout_preset (this, prev, inode);
                 if (ret < 0) {
                         gf_msg (this->name, GF_LOG_INFO, 0,
                                 DHT_MSG_LAYOUT_PRESET_FAILED,
                                 "could not set pre-set layout for subvolume %s",
-                                prev->this->name);
+                                prev->name);
                         op_ret   = -1;
                         op_errno = EINVAL;
                         goto out;
@@ -2398,9 +2397,9 @@ dht_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                       "Calling lookup on linkto target %s for path %s",
                       subvol->name, loc->path);
 
-        STACK_WIND (frame, dht_lookup_linkfile_cbk,
-                    subvol, subvol->fops->lookup,
-                    &local->loc, local->xattr_req);
+        STACK_WIND_COOKIE (frame, dht_lookup_linkfile_cbk, subvol,
+                           subvol, subvol->fops->lookup,
+                           &local->loc, local->xattr_req);
 
         return 0;
 
@@ -2587,10 +2586,11 @@ dht_lookup (call_frame_t *frame, xlator_t *this,
                 if (IA_ISDIR (local->inode->ia_type)) {
                         local->call_cnt = call_cnt = conf->subvolume_cnt;
                         for (i = 0; i < call_cnt; i++) {
-                                STACK_WIND (frame, dht_revalidate_cbk,
-                                            conf->subvolumes[i],
-                                            conf->subvolumes[i]->fops->lookup,
-                                            loc, local->xattr_req);
+                                STACK_WIND_COOKIE (frame, dht_revalidate_cbk,
+                                                   conf->subvolumes[i],
+                                                   conf->subvolumes[i],
+                                                   conf->subvolumes[i]->fops->lookup,
+                                                   loc, local->xattr_req);
                         }
                         return 0;
                 }
@@ -2618,9 +2618,9 @@ dht_lookup (call_frame_t *frame, xlator_t *this,
                                       "revalidate lookup for %s at %s",
                                       loc->path, subvol->name);
 
-                        STACK_WIND (frame, dht_revalidate_cbk,
-                                    subvol, subvol->fops->lookup,
-                                    &local->loc, local->xattr_req);
+                        STACK_WIND_COOKIE (frame, dht_revalidate_cbk, subvol,
+                                           subvol, subvol->fops->lookup,
+                                           &local->loc, local->xattr_req);
 
                 }
         } else {
@@ -2681,10 +2681,11 @@ dht_lookup (call_frame_t *frame, xlator_t *this,
                                       " on all nodes.");
 
                         for (i = 0; i < call_cnt; i++) {
-                                STACK_WIND (frame, dht_lookup_dir_cbk,
-                                            conf->subvolumes[i],
-                                            conf->subvolumes[i]->fops->lookup,
-                                            &local->loc, local->xattr_req);
+                                STACK_WIND_COOKIE (frame, dht_lookup_dir_cbk,
+                                                   conf->subvolumes[i],
+                                                   conf->subvolumes[i],
+                                                   conf->subvolumes[i]->fops->lookup,
+                                                   &local->loc, local->xattr_req);
                         }
                         return 0;
                 }
@@ -2692,9 +2693,9 @@ dht_lookup (call_frame_t *frame, xlator_t *this,
                 gf_msg_debug (this->name, 0, "Calling fresh lookup for %s on"
                               " %s", loc->path, hashed_subvol->name);
 
-                STACK_WIND (frame, dht_lookup_cbk,
-                            hashed_subvol, hashed_subvol->fops->lookup,
-                            loc, local->xattr_req);
+                STACK_WIND_COOKIE (frame, dht_lookup_cbk, hashed_subvol,
+                                   hashed_subvol, hashed_subvol->fops->lookup,
+                                   loc, local->xattr_req);
         }
 
         return 0;
@@ -2712,7 +2713,7 @@ dht_unlink_linkfile_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                          struct iatt *postparent, dict_t *xdata)
 {
         dht_local_t     *local          = NULL;
-        call_frame_t    *prev           = NULL;
+        xlator_t        *prev           = NULL;
 
         local = frame->local;
         prev  = cookie;
@@ -2725,7 +2726,7 @@ dht_unlink_linkfile_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         gf_msg_debug (this->name, op_errno,
                                       "Unlink link: subvolume %s"
                                       " returned -1",
-                                      prev->this->name);
+                                      prev->name);
                         goto unlock;
                 }
 
@@ -2748,7 +2749,7 @@ dht_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 struct iatt *postparent, dict_t *xdata)
 {
         dht_local_t     *local          = NULL;
-        call_frame_t    *prev           = NULL;
+        xlator_t        *prev           = NULL;
         xlator_t        *hashed_subvol  = NULL;
 
         local = frame->local;
@@ -2765,7 +2766,7 @@ dht_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         }
                         gf_msg_debug (this->name, op_errno,
                                       "Unlink: subvolume %s returned -1",
-                                       prev->this->name);
+                                       prev->name);
                         goto unlock;
                 }
 
@@ -2793,10 +2794,10 @@ unlock:
                          * to unlink linkfile from hashed subvol if data
                          * file is deleted successfully
                          */
-                        STACK_WIND (frame, dht_unlink_linkfile_cbk,
-                                    hashed_subvol,
-                                    hashed_subvol->fops->unlink, &local->loc,
-                                    local->flags, xdata);
+                        STACK_WIND_COOKIE (frame, dht_unlink_linkfile_cbk,
+                                           hashed_subvol, hashed_subvol,
+                                           hashed_subvol->fops->unlink, &local->loc,
+                                           local->flags, xdata);
                         return 0;
                 }
         }
@@ -2815,7 +2816,7 @@ dht_err_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 {
         dht_local_t  *local = NULL;
         int           this_call_cnt = 0;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
 
         local = frame->local;
         prev = cookie;
@@ -2826,7 +2827,7 @@ dht_err_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         local->op_errno = op_errno;
                         gf_msg_debug (this->name, op_errno,
                                       "subvolume %s returned -1",
-                                      prev->this->name);
+                                      prev->name);
                         goto unlock;
                 }
 
@@ -2999,7 +3000,7 @@ dht_find_local_subvol_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 {
         dht_local_t  *local         = NULL;
         dht_conf_t   *conf          = NULL;
-        call_frame_t *prev          = NULL;
+        xlator_t     *prev          = NULL;
         int           this_call_cnt = 0;
         int           ret           = 0;
         char         *uuid_str      = NULL;
@@ -3048,7 +3049,7 @@ dht_find_local_subvol_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                                 gf_msg (this->name, GF_LOG_ERROR, 0,
                                         DHT_MSG_UUID_PARSE_ERROR,
                                         "Failed to parse uuid"
-                                        " failed for %s", prev->this->name);
+                                        " failed for %s", prev->name);
                                 local->op_ret = -1;
                                 local->op_errno = EINVAL;
                                 goto unlock;
@@ -3057,12 +3058,12 @@ dht_find_local_subvol_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         if (gf_uuid_compare (node_uuid, conf->defrag->node_uuid)) {
                                 gf_msg_debug (this->name, 0, "subvol %s does not"
                                               "belong to this node",
-                                              prev->this->name);
+                                              prev->name);
                         } else {
                                 conf->local_subvols[(conf->local_subvols_cnt)++]
-                                        = prev->this;
+                                        = prev;
                                 gf_msg_debug (this->name, 0, "subvol %s belongs to"
-                                              " this node", prev->this->name);
+                                              " this node", prev->name);
                                 break;
                         }
                 }
@@ -3159,7 +3160,7 @@ dht_vgetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         dht_local_t  *local         = NULL;
         int           ret           = 0;
         dict_t       *dict          = NULL;
-        call_frame_t *prev          = NULL;
+        xlator_t     *prev          = NULL;
         gf_boolean_t  flag          = _gf_true;
 
         local = frame->local;
@@ -3171,7 +3172,7 @@ dht_vgetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 gf_msg (this->name, GF_LOG_ERROR, op_errno,
                         DHT_MSG_GET_XATTR_FAILED,
                         "vgetxattr: Subvolume %s returned -1",
-                         prev->this->name);
+                         prev->name);
                 goto unwind;
         }
 
@@ -3518,10 +3519,11 @@ dht_getxattr (call_frame_t *frame, xlator_t *this,
                 (void) strncpy (local->xsel, node_uuid_key, 256);
                 cnt = local->call_cnt = conf->subvolume_cnt;
                 for (i = 0; i < cnt; i++) {
-                        STACK_WIND (frame, dht_find_local_subvol_cbk,
-                                    conf->subvolumes[i],
-                                    conf->subvolumes[i]->fops->getxattr,
-                                    loc, node_uuid_key, xdata);
+                        STACK_WIND_COOKIE (frame, dht_find_local_subvol_cbk,
+                                           conf->subvolumes[i],
+                                           conf->subvolumes[i],
+                                           conf->subvolumes[i]->fops->getxattr,
+                                           loc, node_uuid_key, xdata);
                 }
                 if (node_uuid_key)
                         GF_FREE (node_uuid_key);
@@ -3559,8 +3561,9 @@ dht_getxattr (call_frame_t *frame, xlator_t *this,
                 (void) strncpy (local->xsel, key, 256);
 
                 local->call_cnt = 1;
-                STACK_WIND (frame, dht_vgetxattr_cbk, cached_subvol,
-                            cached_subvol->fops->getxattr, loc, key, xdata);
+                STACK_WIND_COOKIE (frame, dht_vgetxattr_cbk, cached_subvol,
+                                   cached_subvol, cached_subvol->fops->getxattr,
+                                   loc, key, xdata);
 
                 return 0;
         }
@@ -3705,11 +3708,11 @@ err:
 
 int
 dht_file_setxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
-                     int op_ret, int op_errno, dict_t *xdata)
+                       int op_ret, int op_errno, dict_t *xdata)
 {
         int           ret     = -1;
         dht_local_t  *local   = NULL;
-        call_frame_t *prev    = NULL;
+        xlator_t     *prev    = NULL;
         struct iatt  *stbuf   = NULL;
         inode_t      *inode   = NULL;
         xlator_t     *subvol1 = NULL, *subvol2 = NULL;
@@ -3722,7 +3725,7 @@ dht_file_setxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         if ((op_ret == -1) && !dht_inode_missing (op_errno)) {
                 gf_msg_debug (this->name, op_errno,
                               "subvolume %s returned -1.",
-                              prev->this->name);
+                              prev->name);
                 goto out;
         }
 
@@ -3828,10 +3831,11 @@ dht_fsetxattr (call_frame_t *frame, xlator_t *this,
 
         if (IA_ISDIR (fd->inode->ia_type)) {
                 for (i = 0; i < call_cnt; i++) {
-                        STACK_WIND (frame, dht_err_cbk,
-                                    layout->list[i].xlator,
-                                    layout->list[i].xlator->fops->fsetxattr,
-                                    fd, xattr, flags, NULL);
+                        STACK_WIND_COOKIE (frame, dht_err_cbk,
+                                           layout->list[i].xlator,
+                                           layout->list[i].xlator,
+                                           layout->list[i].xlator->fops->fsetxattr,
+                                           fd, xattr, flags, NULL);
                 }
 
         } else {
@@ -3850,8 +3854,9 @@ dht_fsetxattr (call_frame_t *frame, xlator_t *this,
                                       DHT_IATT_IN_XDATA_KEY, fd);
                 }
 
-                STACK_WIND (frame, dht_file_setxattr_cbk, subvol,
-                    subvol->fops->fsetxattr, fd, xattr, flags, xdata);
+                STACK_WIND_COOKIE (frame, dht_file_setxattr_cbk, subvol,
+                                   subvol, subvol->fops->fsetxattr, fd, xattr,
+                                   flags, xdata);
 
                 if (xdata)
                         dict_unref (xdata);
@@ -3887,7 +3892,7 @@ dht_checking_pathinfo_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         char         *value = NULL;
         dht_local_t  *local = NULL;
         dht_conf_t   *conf  = NULL;
-        call_frame_t *prev  = NULL;
+        xlator_t     *prev  = NULL;
         int           this_call_cnt = 0;
 
         local = frame->local;
@@ -3904,8 +3909,8 @@ dht_checking_pathinfo_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 
         if (!strcmp (value, local->key)) {
                 for (i = 0; i < conf->subvolume_cnt; i++) {
-                        if (conf->subvolumes[i] == prev->this)
-                                conf->decommissioned_bricks[i] = prev->this;
+                        if (conf->subvolumes[i] == prev)
+                                conf->decommissioned_bricks[i] = prev;
                 }
         }
 
@@ -3948,15 +3953,15 @@ dht_setxattr2 (xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret)
         local->call_cnt = 2; /* This is the second attempt */
 
         if (local->fop == GF_FOP_SETXATTR) {
-                STACK_WIND (frame, dht_file_setxattr_cbk, subvol,
-                            subvol->fops->setxattr, &local->loc,
-                            local->rebalance.xattr, local->rebalance.flags,
-                            NULL);
+                STACK_WIND_COOKIE (frame, dht_file_setxattr_cbk, subvol,
+                                   subvol, subvol->fops->setxattr, &local->loc,
+                                   local->rebalance.xattr,
+                                   local->rebalance.flags, NULL);
         } else {
-                STACK_WIND (frame, dht_file_setxattr_cbk, subvol,
-                            subvol->fops->fsetxattr, local->fd,
-                            local->rebalance.xattr, local->rebalance.flags,
-                            NULL);
+                STACK_WIND_COOKIE (frame, dht_file_setxattr_cbk, subvol,
+                                   subvol, subvol->fops->fsetxattr, local->fd,
+                                   local->rebalance.xattr,
+                                   local->rebalance.flags, NULL);
         }
 
         return 0;
@@ -4163,10 +4168,10 @@ dht_setxattr (call_frame_t *frame, xlator_t *this,
 
                 for (i = 0 ; i < conf->subvolume_cnt; i++) {
                         /* Get the pathinfo, and then compare */
-                        STACK_WIND (frame, dht_checking_pathinfo_cbk,
-                                    conf->subvolumes[i],
-                                    conf->subvolumes[i]->fops->getxattr,
-                                    loc, GF_XATTR_PATHINFO_KEY, NULL);
+                        STACK_WIND_COOKIE (frame, dht_checking_pathinfo_cbk,
+                                           conf->subvolumes[i], conf->subvolumes[i],
+                                           conf->subvolumes[i]->fops->getxattr,
+                                           loc, GF_XATTR_PATHINFO_KEY, NULL);
                 }
                 return 0;
         }
@@ -4235,10 +4240,11 @@ dht_setxattr (call_frame_t *frame, xlator_t *this,
         if (IA_ISDIR (loc->inode->ia_type)) {
 
                 for (i = 0; i < call_cnt; i++) {
-                        STACK_WIND (frame, dht_err_cbk,
-                                    layout->list[i].xlator,
-                                    layout->list[i].xlator->fops->setxattr,
-                                    loc, xattr, flags, xdata);
+                        STACK_WIND_COOKIE (frame, dht_err_cbk,
+                                           layout->list[i].xlator,
+                                           layout->list[i].xlator,
+                                           layout->list[i].xlator->fops->setxattr,
+                                           loc, xattr, flags, xdata);
                 }
 
         } else {
@@ -4252,9 +4258,9 @@ dht_setxattr (call_frame_t *frame, xlator_t *this,
                         ret = dict_set_dynstr_with_alloc (xdata,
                                               DHT_IATT_IN_XDATA_KEY, "yes");
 
-                STACK_WIND (frame, dht_file_setxattr_cbk,
-                            subvol, subvol->fops->setxattr,
-                            loc, xattr, flags, xdata);
+                STACK_WIND_COOKIE (frame, dht_file_setxattr_cbk, subvol,
+                                   subvol, subvol->fops->setxattr, loc, xattr,
+                                   flags, xdata);
 
                 if (xdata)
                         dict_unref (xdata);
@@ -4274,11 +4280,11 @@ err:
 
 int
 dht_file_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
-                     int op_ret, int op_errno, dict_t *xdata)
+                          int op_ret, int op_errno, dict_t *xdata)
 {
         int           ret     = -1;
         dht_local_t  *local   = NULL;
-        call_frame_t *prev    = NULL;
+        xlator_t     *prev    = NULL;
         struct iatt  *stbuf   = NULL;
         inode_t      *inode   = NULL;
         xlator_t     *subvol1 = NULL, *subvol2 = NULL;
@@ -4291,7 +4297,7 @@ dht_file_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         if ((op_ret == -1) && !dht_inode_missing (op_errno)) {
                 gf_msg_debug (this->name, op_errno,
                               "subvolume %s returned -1",
-                              prev->this->name);
+                              prev->name);
                 goto out;
         }
 
@@ -4374,13 +4380,13 @@ dht_removexattr2 (xlator_t *this, xlator_t *subvol, call_frame_t *frame,
                 goto err;
 
         if (local->fop == GF_FOP_REMOVEXATTR) {
-                STACK_WIND (frame, dht_file_removexattr_cbk, subvol,
-                            subvol->fops->removexattr, &local->loc,
-                            local->key, NULL);
+                STACK_WIND_COOKIE (frame, dht_file_removexattr_cbk, subvol,
+                                   subvol, subvol->fops->removexattr,
+                                   &local->loc, local->key, NULL);
         } else {
-                STACK_WIND (frame, dht_file_removexattr_cbk, subvol,
-                            subvol->fops->fremovexattr, local->fd,
-                            local->key, NULL);
+                STACK_WIND_COOKIE (frame, dht_file_removexattr_cbk, subvol,
+                                   subvol, subvol->fops->fremovexattr,
+                                   local->fd, local->key, NULL);
         }
 
         return 0;
@@ -4397,7 +4403,7 @@ dht_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 {
         dht_local_t  *local = NULL;
         int           this_call_cnt = 0;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
 
         local = frame->local;
         prev = cookie;
@@ -4408,7 +4414,7 @@ dht_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         local->op_errno = op_errno;
                         gf_msg_debug (this->name, op_errno,
                                       "subvolume %s returned -1",
-                                      prev->this->name);
+                                      prev->name);
                         goto unlock;
                 }
 
@@ -4480,10 +4486,11 @@ dht_removexattr (call_frame_t *frame, xlator_t *this,
 
         if (IA_ISDIR (loc->inode->ia_type)) {
                 for (i = 0; i < call_cnt; i++) {
-                        STACK_WIND (frame, dht_removexattr_cbk,
-                                    layout->list[i].xlator,
-                                    layout->list[i].xlator->fops->removexattr,
-                                    loc, key, NULL);
+                        STACK_WIND_COOKIE (frame, dht_removexattr_cbk,
+                                           layout->list[i].xlator,
+                                           layout->list[i].xlator,
+                                           layout->list[i].xlator->fops->removexattr,
+                                           loc, key, NULL);
                 }
 
         } else {
@@ -4500,9 +4507,9 @@ dht_removexattr (call_frame_t *frame, xlator_t *this,
                                 DHT_IATT_IN_XDATA_KEY, loc->path);
                 }
 
-                STACK_WIND (frame, dht_file_removexattr_cbk,
-                            subvol, subvol->fops->removexattr,
-                            loc, key, xdata);
+                STACK_WIND_COOKIE (frame, dht_file_removexattr_cbk, subvol,
+                                   subvol, subvol->fops->removexattr, loc, key,
+                                   xdata);
 
                 if (xdata)
                         dict_unref (xdata);
@@ -4569,10 +4576,11 @@ dht_fremovexattr (call_frame_t *frame, xlator_t *this,
 
         if (IA_ISDIR (fd->inode->ia_type)) {
                 for (i = 0; i < call_cnt; i++) {
-                        STACK_WIND (frame, dht_removexattr_cbk,
-                                    layout->list[i].xlator,
-                                    layout->list[i].xlator->fops->fremovexattr,
-                                    fd, key, NULL);
+                        STACK_WIND_COOKIE (frame, dht_removexattr_cbk,
+                                           layout->list[i].xlator,
+                                           layout->list[i].xlator,
+                                           layout->list[i].xlator->fops->fremovexattr,
+                                           fd, key, NULL);
                 }
 
         } else {
@@ -4589,9 +4597,9 @@ dht_fremovexattr (call_frame_t *frame, xlator_t *this,
                                 DHT_IATT_IN_XDATA_KEY, fd);
                 }
 
-                STACK_WIND (frame, dht_file_removexattr_cbk,
-                            subvol, subvol->fops->fremovexattr,
-                            fd, key, xdata);
+                STACK_WIND_COOKIE (frame, dht_file_removexattr_cbk, subvol,
+                                   subvol, subvol->fops->fremovexattr, fd, key,
+                                   xdata);
 
                 if (xdata)
                         dict_unref (xdata);
@@ -4613,7 +4621,7 @@ dht_fd_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 {
         dht_local_t  *local = NULL;
         int           this_call_cnt = 0;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
 
         local = frame->local;
         prev = cookie;
@@ -4624,7 +4632,7 @@ dht_fd_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         local->op_errno = op_errno;
                         gf_msg_debug (this->name, op_errno,
                                       "subvolume %s returned -1",
-                                      prev->this->name);
+                                      prev->name);
                         goto unlock;
                 }
 
@@ -4871,19 +4879,20 @@ dht_opendir (call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd,
                 local->call_cnt = conf->subvolume_cnt;
 
                 for (i = 0; i < conf->subvolume_cnt; i++) {
-                        STACK_WIND (frame, dht_fd_cbk,
-                                    conf->subvolumes[i],
-                                    conf->subvolumes[i]->fops->opendir,
-                                    loc, fd, xdata);
-
+                        STACK_WIND_COOKIE (frame, dht_fd_cbk,
+                                           conf->subvolumes[i],
+                                           conf->subvolumes[i],
+                                           conf->subvolumes[i]->fops->opendir,
+                                           loc, fd, xdata);
                 }
         } else {
                 local->call_cnt = conf->local_subvols_cnt;
                 for (i = 0; i < conf->local_subvols_cnt; i++) {
-                        STACK_WIND (frame, dht_fd_cbk,
-                                    conf->local_subvols[i],
-                                    conf->local_subvols[i]->fops->opendir,
-                                    loc, fd, xdata);
+                        STACK_WIND_COOKIE (frame, dht_fd_cbk,
+                                           conf->local_subvols[i],
+                                           conf->local_subvols[i],
+                                           conf->local_subvols[i]->fops->opendir,
+                                           loc, fd, xdata);
                 }
         }
 
@@ -4905,7 +4914,7 @@ dht_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
         gf_dirent_t              entries;
         gf_dirent_t             *orig_entry = NULL;
         gf_dirent_t             *entry = NULL;
-        call_frame_t            *prev = NULL;
+        xlator_t                *prev = NULL;
         xlator_t                *next_subvol = NULL;
         off_t                    next_offset = 0;
         int                      count = 0;
@@ -4970,7 +4979,7 @@ dht_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
                  * directory entry.
                  */
                         if (readdir_optimize) {
-                                if (prev->this == local->first_up_subvol)
+                                if (prev == local->first_up_subvol)
                                         goto list;
                                 else
                                         continue;
@@ -4980,11 +4989,11 @@ dht_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
                         hashed_subvol = methods->layout_search (this, layout,
                                                          orig_entry->d_name);
 
-                        if (prev->this == hashed_subvol)
+                        if (prev == hashed_subvol)
                                 goto list;
                         if ((hashed_subvol
                                 && dht_subvol_status (conf, hashed_subvol))
-                                ||(prev->this != local->first_up_subvol))
+                                || (prev != local->first_up_subvol))
                                 continue;
 
                         goto list;
@@ -5006,7 +5015,7 @@ list:
                 if (conf->search_unhashed == GF_DHT_LOOKUP_UNHASHED_AUTO) {
                         subvol = methods->layout_search (this, layout,
                                                          orig_entry->d_name);
-                        if (!subvol || (subvol != prev->this)) {
+                        if (!subvol || (subvol != prev)) {
                                 /* TODO: Count the number of entries which need
                                    linkfile to prove its existence in fs */
                                 layout->search_unhashed++;
@@ -5035,7 +5044,7 @@ list:
                         }
                 } else {
                         if (orig_entry->inode) {
-                                ret = dht_layout_preset (this, prev->this,
+                                ret = dht_layout_preset (this, prev,
                                                          orig_entry->inode);
                                 if (ret)
                                         gf_msg (this->name, GF_LOG_WARNING, 0,
@@ -5057,7 +5066,7 @@ list:
                                                     orig_entry->d_stat.ia_gfid);
                                 if (inode) {
                                         ret = dht_layout_preset
-                                                            (this, prev->this,
+                                                            (this, prev,
                                                              inode);
                                         if (ret)
                                                 gf_msg (this->name,
@@ -5081,7 +5090,7 @@ list:
          * distribute we're not concerned only with a posix's view of the
          * directory but the aggregated namespace' view of the directory.
          */
-        if (prev->this != dht_last_up_subvol (this))
+        if (prev != dht_last_up_subvol (this))
                 op_errno = 0;
 
 done:
@@ -5090,9 +5099,9 @@ done:
                    EOF is not yet hit on the current subvol
                 */
                 if (next_offset == 0) {
-                        next_subvol = dht_subvol_next (this, prev->this);
+                        next_subvol = dht_subvol_next (this, prev);
                 } else {
-                        next_subvol = prev->this;
+                        next_subvol = prev;
                 }
 
                 if (!next_subvol) {
@@ -5115,10 +5124,10 @@ done:
                         }
                 }
 
-                STACK_WIND (frame, dht_readdirp_cbk,
-                            next_subvol, next_subvol->fops->readdirp,
-                            local->fd, local->size, next_offset,
-                            local->xattr);
+                STACK_WIND_COOKIE (frame, dht_readdirp_cbk, next_subvol,
+                                   next_subvol, next_subvol->fops->readdirp,
+                                   local->fd, local->size, next_offset,
+                                   local->xattr);
                 return 0;
         }
 
@@ -5144,7 +5153,7 @@ dht_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         gf_dirent_t   entries;
         gf_dirent_t  *orig_entry = NULL;
         gf_dirent_t  *entry = NULL;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
         xlator_t     *next_subvol = NULL;
         off_t         next_offset = 0;
         int           count = 0;
@@ -5176,7 +5185,7 @@ dht_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 subvol = methods->layout_search (this, layout,
                                                  orig_entry->d_name);
 
-                if (!subvol || (subvol == prev->this)) {
+                if (!subvol || (subvol == prev)) {
                         entry = gf_dirent_for_name (orig_entry->d_name);
                         if (!entry) {
                                 gf_msg (this->name, GF_LOG_ERROR, ENOMEM,
@@ -5202,7 +5211,7 @@ dht_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
          * distribute we're not concerned only with a posix's view of the
          * directory but the aggregated namespace' view of the directory.
          */
-        if (prev->this != dht_last_up_subvol (this))
+        if (prev != dht_last_up_subvol (this))
                 op_errno = 0;
 
 done:
@@ -5211,18 +5220,18 @@ done:
                    EOF is not yet hit on the current subvol
                 */
                 if (next_offset == 0) {
-                        next_subvol = dht_subvol_next (this, prev->this);
+                        next_subvol = dht_subvol_next (this, prev);
                 } else {
-                        next_subvol = prev->this;
+                        next_subvol = prev;
                 }
 
                 if (!next_subvol) {
                         goto unwind;
                 }
 
-                STACK_WIND (frame, dht_readdir_cbk,
-                            next_subvol, next_subvol->fops->readdir,
-                            local->fd, local->size, next_offset, NULL);
+                STACK_WIND_COOKIE (frame, dht_readdir_cbk, next_subvol,
+                                   next_subvol, next_subvol->fops->readdir,
+                                   local->fd, local->size, next_offset, NULL);
                 return 0;
         }
 
@@ -5304,11 +5313,13 @@ dht_do_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
                         }
                 }
 
-                STACK_WIND (frame, dht_readdirp_cbk, xvol, xvol->fops->readdirp,
-                            fd, size, yoff, local->xattr);
+                STACK_WIND_COOKIE (frame, dht_readdirp_cbk, xvol, xvol,
+                                   xvol->fops->readdirp, fd, size, yoff,
+                                   local->xattr);
         } else {
-                STACK_WIND (frame, dht_readdir_cbk, xvol, xvol->fops->readdir,
-                            fd, size, yoff, local->xattr);
+                STACK_WIND_COOKIE (frame, dht_readdir_cbk, xvol, xvol,
+                                   xvol->fops->readdir, fd, size, yoff,
+                                   local->xattr);
         }
 
         return 0;
@@ -6334,9 +6345,8 @@ dht_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag,
         }
 
         local->flags = xflag;
-        STACK_WIND (frame, dht_unlink_cbk,
-                    cached_subvol, cached_subvol->fops->unlink, loc,
-                    xflag, xdata);
+        STACK_WIND_COOKIE (frame, dht_unlink_cbk, cached_subvol, cached_subvol,
+                           cached_subvol->fops->unlink, loc, xflag, xdata);
 
         return 0;
 err:
@@ -6617,7 +6627,7 @@ dht_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 fd_t *fd, inode_t *inode, struct iatt *stbuf,
                 struct iatt *preparent, struct iatt *postparent, dict_t *xdata)
 {
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
         int           ret = -1;
         dht_local_t  *local = NULL;
 
@@ -6641,11 +6651,11 @@ dht_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                                            postparent, 1);
         }
 
-        ret = dht_layout_preset (this, prev->this, inode);
+        ret = dht_layout_preset (this, prev, inode);
         if (ret != 0) {
                 gf_msg_debug (this->name, 0,
                               "could not set preset layout for subvol %s",
-                              prev->this->name);
+                              prev->name);
                 op_ret   = -1;
                 op_errno = EINVAL;
                 goto out;
@@ -6717,10 +6727,10 @@ dht_create_linkfile_create_cbk (call_frame_t *frame, void *cookie,
                 dict_del (local->params, GLUSTERFS_INTERNAL_FOP_KEY);
         }
 
-        STACK_WIND (frame, dht_create_cbk,
-                    cached_subvol, cached_subvol->fops->create,
-                    &local->loc, local->flags, local->mode,
-                    local->umask, local->fd, local->params);
+        STACK_WIND_COOKIE (frame, dht_create_cbk, cached_subvol,
+                           cached_subvol, cached_subvol->fops->create,
+                           &local->loc, local->flags, local->mode,
+                           local->umask, local->fd, local->params);
 
         return 0;
 err:
@@ -6750,9 +6760,9 @@ dht_create_wind_to_avail_subvol (call_frame_t *frame, xlator_t *this,
                               "creating %s on %s", loc->path,
                               subvol->name);
 
-                STACK_WIND (frame, dht_create_cbk,
-                            subvol, subvol->fops->create,
-                            loc, flags, mode, umask, fd, params);
+                STACK_WIND_COOKIE (frame, dht_create_cbk, subvol,
+                                   subvol, subvol->fops->create,
+                                   loc, flags, mode, umask, fd, params);
 
         } else {
                 avail_subvol = dht_free_disk_available_subvol (this, subvol, local);
@@ -6778,9 +6788,9 @@ dht_create_wind_to_avail_subvol (call_frame_t *frame, xlator_t *this,
                 gf_msg_debug (this->name, 0,
                               "creating %s on %s", loc->path, subvol->name);
 
-                STACK_WIND (frame, dht_create_cbk,
-                            subvol, subvol->fops->create,
-                            loc, flags, mode, umask, fd, params);
+                STACK_WIND_COOKIE (frame, dht_create_cbk, subvol,
+                                   subvol, subvol->fops->create,
+                                   loc, flags, mode, umask, fd, params);
         }
 out:
         return 0;
@@ -7062,9 +7072,9 @@ dht_create (call_frame_t *frame, xlator_t *this,
                         DHT_MSG_SUBVOL_INFO,
                         "creating %s on %s (got create on %s)",
                         local->loc.path, subvol->name, loc->path);
-                STACK_WIND (frame, dht_create_cbk,
-                            subvol, subvol->fops->create,
-                            &local->loc, flags, mode, umask, fd, params);
+                STACK_WIND_COOKIE (frame, dht_create_cbk, subvol,
+                                   subvol, subvol->fops->create, &local->loc,
+                                   flags, mode, umask, fd, params);
                 goto done;
         }
 
@@ -7208,19 +7218,19 @@ dht_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         int           ret = -1;
         gf_boolean_t subvol_filled = _gf_false;
         gf_boolean_t dir_exists = _gf_false;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
         dht_layout_t *layout = NULL;
 
         local = frame->local;
         prev  = cookie;
         layout = local->layout;
 
-        subvol_filled = dht_is_subvol_filled (this, prev->this);
+        subvol_filled = dht_is_subvol_filled (this, prev);
 
         LOCK (&frame->lock);
         {
                 if (subvol_filled && (op_ret != -1)) {
-                        ret = dht_layout_merge (this, layout, prev->this,
+                        ret = dht_layout_merge (this, layout, prev,
                                                 -1, ENOSPC, NULL);
                 } else {
                         if (op_ret == -1 && op_errno == EEXIST) {
@@ -7234,14 +7244,14 @@ dht_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                                 op_ret = 0;
                                 dir_exists = _gf_true;
                         }
-                        ret = dht_layout_merge (this, layout, prev->this,
+                        ret = dht_layout_merge (this, layout, prev,
                                                 op_ret, op_errno, NULL);
                 }
                 if (ret)
                         gf_msg (this->name, GF_LOG_WARNING, 0,
                                 DHT_MSG_LAYOUT_MERGE_FAILED,
                                 "%s: failed to merge layouts for subvol %s",
-                                local->loc.path, prev->this->name);
+                                local->loc.path, prev->name);
 
                 if (op_ret == -1) {
                         local->op_errno = op_errno;
@@ -7251,10 +7261,9 @@ dht_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 if (dir_exists)
                         goto unlock;
 
-                dht_iatt_merge (this, &local->stbuf, stbuf, prev->this);
-                dht_iatt_merge (this, &local->preparent, preparent, prev->this);
-                dht_iatt_merge (this, &local->postparent, postparent,
-                                prev->this);
+                dht_iatt_merge (this, &local->stbuf, stbuf, prev);
+                dht_iatt_merge (this, &local->preparent, preparent, prev);
+                dht_iatt_merge (this, &local->postparent, postparent, prev);
         }
 unlock:
         UNLOCK (&frame->lock);
@@ -7382,10 +7391,9 @@ dht_mkdir_helper (call_frame_t *frame, xlator_t *this,
 
         parent_disk_layout = NULL;
 
-        STACK_WIND (frame, dht_mkdir_hashed_cbk,
-                    hashed_subvol,
-                    hashed_subvol->fops->mkdir,
-                    loc, mode, umask, params);
+        STACK_WIND_COOKIE (frame, dht_mkdir_hashed_cbk, hashed_subvol,
+                           hashed_subvol, hashed_subvol->fops->mkdir,
+                           loc, mode, umask, params);
 
         return 0;
 
@@ -7414,7 +7422,7 @@ dht_mkdir_hashed_cbk (call_frame_t *frame, void *cookie,
 {
         dht_local_t  *local                   = NULL;
         int           ret                     = -1;
-        call_frame_t *prev                    = NULL;
+        xlator_t     *prev                    = NULL;
         dht_layout_t *layout                  = NULL;
         dht_conf_t   *conf                    = NULL;
         int           i                       = 0;
@@ -7470,10 +7478,10 @@ dht_mkdir_hashed_cbk (call_frame_t *frame, void *cookie,
         dict_del (local->params, conf->xattr_name);
 
         if (dht_is_subvol_filled (this, hashed_subvol))
-                ret = dht_layout_merge (this, layout, prev->this,
+                ret = dht_layout_merge (this, layout, prev,
                                         -1, ENOSPC, NULL);
         else
-                ret = dht_layout_merge (this, layout, prev->this,
+                ret = dht_layout_merge (this, layout, prev,
                                         op_ret, op_errno, NULL);
 
         /* TODO: we may have to return from the function
@@ -7482,13 +7490,13 @@ dht_mkdir_hashed_cbk (call_frame_t *frame, void *cookie,
                 gf_msg (this->name, GF_LOG_WARNING, 0,
                         DHT_MSG_LAYOUT_MERGE_FAILED,
                         "%s: failed to merge layouts for subvol %s",
-                        local->loc.path, prev->this->name);
+                        local->loc.path, prev->name);
 
         local->op_ret = 0;
 
-        dht_iatt_merge (this, &local->stbuf, stbuf, prev->this);
-        dht_iatt_merge (this, &local->preparent, preparent, prev->this);
-        dht_iatt_merge (this, &local->postparent, postparent, prev->this);
+        dht_iatt_merge (this, &local->stbuf, stbuf, prev);
+        dht_iatt_merge (this, &local->preparent, preparent, prev);
+        dht_iatt_merge (this, &local->postparent, postparent, prev);
 
         local->call_cnt = conf->subvolume_cnt - 1;
 
@@ -7503,10 +7511,11 @@ dht_mkdir_hashed_cbk (call_frame_t *frame, void *cookie,
         for (i = 0; i < conf->subvolume_cnt; i++) {
                 if (conf->subvolumes[i] == hashed_subvol)
                         continue;
-                STACK_WIND (frame, dht_mkdir_cbk,
-                            conf->subvolumes[i],
-                            conf->subvolumes[i]->fops->mkdir, &local->loc,
-                            local->mode, local->umask, local->params);
+                STACK_WIND_COOKIE (frame, dht_mkdir_cbk, conf->subvolumes[i],
+                                   conf->subvolumes[i],
+                                   conf->subvolumes[i]->fops->mkdir,
+                                   &local->loc, local->mode, local->umask,
+                                   local->params);
         }
         return 0;
 err:
@@ -7545,10 +7554,10 @@ dht_mkdir_guard_parent_layout_cbk (call_frame_t *frame, xlator_t *this,
 
         local->op_ret = -1;
 
-        STACK_WIND (frame, dht_mkdir_hashed_cbk,
-                    local->hashed_subvol,
-                    local->hashed_subvol->fops->mkdir,
-                    loc, mode, umask, params);
+        STACK_WIND_COOKIE (frame, dht_mkdir_hashed_cbk, local->hashed_subvol,
+                           local->hashed_subvol,
+                           local->hashed_subvol->fops->mkdir,
+                           loc, mode, umask, params);
 
         return 0;
 err:
@@ -7695,7 +7704,7 @@ dht_rmdir_hashed_subvol_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         call_frame_t *heal_frame = NULL;
         dht_conf_t   *conf = NULL;
         int           this_call_cnt = 0;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
         char gfid[GF_UUID_BUF_SIZE] ={0};
 
         local = frame->local;
@@ -7719,14 +7728,13 @@ dht_rmdir_hashed_subvol_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         gf_msg_debug (this->name, op_errno,
                                       "rmdir on %s for %s failed "
                                       "(gfid = %s)",
-                                      prev->this->name, local->loc.path,
+                                      prev->name, local->loc.path,
                                       gfid);
                         goto unlock;
                 }
 
-                dht_iatt_merge (this, &local->preparent, preparent, prev->this);
-                dht_iatt_merge (this, &local->postparent, postparent,
-                                prev->this);
+                dht_iatt_merge (this, &local->preparent, preparent, prev);
+                dht_iatt_merge (this, &local->postparent, postparent, prev);
 
         }
 unlock:
@@ -7811,7 +7819,7 @@ dht_rmdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 {
         dht_local_t  *local = NULL;
         int           this_call_cnt = 0;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
         int           done = 0;
         char gfid[GF_UUID_BUF_SIZE] ={0};
         dht_local_t  *heal_local = NULL;
@@ -7838,16 +7846,15 @@ dht_rmdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         gf_msg_debug (this->name, op_errno,
                                       "rmdir on %s for %s failed."
                                       "(gfid = %s)",
-                                      prev->this->name, local->loc.path,
+                                      prev->name, local->loc.path,
                                       gfid);
                         goto unlock;
                 }
 
                 /* Track if rmdir succeeded on atleast one subvol*/
                 local->fop_succeeded = 1;
-                dht_iatt_merge (this, &local->preparent, preparent, prev->this);
-                dht_iatt_merge (this, &local->postparent, postparent,
-                                prev->this);
+                dht_iatt_merge (this, &local->preparent, preparent, prev);
+                dht_iatt_merge (this, &local->postparent, postparent, prev);
         }
 unlock:
         UNLOCK (&frame->lock);
@@ -7907,10 +7914,11 @@ unlock:
                                  *  The fop failed with ENOENT/ESTALE on
                                  *  all subvols */
 
-                                STACK_WIND (frame, dht_rmdir_hashed_subvol_cbk,
-                                            local->hashed_subvol,
-                                            local->hashed_subvol->fops->rmdir,
-                                            &local->loc, local->flags, NULL);
+                                STACK_WIND_COOKIE (frame, dht_rmdir_hashed_subvol_cbk,
+                                                   local->hashed_subvol,
+                                                   local->hashed_subvol,
+                                                   local->hashed_subvol->fops->rmdir,
+                                                   &local->loc, local->flags, NULL);
                         } else {
                          /* hashed-subvol was non-NULL and rmdir failed on
                           * all non hashed-subvols. Unwind rmdir with
@@ -8038,10 +8046,10 @@ dht_rmdir_lock_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                     (local->hashed_subvol == conf->subvolumes[i]))
                         continue;
 
-                STACK_WIND (frame, dht_rmdir_cbk,
-                            conf->subvolumes[i],
-                            conf->subvolumes[i]->fops->rmdir,
-                            &local->loc, local->flags, NULL);
+                STACK_WIND_COOKIE (frame, dht_rmdir_cbk, conf->subvolumes[i],
+                                   conf->subvolumes[i],
+                                   conf->subvolumes[i]->fops->rmdir,
+                                   &local->loc, local->flags, NULL);
         }
 
         return 0;
@@ -8093,10 +8101,10 @@ dht_rmdir_do (call_frame_t *frame, xlator_t *this)
 
         /* When DHT has only 1 child */
         if (conf->subvolume_cnt == 1) {
-                STACK_WIND (frame, dht_rmdir_hashed_subvol_cbk,
-                            conf->subvolumes[0],
-                            conf->subvolumes[0]->fops->rmdir,
-                            &local->loc, local->flags, NULL);
+                STACK_WIND_COOKIE (frame, dht_rmdir_hashed_subvol_cbk,
+                                   conf->subvolumes[0], conf->subvolumes[0],
+                                   conf->subvolumes[0]->fops->rmdir,
+                                   &local->loc, local->flags, NULL);
                 return 0;
         }
 
@@ -8158,7 +8166,7 @@ dht_rmdir_linkfile_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this
                                struct iatt *postparent, dict_t *xdata)
 {
         dht_local_t    *local = NULL;
-        call_frame_t   *prev = NULL;
+        xlator_t       *prev = NULL;
         xlator_t       *src = NULL;
         call_frame_t   *main_frame = NULL;
         dht_local_t    *main_local = NULL;
@@ -8168,7 +8176,7 @@ dht_rmdir_linkfile_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this
 
         local  = frame->local;
         prev   = cookie;
-        src    = prev->this;
+        src    = prev;
 
         main_frame = local->main_frame;
         main_local = main_frame->local;
@@ -8202,7 +8210,7 @@ dht_rmdir_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                       struct iatt *stbuf, dict_t *xattr, struct iatt *parent)
 {
         dht_local_t    *local = NULL;
-        call_frame_t   *prev = NULL;
+        xlator_t       *prev = NULL;
         xlator_t       *src = NULL;
         call_frame_t   *main_frame = NULL;
         dht_local_t    *main_local = NULL;
@@ -8212,7 +8220,7 @@ dht_rmdir_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 
         local = frame->local;
         prev  = cookie;
-        src   = prev->this;
+        src   = prev;
 
         main_frame = local->main_frame;
         main_local = main_frame->local;
@@ -8233,8 +8241,8 @@ dht_rmdir_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 goto err;
         }
 
-        STACK_WIND (frame, dht_rmdir_linkfile_unlink_cbk,
-                    src, src->fops->unlink, &local->loc, 0, NULL);
+        STACK_WIND_COOKIE (frame, dht_rmdir_linkfile_unlink_cbk, src,
+                           src, src->fops->unlink, &local->loc, 0, NULL);
         return 0;
 err:
 
@@ -8301,8 +8309,8 @@ dht_rmdir_cached_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 goto err;
         }
 
-        STACK_WIND (frame, dht_rmdir_lookup_cbk,
-                    src, src->fops->lookup, &local->loc, xattrs);
+        STACK_WIND_COOKIE (frame, dht_rmdir_lookup_cbk, src, src,
+                           src->fops->lookup, &local->loc, xattrs);
         if (xattrs)
                 dict_unref (xattrs);
 
@@ -8424,9 +8432,9 @@ dht_rmdir_is_subvol_empty (call_frame_t *frame, xlator_t *this,
                                 "Linkfile does not have link subvolume. "
                                 "path = %s, gfid = %s",
                                 lookup_local->loc.path, gfid);
-                        STACK_WIND (lookup_frame, dht_rmdir_lookup_cbk,
-                                    src, src->fops->lookup,
-                                    &lookup_local->loc, xattrs);
+                        STACK_WIND_COOKIE (lookup_frame, dht_rmdir_lookup_cbk,
+                                           src, src, src->fops->lookup,
+                                           &lookup_local->loc, xattrs);
                 } else {
                         STACK_WIND (lookup_frame, dht_rmdir_cached_lookup_cbk,
                                     subvol, subvol->fops->lookup,
@@ -8456,13 +8464,13 @@ dht_rmdir_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 {
         dht_local_t  *local = NULL;
         int           this_call_cnt = -1;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
         xlator_t     *src = NULL;
         int           ret = 0;
 
         local = frame->local;
         prev  = cookie;
-        src   = prev->this;
+        src   = prev;
 
         if (op_ret > 2) {
                 ret = dht_rmdir_is_subvol_empty (frame, this, entries, src);
@@ -8471,7 +8479,7 @@ dht_rmdir_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 case 0: /* non linkfiles exist */
                         gf_msg_trace (this->name, 0,
                                       "readdir on %s for %s returned %d "
-                                      "entries", prev->this->name,
+                                      "entries", prev->name,
                                       local->loc.path, op_ret);
                         local->op_ret = -1;
                         local->op_errno = ENOTEMPTY;
@@ -8480,7 +8488,7 @@ dht_rmdir_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         /* @ret number of linkfiles are getting unlinked */
                         gf_msg_trace (this->name, 0,
                                       "readdir on %s for %s found %d "
-                                      "linkfiles", prev->this->name,
+                                      "linkfiles", prev->name,
                                       local->loc.path, ret);
                         break;
                 }
@@ -8502,7 +8510,7 @@ dht_rmdir_opendir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 {
         dht_local_t  *local         = NULL;
         int           this_call_cnt = -1;
-        call_frame_t *prev          = NULL;
+        xlator_t     *prev          = NULL;
         dict_t       *dict          = NULL;
         int           ret           = 0;
         dht_conf_t   *conf          = this->private;
@@ -8520,7 +8528,7 @@ dht_rmdir_opendir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 gf_msg_debug (this->name, op_errno,
                               "opendir on %s for %s failed, "
                               "gfid = %s,",
-                              prev->this->name, local->loc.path, gfid);
+                              prev->name, local->loc.path, gfid);
                 if ((op_errno != ENOENT) && (op_errno != ESTALE)) {
                         local->op_ret = -1;
                         local->op_errno = op_errno;
@@ -8551,10 +8559,10 @@ dht_rmdir_opendir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 
         local->call_cnt = conf->subvolume_cnt;
         for (i = 0; i < conf->subvolume_cnt; i++) {
-                STACK_WIND (frame, dht_rmdir_readdirp_cbk,
-                            conf->subvolumes[i],
-                            conf->subvolumes[i]->fops->readdirp,
-                            local->fd, 4096, 0, dict);
+                STACK_WIND_COOKIE (frame, dht_rmdir_readdirp_cbk,
+                                   conf->subvolumes[i], conf->subvolumes[i],
+                                   conf->subvolumes[i]->fops->readdirp,
+                                   local->fd, 4096, 0, dict);
         }
 
         if (dict)
@@ -8613,10 +8621,10 @@ dht_rmdir (call_frame_t *frame, xlator_t *this, loc_t *loc, int flags,
         }
 
         for (i = 0; i < conf->subvolume_cnt; i++) {
-                STACK_WIND (frame, dht_rmdir_opendir_cbk,
-                            conf->subvolumes[i],
-                            conf->subvolumes[i]->fops->opendir,
-                            loc, local->fd, NULL);
+                STACK_WIND_COOKIE (frame, dht_rmdir_opendir_cbk,
+                                   conf->subvolumes[i], conf->subvolumes[i],
+                                   conf->subvolumes[i]->fops->opendir,
+                                   loc, local->fd, NULL);
         }
 
         return 0;
diff --git a/xlators/cluster/dht/src/dht-diskusage.c b/xlators/cluster/dht/src/dht-diskusage.c
index 1eb9e63..0695743 100644
--- a/xlators/cluster/dht/src/dht-diskusage.c
+++ b/xlators/cluster/dht/src/dht-diskusage.c
@@ -26,7 +26,7 @@ dht_du_info_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                  dict_t *xdata)
 {
 	dht_conf_t    *conf         = NULL;
-	call_frame_t  *prev          = NULL;
+	xlator_t      *prev          = NULL;
 	int            this_call_cnt = 0;
 	int            i = 0;
 	double         percent = 0;
@@ -41,7 +41,7 @@ dht_du_info_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 	if (op_ret == -1) {
 		gf_msg (this->name, GF_LOG_WARNING, op_errno,
                         DHT_MSG_GET_DISK_INFO_ERROR,
-			"failed to get disk info from %s", prev->this->name);
+			"failed to get disk info from %s", prev->name);
 		goto out;
 	}
 
@@ -76,7 +76,7 @@ dht_du_info_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 	LOCK (&conf->subvolume_lock);
 	{
 		for (i = 0; i < conf->subvolume_cnt; i++)
-			if (prev->this == conf->subvolumes[i]) {
+			if (prev == conf->subvolumes[i]) {
 				conf->du_stats[i].avail_percent = percent;
 				conf->du_stats[i].avail_space   = bytes;
 				conf->du_stats[i].avail_inodes  = percent_inodes;
@@ -86,7 +86,7 @@ dht_du_info_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 					      "is: %.2f and avail_space "
                                               "is: %" PRIu64" and avail_inodes"
                                               " is: %.2f",
-					      prev->this->name,
+					      prev->name,
 					      conf->du_stats[i].avail_percent,
 					      conf->du_stats[i].avail_space,
 					      conf->du_stats[i].avail_inodes);
@@ -131,10 +131,11 @@ dht_get_du_info_for_subvol (xlator_t *this, int subvol_idx)
         tmp_loc.gfid[15] = 1;
 
 	statfs_local->call_cnt = 1;
-	STACK_WIND (statfs_frame, dht_du_info_cbk,
-		    conf->subvolumes[subvol_idx],
-		    conf->subvolumes[subvol_idx]->fops->statfs,
-		    &tmp_loc, NULL);
+	STACK_WIND_COOKIE (statfs_frame, dht_du_info_cbk,
+		           conf->subvolumes[subvol_idx],
+                           conf->subvolumes[subvol_idx],
+		           conf->subvolumes[subvol_idx]->fops->statfs,
+		           &tmp_loc, NULL);
 
 	return 0;
 err:
@@ -194,10 +195,11 @@ dht_get_du_info (call_frame_t *frame, xlator_t *this, loc_t *loc)
 
 		statfs_local->call_cnt = conf->subvolume_cnt;
 		for (i = 0; i < conf->subvolume_cnt; i++) {
-			STACK_WIND (statfs_frame, dht_du_info_cbk,
-				    conf->subvolumes[i],
-				    conf->subvolumes[i]->fops->statfs,
-				    &tmp_loc, statfs_local->params);
+			STACK_WIND_COOKIE (statfs_frame, dht_du_info_cbk,
+				           conf->subvolumes[i],
+                                           conf->subvolumes[i],
+				           conf->subvolumes[i]->fops->statfs,
+				           &tmp_loc, statfs_local->params);
 		}
 
 		conf->last_stat_fetch.tv_sec = tv.tv_sec;
diff --git a/xlators/cluster/dht/src/dht-inode-read.c b/xlators/cluster/dht/src/dht-inode-read.c
index 8abf0d5..58168de 100644
--- a/xlators/cluster/dht/src/dht-inode-read.c
+++ b/xlators/cluster/dht/src/dht-inode-read.c
@@ -32,7 +32,7 @@ dht_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
               int op_ret, int op_errno, fd_t *fd, dict_t *xdata)
 {
         dht_local_t  *local = NULL;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
         int           ret = 0;
 
         local = frame->local;
@@ -42,7 +42,7 @@ dht_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         if ((op_ret == -1) && !dht_inode_missing(op_errno)) {
                 gf_msg_debug (this->name, op_errno,
                               "subvolume %s returned -1",
-                              prev->this->name);
+                              prev->name);
                 goto out;
         }
 
@@ -86,9 +86,9 @@ dht_open2 (xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret)
 
         local->call_cnt = 2;
 
-        STACK_WIND (frame, dht_open_cbk, subvol, subvol->fops->open,
-                    &local->loc, local->rebalance.flags, local->fd,
-                    NULL);
+        STACK_WIND_COOKIE (frame, dht_open_cbk, subvol, subvol,
+                           subvol->fops->open, &local->loc,
+                           local->rebalance.flags, local->fd, NULL);
         return 0;
 
 out:
@@ -126,8 +126,8 @@ dht_open (call_frame_t *frame, xlator_t *this,
         local->rebalance.flags = flags;
         local->call_cnt = 1;
 
-        STACK_WIND (frame, dht_open_cbk, subvol, subvol->fops->open,
-                    loc, flags, fd, xdata);
+        STACK_WIND_COOKIE (frame, dht_open_cbk, subvol, subvol,
+                           subvol->fops->open, loc, flags, fd, xdata);
 
         return 0;
 
@@ -145,7 +145,7 @@ dht_file_attr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         xlator_t     *subvol1 = 0;
         xlator_t     *subvol2 = 0;
         dht_local_t  *local = NULL;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
         int           ret = -1;
         inode_t      *inode = NULL;
 
@@ -161,7 +161,7 @@ dht_file_attr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 local->op_errno = op_errno;
                 gf_msg_debug (this->name, op_errno,
                               "subvolume %s returned -1",
-                              prev->this->name);
+                              prev->name);
                 goto out;
         }
 
@@ -238,11 +238,11 @@ dht_attr2 (xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret)
         local->call_cnt = 2;
 
         if (local->fop == GF_FOP_FSTAT) {
-                STACK_WIND (frame, dht_file_attr_cbk, subvol,
-                            subvol->fops->fstat, local->fd, NULL);
+                STACK_WIND_COOKIE (frame, dht_file_attr_cbk, subvol, subvol,
+                                   subvol->fops->fstat, local->fd, NULL);
         } else {
-                STACK_WIND (frame, dht_file_attr_cbk, subvol,
-                            subvol->fops->stat, &local->loc, NULL);
+                STACK_WIND_COOKIE (frame, dht_file_attr_cbk, subvol, subvol,
+                                   subvol->fops->stat, &local->loc, NULL);
         }
 
         return 0;
@@ -258,7 +258,7 @@ dht_attr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 {
         dht_local_t  *local = NULL;
         int           this_call_cnt = 0;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
 
         GF_VALIDATE_OR_GOTO ("dht", frame, err);
         GF_VALIDATE_OR_GOTO ("dht", this, out);
@@ -274,12 +274,12 @@ dht_attr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         local->op_errno = op_errno;
                         gf_msg_debug (this->name, op_errno,
                                       "subvolume %s returned -1",
-                                      prev->this->name);
+                                      prev->name);
 
                         goto unlock;
                 }
 
-                dht_iatt_merge (this, &local->stbuf, stbuf, prev->this);
+                dht_iatt_merge (this, &local->stbuf, stbuf, prev);
 
                 local->op_ret = 0;
         }
@@ -331,8 +331,8 @@ dht_stat (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata)
 
                 subvol = local->cached_subvol;
 
-                STACK_WIND (frame, dht_file_attr_cbk, subvol,
-                            subvol->fops->stat, loc, xdata);
+                STACK_WIND_COOKIE (frame, dht_file_attr_cbk, subvol, subvol,
+                                   subvol->fops->stat, loc, xdata);
 
                 return 0;
         }
@@ -342,9 +342,8 @@ dht_stat (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata)
         for (i = 0; i < call_cnt; i++) {
                 subvol = layout->list[i].xlator;
 
-                STACK_WIND (frame, dht_attr_cbk,
-                            subvol, subvol->fops->stat,
-                            loc, xdata);
+                STACK_WIND_COOKIE (frame, dht_attr_cbk, subvol, subvol,
+                                   subvol->fops->stat, loc, xdata);
         }
 
         return 0;
@@ -391,8 +390,8 @@ dht_fstat (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata)
 
                 subvol = local->cached_subvol;
 
-                STACK_WIND (frame, dht_file_attr_cbk, subvol,
-                            subvol->fops->fstat, fd, xdata);
+                STACK_WIND_COOKIE (frame, dht_file_attr_cbk, subvol, subvol,
+                                   subvol->fops->fstat, fd, xdata);
 
                 return 0;
         }
@@ -401,9 +400,8 @@ dht_fstat (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata)
 
         for (i = 0; i < call_cnt; i++) {
                 subvol = layout->list[i].xlator;
-                STACK_WIND (frame, dht_attr_cbk,
-                            subvol, subvol->fops->fstat,
-                            fd, xdata);
+                STACK_WIND_COOKIE (frame, dht_attr_cbk, subvol, subvol,
+                                   subvol->fops->fstat, fd, xdata);
         }
 
         return 0;
@@ -567,19 +565,19 @@ dht_access_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         int          ret = -1;
         dht_local_t *local = NULL;
         xlator_t    *subvol = NULL;
-        call_frame_t *prev = NULL;
+        xlator_t    *prev = NULL;
 
         local = frame->local;
         prev = cookie;
 
-        if (!prev || !prev->this)
+        if (!prev)
                 goto out;
         if (local->call_cnt != 1)
                 goto out;
         if ((op_ret == -1) && ((op_errno == ENOTCONN) ||
                 dht_inode_missing(op_errno)) &&
                 IA_ISDIR(local->loc.inode->ia_type)) {
-                subvol = dht_subvol_next_available (this, prev->this);
+                subvol = dht_subvol_next_available (this, prev);
                 if (!subvol)
                         goto out;
 
@@ -588,8 +586,9 @@ dht_access_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         goto out;
                 }
 
-                STACK_WIND (frame, dht_access_cbk, subvol, subvol->fops->access,
-                            &local->loc, local->rebalance.flags, NULL);
+                STACK_WIND_COOKIE (frame, dht_access_cbk, subvol, subvol,
+                                   subvol->fops->access, &local->loc,
+                                   local->rebalance.flags, NULL);
                 return 0;
         }
         if ((op_ret == -1) && dht_inode_missing(op_errno) &&
@@ -634,8 +633,9 @@ dht_access2 (xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret)
 
         local->call_cnt = 2;
 
-        STACK_WIND (frame, dht_access_cbk, subvol, subvol->fops->access,
-                    &local->loc, local->rebalance.flags, NULL);
+        STACK_WIND_COOKIE (frame, dht_access_cbk, subvol, subvol,
+                           subvol->fops->access, &local->loc,
+                           local->rebalance.flags, NULL);
 
         return 0;
 
@@ -675,8 +675,8 @@ dht_access (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask,
                 goto err;
         }
 
-        STACK_WIND (frame, dht_access_cbk, subvol, subvol->fops->access,
-                    loc, mask, xdata);
+        STACK_WIND_COOKIE (frame, dht_access_cbk, subvol, subvol,
+                           subvol->fops->access, loc, mask, xdata);
 
         return 0;
 
@@ -807,7 +807,7 @@ dht_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
                dict_t *xdata)
 {
         dht_local_t  *local = NULL;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
         int           ret = -1;
         inode_t      *inode = NULL;
         xlator_t     *src_subvol = 0;
@@ -820,7 +820,7 @@ dht_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
         if (op_ret == -1 && !dht_inode_missing(op_errno)) {
                 gf_msg_debug (this->name, op_errno,
                               "subvolume %s returned -1",
-                              prev->this->name);
+                              prev->name);
                 goto out;
         }
 
@@ -906,8 +906,9 @@ dht_fsync2 (xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret)
 
         local->call_cnt = 2; /* This is the second attempt */
 
-        STACK_WIND (frame, dht_fsync_cbk, subvol, subvol->fops->fsync,
-                    local->fd, local->rebalance.flags, NULL);
+        STACK_WIND_COOKIE (frame, dht_fsync_cbk, subvol, subvol,
+                           subvol->fops->fsync, local->fd,
+                           local->rebalance.flags, NULL);
 
         return 0;
 
@@ -940,8 +941,8 @@ dht_fsync (call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync,
 
         subvol = local->cached_subvol;
 
-        STACK_WIND (frame, dht_fsync_cbk, subvol, subvol->fops->fsync,
-                    fd, datasync, xdata);
+        STACK_WIND_COOKIE (frame, dht_fsync_cbk, subvol, subvol,
+                           subvol->fops->fsync, fd, datasync, xdata);
 
         return 0;
 
diff --git a/xlators/cluster/dht/src/dht-inode-write.c b/xlators/cluster/dht/src/dht-inode-write.c
index 112685b..93755b9 100644
--- a/xlators/cluster/dht/src/dht-inode-write.c
+++ b/xlators/cluster/dht/src/dht-inode-write.c
@@ -30,7 +30,7 @@ dht_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 struct iatt *postbuf, dict_t *xdata)
 {
         dht_local_t *local = NULL;
-        call_frame_t *prev = NULL;
+        xlator_t    *prev = NULL;
         int          ret   = -1;
         xlator_t    *subvol1 = NULL;
         xlator_t    *subvol2 = NULL;
@@ -49,7 +49,7 @@ dht_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 local->op_ret = -1;
                 gf_msg_debug (this->name, 0,
                               "subvolume %s returned -1 (%s)",
-                              prev->this->name, strerror (op_errno));
+                              prev->name, strerror (op_errno));
                 goto out;
         }
 
@@ -139,11 +139,12 @@ dht_writev2 (xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret)
 
         local->call_cnt = 2; /* This is the second attempt */
 
-        STACK_WIND (frame, dht_writev_cbk,
-                    subvol, subvol->fops->writev,
-                    local->fd, local->rebalance.vector, local->rebalance.count,
-                    local->rebalance.offset, local->rebalance.flags,
-                    local->rebalance.iobref, NULL);
+        STACK_WIND_COOKIE (frame, dht_writev_cbk, subvol,
+                           subvol, subvol->fops->writev,
+                           local->fd, local->rebalance.vector,
+                           local->rebalance.count,
+                           local->rebalance.offset, local->rebalance.flags,
+                           local->rebalance.iobref, NULL);
 
         return 0;
 
@@ -189,9 +190,9 @@ dht_writev (call_frame_t *frame, xlator_t *this, fd_t *fd,
         local->rebalance.iobref = iobref_ref (iobref);
         local->call_cnt = 1;
 
-        STACK_WIND (frame, dht_writev_cbk,
-                    subvol, subvol->fops->writev,
-                    fd, vector, count, off, flags, iobref, xdata);
+        STACK_WIND_COOKIE (frame, dht_writev_cbk, subvol, subvol,
+                           subvol->fops->writev, fd, vector, count, off, flags,
+                           iobref, xdata);
 
         return 0;
 
@@ -210,7 +211,7 @@ dht_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                   struct iatt *postbuf, dict_t *xdata)
 {
         dht_local_t  *local      = NULL;
-        call_frame_t *prev       = NULL;
+        xlator_t     *prev       = NULL;
         int           ret        = -1;
         xlator_t     *src_subvol = NULL;
         xlator_t     *dst_subvol = NULL;
@@ -229,7 +230,7 @@ dht_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 local->op_ret = -1;
                 gf_msg_debug (this->name, op_errno,
                               "subvolume %s returned -1",
-                              prev->this->name);
+                              prev->name);
 
                 goto out;
         }
@@ -321,13 +322,13 @@ dht_truncate2 (xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret)
         local->call_cnt = 2; /* This is the second attempt */
 
         if (local->fop == GF_FOP_TRUNCATE) {
-                STACK_WIND (frame, dht_truncate_cbk, subvol,
-                            subvol->fops->truncate, &local->loc,
-                            local->rebalance.offset, NULL);
+                STACK_WIND_COOKIE (frame, dht_truncate_cbk, subvol, subvol,
+                                   subvol->fops->truncate, &local->loc,
+                                   local->rebalance.offset, NULL);
         } else {
-                STACK_WIND (frame, dht_truncate_cbk, subvol,
-                            subvol->fops->ftruncate, local->fd,
-                            local->rebalance.offset, NULL);
+                STACK_WIND_COOKIE (frame, dht_truncate_cbk, subvol, subvol,
+                                   subvol->fops->ftruncate, local->fd,
+                                   local->rebalance.offset, NULL);
         }
 
         return 0;
@@ -367,9 +368,8 @@ dht_truncate (call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset,
                 goto err;
         }
 
-        STACK_WIND (frame, dht_truncate_cbk,
-                    subvol, subvol->fops->truncate,
-                    loc, offset, xdata);
+        STACK_WIND_COOKIE (frame, dht_truncate_cbk, subvol, subvol,
+                           subvol->fops->truncate, loc, offset, xdata);
 
         return 0;
 
@@ -408,9 +408,8 @@ dht_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
                 goto err;
         }
 
-        STACK_WIND (frame, dht_truncate_cbk,
-                    subvol, subvol->fops->ftruncate,
-                    fd, offset, xdata);
+        STACK_WIND_COOKIE (frame, dht_truncate_cbk, subvol, subvol,
+                           subvol->fops->ftruncate, fd, offset, xdata);
 
         return 0;
 
@@ -428,7 +427,7 @@ dht_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
                   struct iatt *postbuf, dict_t *xdata)
 {
         dht_local_t  *local = NULL;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
         int           ret = -1;
         xlator_t    *src_subvol = NULL;
         xlator_t    *dst_subvol = NULL;
@@ -446,7 +445,7 @@ dht_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
                 local->op_ret = -1;
                 gf_msg_debug (this->name, op_errno,
                               "subvolume %s returned -1",
-                              prev->this->name);
+                              prev->name);
 
                 goto out;
         }
@@ -531,9 +530,10 @@ dht_fallocate2 (xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret)
 
         local->call_cnt = 2; /* This is the second attempt */
 
-	STACK_WIND(frame, dht_fallocate_cbk, subvol, subvol->fops->fallocate,
-		   local->fd, local->rebalance.flags, local->rebalance.offset,
-		   local->rebalance.size, NULL);
+	STACK_WIND_COOKIE (frame, dht_fallocate_cbk, subvol, subvol,
+                           subvol->fops->fallocate, local->fd,
+                           local->rebalance.flags, local->rebalance.offset,
+		           local->rebalance.size, NULL);
 
         return 0;
 
@@ -573,9 +573,9 @@ dht_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode,
                 goto err;
         }
 
-        STACK_WIND (frame, dht_fallocate_cbk,
-                    subvol, subvol->fops->fallocate,
-                    fd, mode, offset, len, xdata);
+        STACK_WIND_COOKIE (frame, dht_fallocate_cbk, subvol, subvol,
+                           subvol->fops->fallocate, fd, mode, offset, len,
+                           xdata);
 
         return 0;
 
@@ -593,7 +593,7 @@ dht_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
                 struct iatt *postbuf, dict_t *xdata)
 {
         dht_local_t  *local = NULL;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
         int           ret = -1;
         xlator_t    *src_subvol = NULL;
         xlator_t    *dst_subvol = NULL;
@@ -611,7 +611,7 @@ dht_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
                 local->op_ret = -1;
                 gf_msg_debug (this->name, op_errno,
                               "subvolume %s returned -1",
-                              prev->this->name);
+                              prev->name);
 
                 goto out;
         }
@@ -696,9 +696,10 @@ dht_discard2 (xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret)
 
         local->call_cnt = 2; /* This is the second attempt */
 
-	STACK_WIND(frame, dht_discard_cbk, subvol, subvol->fops->discard,
-		   local->fd, local->rebalance.offset, local->rebalance.size,
-		   NULL);
+	STACK_WIND_COOKIE (frame, dht_discard_cbk, subvol, subvol,
+                           subvol->fops->discard, local->fd,
+                           local->rebalance.offset, local->rebalance.size,
+		           NULL);
 
         return 0;
 
@@ -737,8 +738,8 @@ dht_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
                 goto err;
         }
 
-        STACK_WIND (frame, dht_discard_cbk, subvol, subvol->fops->discard,
-                    fd, offset, len, xdata);
+        STACK_WIND_COOKIE (frame, dht_discard_cbk, subvol, subvol,
+                           subvol->fops->discard, fd, offset, len, xdata);
 
         return 0;
 
@@ -755,7 +756,7 @@ dht_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
                 struct iatt *postbuf, dict_t *xdata)
 {
         dht_local_t  *local   = NULL;
-        call_frame_t *prev    = NULL;
+        xlator_t     *prev    = NULL;
         int           ret     = -1;
         xlator_t     *subvol1 = NULL, *subvol2 = NULL;
 
@@ -772,7 +773,7 @@ dht_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
                 local->op_ret = -1;
                 gf_msg_debug (this->name, op_errno,
                               "subvolume %s returned -1",
-                              prev->this->name);
+                              prev->name);
                 goto out;
         }
 
@@ -859,9 +860,10 @@ dht_zerofill2 (xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret)
 
         local->call_cnt = 2; /* This is the second attempt */
 
-        STACK_WIND(frame, dht_zerofill_cbk, subvol, subvol->fops->zerofill,
-                   local->fd, local->rebalance.offset, local->rebalance.size,
-                   NULL);
+        STACK_WIND_COOKIE (frame, dht_zerofill_cbk, subvol, subvol,
+                           subvol->fops->zerofill,
+                           local->fd, local->rebalance.offset,
+                           local->rebalance.size, NULL);
 
         return 0;
 
@@ -901,8 +903,8 @@ dht_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
                 goto err;
         }
 
-        STACK_WIND (frame, dht_zerofill_cbk, subvol, subvol->fops->zerofill,
-                    fd, offset, len, xdata);
+        STACK_WIND_COOKIE (frame, dht_zerofill_cbk, subvol, subvol,
+                           subvol->fops->zerofill, fd, offset, len, xdata);
 
         return 0;
 
@@ -922,7 +924,7 @@ dht_file_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                       struct iatt *postbuf, dict_t *xdata)
 {
         dht_local_t  *local = NULL;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
         int           ret = -1;
 
         local = frame->local;
@@ -932,7 +934,7 @@ dht_file_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         if ((op_ret == -1) && !dht_inode_missing(op_errno)) {
                 gf_msg_debug (this->name, op_errno,
                               "subvolume %s returned -1",
-                              prev->this->name);
+                              prev->name);
                 goto out;
         }
 
@@ -1001,15 +1003,15 @@ dht_setattr2 (xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret)
         local->call_cnt = 2; /* This is the second attempt */
 
         if (local->fop == GF_FOP_SETATTR) {
-                STACK_WIND (frame, dht_file_setattr_cbk, subvol,
-                            subvol->fops->setattr, &local->loc,
-                            &local->rebalance.stbuf, local->rebalance.flags,
-                            NULL);
+                STACK_WIND_COOKIE (frame, dht_file_setattr_cbk, subvol,
+                                   subvol, subvol->fops->setattr, &local->loc,
+                                   &local->rebalance.stbuf, local->rebalance.flags,
+                                   NULL);
         } else {
-                STACK_WIND (frame, dht_file_setattr_cbk, subvol,
-                            subvol->fops->fsetattr, local->fd,
-                            &local->rebalance.stbuf, local->rebalance.flags,
-                            NULL);
+                STACK_WIND_COOKIE (frame, dht_file_setattr_cbk, subvol,
+                                   subvol, subvol->fops->fsetattr, local->fd,
+                                   &local->rebalance.stbuf, local->rebalance.flags,
+                                   NULL);
         }
 
         return 0;
@@ -1028,7 +1030,7 @@ dht_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 {
         dht_local_t  *local = NULL;
         int           this_call_cnt = 0;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
 
 
         local = frame->local;
@@ -1040,12 +1042,12 @@ dht_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         local->op_errno = op_errno;
                         gf_msg_debug (this->name, op_errno,
                                       "subvolume %s returned -1",
-                                      prev->this->name);
+                                      prev->name);
                         goto unlock;
                 }
 
-                dht_iatt_merge (this, &local->prebuf, statpre, prev->this);
-                dht_iatt_merge (this, &local->stbuf, statpost, prev->this);
+                dht_iatt_merge (this, &local->prebuf, statpre, prev);
+                dht_iatt_merge (this, &local->stbuf, statpost, prev);
 
                 local->op_ret = 0;
         }
@@ -1111,9 +1113,9 @@ dht_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
                 local->call_cnt = 1;
                 subvol = local->cached_subvol;
 
-                STACK_WIND (frame, dht_file_setattr_cbk, subvol,
-                            subvol->fops->setattr,
-                            loc, stbuf, valid, xdata);
+                STACK_WIND_COOKIE (frame, dht_file_setattr_cbk, subvol,
+                                   subvol, subvol->fops->setattr, loc, stbuf,
+                                   valid, xdata);
 
                 return 0;
         }
@@ -1121,10 +1123,11 @@ dht_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
         local->call_cnt = call_cnt = layout->cnt;
 
         for (i = 0; i < call_cnt; i++) {
-                STACK_WIND (frame, dht_setattr_cbk,
-                            layout->list[i].xlator,
-                            layout->list[i].xlator->fops->setattr,
-                            loc, stbuf, valid, xdata);
+                STACK_WIND_COOKIE (frame, dht_setattr_cbk,
+                                   layout->list[i].xlator,
+                                   layout->list[i].xlator,
+                                   layout->list[i].xlator->fops->setattr,
+                                   loc, stbuf, valid, xdata);
         }
 
         return 0;
@@ -1182,9 +1185,9 @@ dht_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf,
                 local->call_cnt = 1;
                 subvol = local->cached_subvol;
 
-                STACK_WIND (frame, dht_file_setattr_cbk, subvol,
-                            subvol->fops->fsetattr,
-                            fd, stbuf, valid, xdata);
+                STACK_WIND_COOKIE (frame, dht_file_setattr_cbk, subvol,
+                                   subvol, subvol->fops->fsetattr, fd, stbuf,
+                                   valid, xdata);
 
                 return 0;
         }
@@ -1192,10 +1195,11 @@ dht_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf,
         local->call_cnt = call_cnt = layout->cnt;
 
         for (i = 0; i < call_cnt; i++) {
-                STACK_WIND (frame, dht_setattr_cbk,
-                            layout->list[i].xlator,
-                            layout->list[i].xlator->fops->fsetattr,
-                            fd, stbuf, valid, xdata);
+                STACK_WIND_COOKIE (frame, dht_setattr_cbk,
+                                   layout->list[i].xlator,
+                                   layout->list[i].xlator,
+                                   layout->list[i].xlator->fops->fsetattr,
+                                   fd, stbuf, valid, xdata);
         }
 
         return 0;
diff --git a/xlators/cluster/dht/src/dht-linkfile.c b/xlators/cluster/dht/src/dht-linkfile.c
index deba213..355d830 100644
--- a/xlators/cluster/dht/src/dht-linkfile.c
+++ b/xlators/cluster/dht/src/dht-linkfile.c
@@ -24,7 +24,7 @@ dht_linkfile_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         char          is_linkfile   = 0;
         dht_conf_t   *conf          = NULL;
         dht_local_t  *local         = NULL;
-        call_frame_t *prev          = NULL;
+        xlator_t     *prev          = NULL;
         char         gfid[GF_UUID_BUF_SIZE] = {0};
 
         local = frame->local;
@@ -42,7 +42,7 @@ dht_linkfile_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 gf_msg (this->name, GF_LOG_WARNING, 0,
                         DHT_MSG_NOT_LINK_FILE_ERROR,
                         "got non-linkfile %s:%s, gfid = %s",
-                        prev->this->name, local->loc.path, gfid);
+                        prev->name, local->loc.path, gfid);
 out:
         local->linkfile.linkfile_cbk (frame, cookie, this, op_ret, op_errno,
                                       inode, stbuf, postparent, postparent,
@@ -59,7 +59,6 @@ dht_linkfile_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 {
         dht_local_t  *local = NULL;
         xlator_t     *subvol = NULL;
-        call_frame_t *prev = NULL;
         dict_t       *xattrs = NULL;
         dht_conf_t   *conf = NULL;
         int           ret = -1;
@@ -73,8 +72,7 @@ dht_linkfile_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 
         if (op_ret && (op_errno == EEXIST)) {
                 conf = this->private;
-                prev = cookie;
-                subvol = prev->this;
+                subvol = cookie;
                 if (!subvol)
                         goto out;
                 xattrs = dict_new ();
@@ -89,8 +87,9 @@ dht_linkfile_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         goto out;
                 }
 
-                STACK_WIND (frame, dht_linkfile_lookup_cbk, subvol,
-                            subvol->fops->lookup, &local->loc, xattrs);
+                STACK_WIND_COOKIE (frame, dht_linkfile_lookup_cbk, subvol,
+                                   subvol, subvol->fops->lookup, &local->loc,
+                                   xattrs);
                 if (xattrs)
                         dict_unref (xattrs);
                 return 0;
@@ -167,16 +166,16 @@ dht_linkfile_create (call_frame_t *frame, fop_mknod_cbk_t linkfile_cbk,
         /* Always create as root:root. dht_linkfile_attr_heal fixes the
          * ownsership */
         FRAME_SU_DO (frame, dht_local_t);
-        STACK_WIND (frame, dht_linkfile_create_cbk,
-                    fromvol, fromvol->fops->mknod, loc,
-                    S_IFREG | DHT_LINKFILE_MODE, 0, 0, dict);
+        STACK_WIND_COOKIE (frame, dht_linkfile_create_cbk, fromvol, fromvol,
+                           fromvol->fops->mknod, loc,
+                           S_IFREG | DHT_LINKFILE_MODE, 0, 0, dict);
 
         if (need_unref && dict)
                 dict_unref (dict);
 
         return 0;
 out:
-        local->linkfile.linkfile_cbk (frame, NULL, frame->this, -1, ENOMEM,
+        local->linkfile.linkfile_cbk (frame, frame->this, frame->this, -1, ENOMEM,
                                       loc->inode, NULL, NULL, NULL, NULL);
 
         if (need_unref && dict)
@@ -193,13 +192,11 @@ dht_linkfile_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                          dict_t *xdata)
 {
         dht_local_t   *local = NULL;
-        call_frame_t  *prev = NULL;
         xlator_t      *subvol = NULL;
         char           gfid[GF_UUID_BUF_SIZE] = {0};
 
         local = frame->local;
-        prev = cookie;
-        subvol = prev->this;
+        subvol = cookie;
 
 
         if (op_ret == -1) {
@@ -238,9 +235,9 @@ dht_linkfile_unlink (call_frame_t *frame, xlator_t *this,
                 goto err;
         }
 
-        STACK_WIND (unlink_frame, dht_linkfile_unlink_cbk,
-                    subvol, subvol->fops->unlink,
-                    &unlink_local->loc, 0, NULL);
+        STACK_WIND_COOKIE (unlink_frame, dht_linkfile_unlink_cbk, subvol,
+                           subvol, subvol->fops->unlink,
+                           &unlink_local->loc, 0, NULL);
 
         return 0;
 err:
diff --git a/xlators/cluster/dht/src/dht-rename.c b/xlators/cluster/dht/src/dht-rename.c
index d955ee4..7e7e715 100644
--- a/xlators/cluster/dht/src/dht-rename.c
+++ b/xlators/cluster/dht/src/dht-rename.c
@@ -27,7 +27,7 @@ dht_rename_dir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 {
         dht_local_t  *local = NULL;
         int           this_call_cnt = 0;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
         char          gfid[GF_UUID_BUF_SIZE] = {0};
 
         local = frame->local;
@@ -42,7 +42,7 @@ dht_rename_dir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         DHT_MSG_RENAME_FAILED,
                         "Rename %s -> %s on %s failed, (gfid = %s)",
                         local->loc.path, local->loc2.path,
-                        prev->this->name, gfid);
+                        prev->name, gfid);
 
                 local->op_ret   = op_ret;
                 local->op_errno = op_errno;
@@ -53,15 +53,11 @@ dht_rename_dir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
          * FIXME: is this the correct way to build stbuf and
          * parent bufs?
          */
-        dht_iatt_merge (this, &local->stbuf, stbuf, prev->this);
-        dht_iatt_merge (this, &local->preoldparent, preoldparent,
-                        prev->this);
-        dht_iatt_merge (this, &local->postoldparent, postoldparent,
-                        prev->this);
-        dht_iatt_merge (this, &local->preparent, prenewparent,
-                        prev->this);
-        dht_iatt_merge (this, &local->postparent, postnewparent,
-                        prev->this);
+        dht_iatt_merge (this, &local->stbuf, stbuf, prev);
+        dht_iatt_merge (this, &local->preoldparent, preoldparent, prev);
+        dht_iatt_merge (this, &local->postoldparent, postoldparent, prev);
+        dht_iatt_merge (this, &local->preparent, prenewparent, prev);
+        dht_iatt_merge (this, &local->postparent, postnewparent, prev);
 
 
 unwind:
@@ -90,7 +86,7 @@ dht_rename_hashed_dir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         dht_conf_t   *conf = NULL;
         dht_local_t  *local = NULL;
         int           call_cnt = 0;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
         int           i = 0;
         char          gfid[GF_UUID_BUF_SIZE] = {0};
 
@@ -108,7 +104,7 @@ dht_rename_hashed_dir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         DHT_MSG_RENAME_FAILED,
                         "rename %s -> %s on %s failed, (gfid = %s) ",
                         local->loc.path, local->loc2.path,
-                        prev->this->name, gfid );
+                        prev->name, gfid);
 
                 local->op_ret   = op_ret;
                 local->op_errno = op_errno;
@@ -119,15 +115,11 @@ dht_rename_hashed_dir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
          * FIXME: is this the correct way to build stbuf and
          * parent bufs?
          */
-        dht_iatt_merge (this, &local->stbuf, stbuf, prev->this);
-        dht_iatt_merge (this, &local->preoldparent, preoldparent,
-                        prev->this);
-        dht_iatt_merge (this, &local->postoldparent, postoldparent,
-                        prev->this);
-        dht_iatt_merge (this, &local->preparent, prenewparent,
-                        prev->this);
-        dht_iatt_merge (this, &local->postparent, postnewparent,
-                        prev->this);
+        dht_iatt_merge (this, &local->stbuf, stbuf, prev);
+        dht_iatt_merge (this, &local->preoldparent, preoldparent, prev);
+        dht_iatt_merge (this, &local->postoldparent, postoldparent, prev);
+        dht_iatt_merge (this, &local->preparent, prenewparent, prev);
+        dht_iatt_merge (this, &local->postparent, postnewparent, prev);
 
         call_cnt = local->call_cnt = conf->subvolume_cnt - 1;
 
@@ -137,10 +129,11 @@ dht_rename_hashed_dir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         for (i = 0; i < conf->subvolume_cnt; i++) {
                 if (conf->subvolumes[i] == local->dst_hashed)
                         continue;
-                STACK_WIND (frame, dht_rename_dir_cbk,
-                            conf->subvolumes[i],
-                            conf->subvolumes[i]->fops->rename,
-                            &local->loc, &local->loc2, NULL);
+                STACK_WIND_COOKIE (frame, dht_rename_dir_cbk,
+                                   conf->subvolumes[i],
+                                   conf->subvolumes[i],
+                                   conf->subvolumes[i]->fops->rename,
+                                   &local->loc, &local->loc2, NULL);
                 if (!--call_cnt)
                         break;
         }
@@ -170,10 +163,10 @@ dht_rename_dir_do (call_frame_t *frame, xlator_t *this)
 
         local->op_ret = 0;
 
-        STACK_WIND (frame, dht_rename_hashed_dir_cbk,
-                    local->dst_hashed,
-                    local->dst_hashed->fops->rename,
-                    &local->loc, &local->loc2, NULL);
+        STACK_WIND_COOKIE (frame, dht_rename_hashed_dir_cbk, local->dst_hashed,
+                           local->dst_hashed,
+                           local->dst_hashed->fops->rename,
+                           &local->loc, &local->loc2, NULL);
         return 0;
 
 err:
@@ -189,7 +182,7 @@ dht_rename_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 {
         dht_local_t  *local = NULL;
         int           this_call_cnt = -1;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
 
         local = frame->local;
         prev  = cookie;
@@ -197,7 +190,7 @@ dht_rename_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         if (op_ret > 2) {
                 gf_msg_trace (this->name, 0,
                               "readdir on %s for %s returned %d entries",
-                              prev->this->name, local->loc.path, op_ret);
+                              prev->name, local->loc.path, op_ret);
                 local->op_ret = -1;
                 local->op_errno = ENOTEMPTY;
         }
@@ -218,7 +211,7 @@ dht_rename_opendir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 {
         dht_local_t  *local = NULL;
         int           this_call_cnt = -1;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
         char          gfid[GF_UUID_BUF_SIZE] = {0};
 
         local = frame->local;
@@ -231,14 +224,13 @@ dht_rename_opendir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 gf_msg (this->name, GF_LOG_INFO, op_errno,
                         DHT_MSG_OPENDIR_FAILED,
                         "opendir on %s for %s failed,(gfid = %s) ",
-                        prev->this->name, local->loc.path, gfid);
+                        prev->name, local->loc.path, gfid);
                 goto err;
         }
 
         fd_bind (fd);
-        STACK_WIND (frame, dht_rename_readdir_cbk,
-                    prev->this, prev->this->fops->readdir,
-                    local->fd, 4096, 0, NULL);
+        STACK_WIND_COOKIE (frame, dht_rename_readdir_cbk, prev, prev,
+                           prev->fops->readdir, local->fd, 4096, 0, NULL);
 
         return 0;
 
@@ -299,10 +291,11 @@ dht_rename_dir_lock_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         }
 
         for (i = 0; i < conf->subvolume_cnt; i++) {
-                STACK_WIND (frame, dht_rename_opendir_cbk,
-                            conf->subvolumes[i],
-                            conf->subvolumes[i]->fops->opendir,
-                            &local->loc2, local->fd, NULL);
+                STACK_WIND_COOKIE (frame, dht_rename_opendir_cbk,
+                                   conf->subvolumes[i],
+                                   conf->subvolumes[i],
+                                   conf->subvolumes[i]->fops->opendir,
+                                   &local->loc2, local->fd, NULL);
         }
 
         return 0;
@@ -631,7 +624,7 @@ dht_rename_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                        struct iatt *postparent, dict_t *xdata)
 {
         dht_local_t  *local = NULL;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
         int           this_call_cnt = 0;
 
         local = frame->local;
@@ -651,7 +644,7 @@ dht_rename_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 gf_msg (this->name, GF_LOG_WARNING, op_errno,
                         DHT_MSG_UNLINK_FAILED,
                         "%s: Rename: unlink on %s failed ",
-                        local->loc.path, prev->this->name);
+                        local->loc.path, prev->name);
         }
 
         WIPE (&local->preoldparent);
@@ -725,9 +718,9 @@ dht_rename_cleanup (call_frame_t *frame)
                 DHT_MARKER_DONT_ACCOUNT(xattr_new);
 
                 FRAME_SU_DO (frame, dht_local_t);
-                STACK_WIND (frame, dht_rename_unlink_cbk,
-                            dst_hashed, dst_hashed->fops->unlink,
-                            &local->loc, 0, xattr_new);
+                STACK_WIND_COOKIE (frame, dht_rename_unlink_cbk, dst_hashed,
+                                   dst_hashed, dst_hashed->fops->unlink,
+                                   &local->loc, 0, xattr_new);
 
                 dict_unref (xattr_new);
                 xattr_new = NULL;
@@ -753,9 +746,9 @@ dht_rename_cleanup (call_frame_t *frame)
                  * it will fail.
                  */
                 FRAME_SU_DO (frame, dht_local_t);
-                STACK_WIND (frame, dht_rename_unlink_cbk,
-                            src_cached, src_cached->fops->unlink,
-                            &local->loc2, 0, xattr_new);
+                STACK_WIND_COOKIE (frame, dht_rename_unlink_cbk, src_cached,
+                                   src_cached, src_cached->fops->unlink,
+                                   &local->loc2, 0, xattr_new);
 
                 dict_unref (xattr_new);
                 xattr_new = NULL;
@@ -784,7 +777,7 @@ dht_rename_links_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                              struct iatt *preparent, struct iatt *postparent,
                              dict_t *xdata)
 {
-        call_frame_t *prev = NULL;
+        xlator_t *prev = NULL;
         dht_local_t  *local = NULL;
 
         prev = cookie;
@@ -794,7 +787,7 @@ dht_rename_links_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 gf_msg (this->name, GF_LOG_WARNING, op_errno,
                         DHT_MSG_CREATE_LINK_FAILED,
                         "link/file %s on %s failed",
-                        local->loc.path, prev->this->name);
+                        local->loc.path, prev->name);
         }
 
         if (local->linked == _gf_true) {
@@ -815,7 +808,7 @@ dht_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 dict_t *xdata)
 {
         dht_local_t  *local = NULL;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
         xlator_t     *src_hashed = NULL;
         xlator_t     *src_cached = NULL;
         xlator_t     *dst_hashed = NULL;
@@ -856,11 +849,11 @@ dht_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 
         if (op_ret == -1) {
                 /* Critical failure: unable to rename the cached file */
-                if (prev->this == src_cached) {
+                if (prev == src_cached) {
                         gf_msg (this->name, GF_LOG_WARNING, op_errno,
                                 DHT_MSG_RENAME_FAILED,
                                 "%s: Rename on %s failed, (gfid = %s) ",
-                                local->loc.path, prev->this->name,
+                                local->loc.path, prev->name,
                                 local->loc.inode ?
                                 uuid_utoa(local->loc.inode->gfid):"");
                         local->op_ret   = op_ret;
@@ -874,7 +867,7 @@ dht_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                                 DHT_MSG_RENAME_FAILED,
                                 "%s: Rename (linkto file) on %s failed, "
                                 "(gfid = %s) ",
-                                local->loc.path, prev->this->name,
+                                local->loc.path, prev->name,
                                 local->loc.inode ?
                                 uuid_utoa(local->loc.inode->gfid):"");
                 }
@@ -913,16 +906,14 @@ dht_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 err:
         /* Merge attrs only from src_cached. In case there of src_cached !=
          * dst_hashed, this ignores linkfile attrs. */
-        if (prev->this == src_cached) {
-                dht_iatt_merge (this, &local->stbuf, stbuf, prev->this);
+        if (prev == src_cached) {
+                dht_iatt_merge (this, &local->stbuf, stbuf, prev);
                 dht_iatt_merge (this, &local->preoldparent, preoldparent,
-                                prev->this);
+                                prev);
                 dht_iatt_merge (this, &local->postoldparent, postoldparent,
-                                prev->this);
-                dht_iatt_merge (this, &local->preparent, prenewparent,
-                                prev->this);
-                dht_iatt_merge (this, &local->postparent, postnewparent,
-                                prev->this);
+                                prev);
+                dht_iatt_merge (this, &local->preparent, prenewparent, prev);
+                dht_iatt_merge (this, &local->postparent, postnewparent, prev);
         }
 
 
@@ -967,9 +958,9 @@ err:
 
                 DHT_CHANGELOG_TRACK_AS_RENAME(xattr_new, &local->loc,
                                               &local->loc2);
-                STACK_WIND (frame, dht_rename_unlink_cbk,
-                            src_cached, src_cached->fops->unlink,
-                            &local->loc, 0, xattr_new);
+                STACK_WIND_COOKIE (frame, dht_rename_unlink_cbk, src_cached,
+                                   src_cached, src_cached->fops->unlink,
+                                   &local->loc, 0, xattr_new);
 
                 dict_unref (xattr_new);
                 xattr_new = NULL;
@@ -986,9 +977,9 @@ err:
 
                 DHT_MARKER_DONT_ACCOUNT(xattr_new);
 
-                STACK_WIND (frame, dht_rename_unlink_cbk,
-                            src_hashed, src_hashed->fops->unlink,
-                            &local->loc, 0, xattr_new);
+                STACK_WIND_COOKIE (frame, dht_rename_unlink_cbk, src_hashed,
+                                   src_hashed, src_hashed->fops->unlink,
+                                   &local->loc, 0, xattr_new);
 
                 dict_unref (xattr_new);
                 xattr_new = NULL;
@@ -1001,9 +992,9 @@ err:
                               "deleting old dst datafile %s @ %s",
                               local->loc2.path, dst_cached->name);
 
-                STACK_WIND (frame, dht_rename_unlink_cbk,
-                            dst_cached, dst_cached->fops->unlink,
-                            &local->loc2, 0, xattr);
+                STACK_WIND_COOKIE (frame, dht_rename_unlink_cbk, dst_cached,
+                                   dst_cached, dst_cached->fops->unlink,
+                                   &local->loc2, 0, xattr);
         }
         if (xattr)
                 dict_unref (xattr);
@@ -1063,9 +1054,9 @@ dht_do_rename (call_frame_t *frame)
 
         if (local->linked == _gf_true)
                 FRAME_SU_DO (frame, dht_local_t);
-        STACK_WIND (frame, dht_rename_cbk,
-                    rename_subvol, rename_subvol->fops->rename,
-                    &local->loc, &local->loc2, local->xattr_req);
+        STACK_WIND_COOKIE (frame, dht_rename_cbk, rename_subvol, rename_subvol,
+                           rename_subvol->fops->rename, &local->loc,
+                           &local->loc2, local->xattr_req);
         return 0;
 }
 
@@ -1077,7 +1068,7 @@ dht_rename_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                       dict_t *xdata)
 {
         dht_local_t  *local = NULL;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
 
         local = frame->local;
         prev = cookie;
@@ -1085,12 +1076,12 @@ dht_rename_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         if (op_ret == -1) {
                 gf_msg_debug (this->name, 0,
                               "link/file on %s failed (%s)",
-                              prev->this->name, strerror (op_errno));
+                              prev->name, strerror (op_errno));
                 local->op_ret   = -1;
                 local->op_errno = op_errno;
                 local->added_link = _gf_false;
         } else
-                dht_iatt_merge (this, &local->stbuf, stbuf, prev->this);
+                dht_iatt_merge (this, &local->stbuf, stbuf, prev);
 
         if (local->op_ret == -1)
                 goto cleanup;
@@ -1113,7 +1104,7 @@ dht_rename_linkto_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                       dict_t *xdata)
 {
         dht_local_t     *local = NULL;
-        call_frame_t    *prev = NULL;
+        xlator_t        *prev = NULL;
         xlator_t        *src_cached = NULL;
         dict_t          *xattr = NULL;
 
@@ -1125,7 +1116,7 @@ dht_rename_linkto_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         if (op_ret == -1) {
                 gf_msg_debug (this->name, 0,
                               "link/file on %s failed (%s)",
-                              prev->this->name, strerror (op_errno));
+                              prev->name, strerror (op_errno));
                 local->op_ret = -1;
                 local->op_errno = op_errno;
         }
@@ -1146,9 +1137,9 @@ dht_rename_linkto_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 
         local->added_link = _gf_true;
 
-        STACK_WIND (frame, dht_rename_link_cbk,
-                    src_cached, src_cached->fops->link,
-                    &local->loc, &local->loc2, xattr);
+        STACK_WIND_COOKIE (frame, dht_rename_link_cbk, src_cached, src_cached,
+                           src_cached->fops->link, &local->loc, &local->loc2,
+                           xattr);
 
         if (xattr)
                 dict_unref (xattr);
@@ -1171,7 +1162,7 @@ dht_rename_unlink_links_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                              dict_t *xdata)
 {
 	dht_local_t  *local = NULL;
-	call_frame_t *prev = NULL;
+	xlator_t     *prev = NULL;
 
 
 	local = frame->local;
@@ -1180,7 +1171,7 @@ dht_rename_unlink_links_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 	if ((op_ret == -1) && (op_errno != ENOENT)) {
 		gf_msg_debug (this->name, 0,
 		              "unlink of %s on %s failed (%s)",
-			      local->loc2.path, prev->this->name,
+			      local->loc2.path, prev->name,
                               strerror (op_errno));
 		local->op_ret   = -1;
 		local->op_errno = op_errno;
@@ -1237,9 +1228,10 @@ dht_rename_create_links (call_frame_t *frame)
 
                 DHT_MARKER_DONT_ACCOUNT(xattr_new);
 
-		STACK_WIND (frame, dht_rename_unlink_links_cbk,
-			    dst_hashed, dst_hashed->fops->unlink,
-			    &local->loc2, 0, xattr_new);
+		STACK_WIND_COOKIE (frame, dht_rename_unlink_links_cbk,
+                                   dst_hashed, dst_hashed,
+			           dst_hashed->fops->unlink, &local->loc2, 0,
+			           xattr_new);
 
                 dict_unref (xattr_new);
                 if (xattr)
@@ -1291,9 +1283,9 @@ dht_rename_create_links (call_frame_t *frame)
 
                 local->added_link = _gf_true;
 
-                STACK_WIND (frame, dht_rename_link_cbk,
-                            src_cached, src_cached->fops->link,
-                            &local->loc, &local->loc2, xattr_new);
+                STACK_WIND_COOKIE (frame, dht_rename_link_cbk, src_cached,
+                                   src_cached, src_cached->fops->link,
+                                   &local->loc, &local->loc2, xattr_new);
 
                 dict_unref (xattr_new);
         }
diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c
index fd90e54..267eb55 100644
--- a/xlators/cluster/dht/src/dht-selfheal.c
+++ b/xlators/cluster/dht/src/dht-selfheal.c
@@ -174,7 +174,7 @@ dht_refresh_layout_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 {
         dht_local_t  *local         = NULL;
         int           this_call_cnt = 0;
-        call_frame_t *prev          = NULL;
+        xlator_t     *prev          = NULL;
         dht_layout_t *layout        = NULL;
 
         GF_VALIDATE_OR_GOTO ("dht", frame, err);
@@ -189,16 +189,16 @@ dht_refresh_layout_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 
         LOCK (&frame->lock);
         {
-                op_ret = dht_layout_merge (this, layout, prev->this,
+                op_ret = dht_layout_merge (this, layout, prev,
                                            op_ret, op_errno, xattr);
 
-                dht_iatt_merge (this, &local->stbuf, stbuf, prev->this);
+                dht_iatt_merge (this, &local->stbuf, stbuf, prev);
 
                 if (op_ret == -1) {
                         local->op_errno = op_errno;
                         gf_msg_debug (this->name, op_errno,
                                       "lookup of %s on %s returned error",
-                                      local->loc.path, prev->this->name);
+                                      local->loc.path, prev->name);
 
                         goto unlock;
                 }
@@ -279,10 +279,10 @@ dht_refresh_layout (call_frame_t *frame)
         }
 
         for (i = 0; i < call_cnt; i++) {
-                STACK_WIND (frame, dht_refresh_layout_cbk,
-                            conf->subvolumes[i],
-                            conf->subvolumes[i]->fops->lookup,
-                            &local->loc, local->xattr_req);
+                STACK_WIND_COOKIE (frame, dht_refresh_layout_cbk,
+                                   conf->subvolumes[i], conf->subvolumes[i],
+                                   conf->subvolumes[i]->fops->lookup,
+                                   &local->loc, local->xattr_req);
         }
 
         return 0;
@@ -1143,7 +1143,7 @@ dht_selfheal_dir_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 {
         dht_local_t   *local = NULL;
         dht_layout_t  *layout = NULL;
-        call_frame_t  *prev = NULL;
+        xlator_t      *prev = NULL;
         xlator_t      *subvol = NULL;
         int            i = 0, ret = -1;
         int            this_call_cnt = 0;
@@ -1152,7 +1152,7 @@ dht_selfheal_dir_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         local  = frame->local;
         layout = local->selfheal.layout;
         prev   = cookie;
-        subvol = prev->this;
+        subvol = prev;
 
         if ((op_ret == 0) || ((op_ret == -1) && (op_errno == EEXIST))) {
                 for (i = 0; i < layout->cnt; i++) {
@@ -1172,8 +1172,8 @@ dht_selfheal_dir_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         local->loc.path, gfid );
                 goto out;
         }
-        dht_iatt_merge (this, &local->preparent, preparent, prev->this);
-        dht_iatt_merge (this, &local->postparent, postparent, prev->this);
+        dht_iatt_merge (this, &local->preparent, preparent, prev);
+        dht_iatt_merge (this, &local->postparent, postparent, prev);
         ret = 0;
 
 out:
@@ -1281,13 +1281,14 @@ dht_selfheal_dir_mkdir_lookup_done (call_frame_t *frame, xlator_t *this)
                                       "Creating directory %s on subvol %s",
                                       loc->path, layout->list[i].xlator->name);
 
-                        STACK_WIND (frame, dht_selfheal_dir_mkdir_cbk,
-                                    layout->list[i].xlator,
-                                    layout->list[i].xlator->fops->mkdir,
-                                    loc,
-                                    st_mode_from_ia (local->stbuf.ia_prot,
-                                                     local->stbuf.ia_type),
-                                    0, dict);
+                        STACK_WIND_COOKIE (frame, dht_selfheal_dir_mkdir_cbk,
+                                           layout->list[i].xlator,
+                                           layout->list[i].xlator,
+                                           layout->list[i].xlator->fops->mkdir,
+                                           loc,
+                                           st_mode_from_ia (local->stbuf.ia_prot,
+                                                            local->stbuf.ia_type),
+                                           0, dict);
                 }
         }
 
@@ -1313,7 +1314,7 @@ dht_selfheal_dir_mkdir_lookup_cbk (call_frame_t *frame, void *cookie,
         int           missing_dirs = 0;
         dht_layout_t  *layout = NULL;
         loc_t         *loc    = NULL;
-        call_frame_t *prev    = NULL;
+        xlator_t      *prev    = NULL;
 
         VALIDATE_OR_GOTO (this->private, err);
 
@@ -1333,7 +1334,7 @@ dht_selfheal_dir_mkdir_lookup_cbk (call_frame_t *frame, void *cookie,
                 }
 
                 if (!op_ret) {
-                        dht_iatt_merge (this, &local->stbuf, stbuf, prev->this);
+                        dht_iatt_merge (this, &local->stbuf, stbuf, prev);
                 }
 
         }
@@ -1417,10 +1418,10 @@ dht_selfheal_dir_mkdir_lock_cbk (call_frame_t *frame, void *cookie,
         */
 
         for (i = 0; i < conf->subvolume_cnt; i++) {
-                STACK_WIND (frame, dht_selfheal_dir_mkdir_lookup_cbk,
-                            conf->subvolumes[i],
-                            conf->subvolumes[i]->fops->lookup,
-                            &local->loc, NULL);
+                STACK_WIND_COOKIE (frame, dht_selfheal_dir_mkdir_lookup_cbk,
+                                   conf->subvolumes[i], conf->subvolumes[i],
+                                   conf->subvolumes[i]->fops->lookup,
+                                   &local->loc, NULL);
         }
 
         return 0;
diff --git a/xlators/cluster/dht/src/nufa.c b/xlators/cluster/dht/src/nufa.c
index 56e17d6..afa4465 100644
--- a/xlators/cluster/dht/src/nufa.c
+++ b/xlators/cluster/dht/src/nufa.c
@@ -28,7 +28,7 @@ nufa_local_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         dht_local_t  *local       = NULL;
         loc_t        *loc         = NULL;
         int           i           = 0;
-        call_frame_t *prev        = NULL;
+        xlator_t     *prev        = NULL;
         int           call_cnt    = 0;
         int           ret         = 0;
 
@@ -55,11 +55,11 @@ nufa_local_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 
         if (!is_dir && !is_linkfile) {
                 /* non-directory and not a linkfile */
-                ret = dht_layout_preset (this, prev->this, inode);
+                ret = dht_layout_preset (this, prev, inode);
                 if (ret < 0) {
                         gf_msg_debug (this->name, 0,
                                       "could not set pre-set layout for subvol"
-                                      " %s", prev->this->name);
+                                      " %s", prev->name);
                         op_ret   = -1;
                         op_errno = EINVAL;
                         goto err;
@@ -86,10 +86,11 @@ nufa_local_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 }
 
                 for (i = 0; i < call_cnt; i++) {
-                        STACK_WIND (frame, dht_lookup_dir_cbk,
-                                    conf->subvolumes[i],
-                                    conf->subvolumes[i]->fops->lookup,
-                                    &local->loc, local->xattr_req);
+                        STACK_WIND_COOKIE (frame, dht_lookup_dir_cbk,
+                                           conf->subvolumes[i],
+                                           conf->subvolumes[i],
+                                           conf->subvolumes[i]->fops->lookup,
+                                           &local->loc, local->xattr_req);
                 }
         }
 
@@ -104,9 +105,9 @@ nufa_local_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         return 0;
                 }
 
-                STACK_WIND (frame, dht_lookup_linkfile_cbk,
-                            subvol, subvol->fops->lookup,
-                            &local->loc, local->xattr_req);
+                STACK_WIND_COOKIE (frame, dht_lookup_linkfile_cbk, subvol,
+                                   subvol, subvol->fops->lookup,
+                                   &local->loc, local->xattr_req);
         }
 
         return 0;
@@ -121,9 +122,10 @@ out:
                 return 0;
         }
 
-        STACK_WIND (frame, dht_lookup_cbk,
-                    local->hashed_subvol, local->hashed_subvol->fops->lookup,
-                    &local->loc, local->xattr_req);
+        STACK_WIND_COOKIE (frame, dht_lookup_cbk, local->hashed_subvol,
+                           local->hashed_subvol,
+                           local->hashed_subvol->fops->lookup,
+                           &local->loc, local->xattr_req);
 
         return 0;
 
@@ -211,9 +213,9 @@ nufa_lookup (call_frame_t *frame, xlator_t *this,
                 for (i = 0; i < layout->cnt; i++) {
                         subvol = layout->list[i].xlator;
 
-                        STACK_WIND (frame, dht_revalidate_cbk,
-                                    subvol, subvol->fops->lookup,
-                                    loc, local->xattr_req);
+                        STACK_WIND_COOKIE (frame, dht_revalidate_cbk, subvol,
+                                           subvol, subvol->fops->lookup,
+                                           loc, local->xattr_req);
 
                         if (!--call_cnt)
                                 break;
@@ -241,10 +243,11 @@ nufa_lookup (call_frame_t *frame, xlator_t *this,
                 }
 
                 /* Send it to only local volume */
-                STACK_WIND (frame, nufa_local_lookup_cbk,
-                            (xlator_t *)conf->private,
-                            ((xlator_t *)conf->private)->fops->lookup,
-                            loc, local->xattr_req);
+                STACK_WIND_COOKIE (frame, nufa_local_lookup_cbk,
+                                   ((xlator_t *)conf->private),
+                                   ((xlator_t *)conf->private),
+                                   ((xlator_t *)conf->private)->fops->lookup,
+                                   loc, local->xattr_req);
         }
 
         return 0;
@@ -270,10 +273,10 @@ nufa_create_linkfile_create_cbk (call_frame_t *frame, void *cookie,
         if (op_ret == -1)
                 goto err;
 
-        STACK_WIND (frame, dht_create_cbk,
-                    local->cached_subvol, local->cached_subvol->fops->create,
-                    &local->loc, local->flags, local->mode, local->umask,
-                    local->fd, local->params);
+        STACK_WIND_COOKIE (frame, dht_create_cbk, local->cached_subvol,
+                           local->cached_subvol, local->cached_subvol->fops->create,
+                           &local->loc, local->flags, local->mode, local->umask,
+                           local->fd, local->params);
 
         return 0;
 
@@ -340,9 +343,9 @@ nufa_create (call_frame_t *frame, xlator_t *this,
         gf_msg_trace (this->name, 0,
                       "creating %s on %s", loc->path, subvol->name);
 
-        STACK_WIND (frame, dht_create_cbk,
-                    subvol, subvol->fops->create,
-                    loc, flags, mode, umask, fd, params);
+        STACK_WIND_COOKIE (frame, dht_create_cbk, subvol,
+                           subvol, subvol->fops->create,
+                           loc, flags, mode, umask, fd, params);
 
         return 0;
 
diff --git a/xlators/cluster/dht/src/switch.c b/xlators/cluster/dht/src/switch.c
index f1e9a39..9795ff4 100644
--- a/xlators/cluster/dht/src/switch.c
+++ b/xlators/cluster/dht/src/switch.c
@@ -111,7 +111,7 @@ switch_local_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         dht_local_t  *local       = NULL;
         loc_t        *loc         = NULL;
         int           i           = 0;
-        call_frame_t *prev        = NULL;
+        xlator_t     *prev        = NULL;
         int           call_cnt    = 0;
         int           ret         = 0;
 
@@ -139,12 +139,12 @@ switch_local_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         if (!is_dir && !is_linkfile) {
                 /* non-directory and not a linkfile */
 
-                ret = dht_layout_preset (this, prev->this, inode);
+                ret = dht_layout_preset (this, prev, inode);
                 if (ret < 0) {
                         gf_msg_debug (this->name, 0,
                                       "could not set pre-set layout "
                                       "for subvol %s",
-                                      prev->this->name);
+                                      prev->name);
                         op_ret   = -1;
                         op_errno = EINVAL;
                         goto err;
@@ -173,10 +173,11 @@ switch_local_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 }
 
                 for (i = 0; i < call_cnt; i++) {
-                        STACK_WIND (frame, dht_lookup_dir_cbk,
-                                    conf->subvolumes[i],
-                                    conf->subvolumes[i]->fops->lookup,
-                                    &local->loc, local->xattr_req);
+                        STACK_WIND_COOKIE (frame, dht_lookup_dir_cbk,
+                                           conf->subvolumes[i],
+                                           conf->subvolumes[i],
+                                           conf->subvolumes[i]->fops->lookup,
+                                           &local->loc, local->xattr_req);
                 }
         }
 
@@ -191,9 +192,9 @@ switch_local_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         return 0;
                 }
 
-                STACK_WIND (frame, dht_lookup_linkfile_cbk,
-                            subvol, subvol->fops->lookup,
-                            &local->loc, local->xattr_req);
+                STACK_WIND_COOKIE (frame, dht_lookup_linkfile_cbk, subvol,
+                                   subvol, subvol->fops->lookup,
+                                   &local->loc, local->xattr_req);
         }
 
         return 0;
@@ -208,9 +209,10 @@ out:
                 return 0;
         }
 
-        STACK_WIND (frame, dht_lookup_cbk,
-                    local->hashed_subvol, local->hashed_subvol->fops->lookup,
-                    &local->loc, local->xattr_req);
+        STACK_WIND_COOKIE (frame, dht_lookup_cbk, local->hashed_subvol,
+                           local->hashed_subvol,
+                           local->hashed_subvol->fops->lookup,
+                           &local->loc, local->xattr_req);
 
         return 0;
 
@@ -298,9 +300,9 @@ switch_lookup (call_frame_t *frame, xlator_t *this,
                 for (i = 0; i < layout->cnt; i++) {
                         subvol = layout->list[i].xlator;
 
-                        STACK_WIND (frame, dht_revalidate_cbk,
-                                    subvol, subvol->fops->lookup,
-                                    loc, local->xattr_req);
+                        STACK_WIND_COOKIE (frame, dht_revalidate_cbk, subvol,
+                                           subvol, subvol->fops->lookup,
+                                           loc, local->xattr_req);
 
                         if (!--call_cnt)
                                 break;
@@ -339,10 +341,11 @@ switch_lookup (call_frame_t *frame, xlator_t *this,
                         }
 
                         for (i = 0; i < call_cnt; i++) {
-                                STACK_WIND (frame, dht_lookup_dir_cbk,
-                                            conf->subvolumes[i],
-                                            conf->subvolumes[i]->fops->lookup,
-                                            &local->loc, local->xattr_req);
+                                STACK_WIND_COOKIE (frame, dht_lookup_dir_cbk,
+                                                   conf->subvolumes[i],
+                                                   conf->subvolumes[i],
+                                                   conf->subvolumes[i]->fops->lookup,
+                                                   &local->loc, local->xattr_req);
                         }
                         return 0;
                 }
@@ -351,15 +354,15 @@ switch_lookup (call_frame_t *frame, xlator_t *this,
                 cached_subvol = get_switch_matching_subvol (loc->path, conf,
                                                             hashed_subvol);
                 if (cached_subvol == hashed_subvol) {
-                        STACK_WIND (frame, dht_lookup_cbk,
-                                    hashed_subvol,
-                                    hashed_subvol->fops->lookup,
-                                    loc, local->xattr_req);
+                        STACK_WIND_COOKIE (frame, dht_lookup_cbk, hashed_subvol,
+                                           hashed_subvol,
+                                           hashed_subvol->fops->lookup,
+                                           loc, local->xattr_req);
                 } else {
-                        STACK_WIND (frame, switch_local_lookup_cbk,
-                                    cached_subvol,
-                                    cached_subvol->fops->lookup,
-                                    loc, local->xattr_req);
+                        STACK_WIND_COOKIE (frame, switch_local_lookup_cbk,
+                                           cached_subvol, cached_subvol,
+                                           cached_subvol->fops->lookup,
+                                           loc, local->xattr_req);
                 }
         }
 
@@ -386,10 +389,10 @@ switch_create_linkfile_create_cbk (call_frame_t *frame, void *cookie,
         if (op_ret == -1)
                 goto err;
 
-        STACK_WIND (frame, dht_create_cbk,
-                    local->cached_subvol, local->cached_subvol->fops->create,
-                    &local->loc, local->flags, local->mode, local->umask,
-                    local->fd, local->params);
+        STACK_WIND_COOKIE (frame, dht_create_cbk, local->cached_subvol,
+                           local->cached_subvol, local->cached_subvol->fops->create,
+                           &local->loc, local->flags, local->mode, local->umask,
+                           local->fd, local->params);
 
         return 0;
 
@@ -454,9 +457,9 @@ switch_create (call_frame_t *frame, xlator_t *this,
         gf_msg_trace (this->name, 0,
                       "creating %s on %s", loc->path, subvol->name);
 
-        STACK_WIND (frame, dht_create_cbk,
-                    subvol, subvol->fops->create,
-                    loc, flags, mode, umask, fd, params);
+        STACK_WIND_COOKIE (frame, dht_create_cbk, subvol, subvol,
+                           subvol->fops->create, loc, flags, mode, umask, fd,
+                           params);
 
         return 0;
 
diff --git a/xlators/cluster/dht/src/tier-common.c b/xlators/cluster/dht/src/tier-common.c
index 20d3f24..3b22d0a 100644
--- a/xlators/cluster/dht/src/tier-common.c
+++ b/xlators/cluster/dht/src/tier-common.c
@@ -167,7 +167,7 @@ tier_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                  fd_t *fd, inode_t *inode, struct iatt *stbuf,
                  struct iatt *preparent, struct iatt *postparent, dict_t *xdata)
 {
-        call_frame_t *prev           = NULL;
+        xlator_t     *prev           = NULL;
         int           ret            = -1;
         dht_local_t  *local          = NULL;
         xlator_t     *hashed_subvol  = NULL;
@@ -218,11 +218,11 @@ tier_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                                            postparent, 1);
         }
 
-        ret = dht_layout_preset (this, prev->this, inode);
+        ret = dht_layout_preset (this, prev, inode);
         if (ret != 0) {
                 gf_msg_debug (this->name, 0,
                               "could not set preset layout for subvol %s",
-                              prev->this->name);
+                              prev->name);
                 op_ret   = -1;
                 op_errno = EINVAL;
                 goto out;
@@ -356,10 +356,10 @@ tier_create_linkfile_create_cbk (call_frame_t *frame, void *cookie,
                         " : key = %s", TIER_LINKFILE_GFID);
         }
 
-        STACK_WIND (frame, tier_create_cbk,
-                    cached_subvol, cached_subvol->fops->create,
-                    &local->loc, local->flags, local->mode,
-                    local->umask, local->fd, local->params);
+        STACK_WIND_COOKIE (frame, tier_create_cbk, cached_subvol,
+                           cached_subvol, cached_subvol->fops->create,
+                           &local->loc, local->flags, local->mode,
+                           local->umask, local->fd, local->params);
 
         return 0;
 err:
@@ -431,9 +431,9 @@ tier_create (call_frame_t *frame, xlator_t *this,
                               "creating %s on %s", loc->path,
                               cold_subvol->name);
 
-                STACK_WIND (frame, tier_create_cbk,
-                            cold_subvol, cold_subvol->fops->create,
-                            loc, flags, mode, umask, fd, params);
+                STACK_WIND_COOKIE (frame, tier_create_cbk, cold_subvol,
+                                   cold_subvol, cold_subvol->fops->create,
+                                   loc, flags, mode, umask, fd, params);
         } else {
                 local->params = dict_ref (params);
                 local->flags = flags;
@@ -470,7 +470,7 @@ tier_unlink_nonhashed_linkfile_cbk (call_frame_t *frame, void *cookie,
                                     struct iatt *postparent, dict_t *xdata)
 {
         dht_local_t  *local = NULL;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
 
         local = frame->local;
         prev  = cookie;
@@ -483,7 +483,7 @@ tier_unlink_nonhashed_linkfile_cbk (call_frame_t *frame, void *cookie,
                         gf_msg_debug (this->name, op_errno,
                                       "Unlink link: subvolume %s"
                                       " returned -1",
-                                      prev->this->name);
+                                      prev->name);
                         goto unlock;
                 }
 
@@ -513,7 +513,7 @@ tier_unlink_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         struct iatt *postparent)
 {
         dht_local_t             *local             = NULL;
-        call_frame_t            *prev              = NULL;
+        xlator_t                *prev              = NULL;
         dht_conf_t              *conf              = NULL;
         xlator_t                *hot_subvol        = NULL;
 
@@ -526,9 +526,9 @@ tier_unlink_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 /*
                  * linkfile present on hot tier. unlinking the linkfile
                  */
-                STACK_WIND (frame, tier_unlink_nonhashed_linkfile_cbk,
-                            hot_subvol, hot_subvol->fops->unlink,
-                            &local->loc, local->flags, NULL);
+                STACK_WIND_COOKIE (frame, tier_unlink_nonhashed_linkfile_cbk,
+                                   hot_subvol, hot_subvol, hot_subvol->fops->unlink,
+                                   &local->loc, local->flags, NULL);
                 return 0;
         }
 
@@ -543,7 +543,7 @@ tier_unlink_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 }
                 gf_msg_debug (this->name, op_errno,
                               "Lookup : subvolume %s returned -1",
-                               prev->this->name);
+                               prev->name);
         }
 
         UNLOCK (&frame->lock);
@@ -560,7 +560,7 @@ tier_unlink_linkfile_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                          struct iatt *postparent, dict_t *xdata)
 {
         dht_local_t  *local = NULL;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
 
         local = frame->local;
         prev  = cookie;
@@ -576,7 +576,7 @@ tier_unlink_linkfile_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         gf_msg_debug (this->name, op_errno,
                                       "Unlink link: subvolume %s"
                                       " returned -1",
-                                      prev->this->name);
+                                      prev->name);
                         goto unlock;
                 }
 
@@ -605,7 +605,7 @@ tier_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 struct iatt *postparent, dict_t *xdata)
 {
         dht_local_t     *local          = NULL;
-        call_frame_t    *prev           = NULL;
+        xlator_t        *prev           = NULL;
         struct iatt     *stbuf          = NULL;
         dht_conf_t      *conf           = NULL;
         int              ret            = -1;
@@ -631,7 +631,7 @@ tier_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                         gf_msg_debug (this->name, op_errno,
                                       "Unlink: subvolume %s returned -1"
                                       " with errno = %d",
-                                       prev->this->name, op_errno);
+                                       prev->name, op_errno);
                         goto unlock;
                 }
 
@@ -659,10 +659,10 @@ unlock:
                  * a link file on cold tier, deleting the linkfile
                  * from cold tier
                  */
-                STACK_WIND (frame, tier_unlink_linkfile_cbk,
-                            cold_tier,
-                            cold_tier->fops->unlink, &local->loc,
-                            local->flags, xdata);
+                STACK_WIND_COOKIE (frame, tier_unlink_linkfile_cbk, cold_tier,
+                                   cold_tier, cold_tier->fops->unlink,
+                                   &local->loc,
+                                   local->flags, xdata);
                 return 0;
         }
 
@@ -673,10 +673,9 @@ unlock:
                  * File is migrating from cold to hot tier.
                  * Delete the destination linkfile.
                  */
-                STACK_WIND (frame, tier_unlink_lookup_cbk,
-                            hot_tier,
-                            hot_tier->fops->lookup,
-                            &local->loc, NULL);
+                STACK_WIND_COOKIE (frame, tier_unlink_lookup_cbk, hot_tier,
+                                   hot_tier, hot_tier->fops->lookup,
+                                   &local->loc, NULL);
                 return 0;
 
         }
@@ -750,9 +749,9 @@ tier_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag,
          * File is on hot tier, delete the data file first, then
          * linkfile from cold.
          */
-        STACK_WIND (frame, tier_unlink_cbk,
-                    cached_subvol, cached_subvol->fops->unlink, loc,
-                    xflag, xdata);
+        STACK_WIND_COOKIE (frame, tier_unlink_cbk, cached_subvol,
+                           cached_subvol, cached_subvol->fops->unlink, loc,
+                           xflag, xdata);
         if (xdata)
                 dict_unref (xdata);
         return 0;
@@ -772,7 +771,7 @@ tier_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         gf_dirent_t   entries;
         gf_dirent_t  *orig_entry = NULL;
         gf_dirent_t  *entry = NULL;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
         xlator_t     *next_subvol = NULL;
         off_t         next_offset = 0;
         int           count = 0;
@@ -811,14 +810,14 @@ done:
                    EOF is not yet hit on the current subvol
                 */
                 if (next_offset != 0) {
-                        next_subvol = prev->this;
+                        next_subvol = prev;
                 } else {
                         goto unwind;
                 }
 
-                STACK_WIND (frame, tier_readdir_cbk,
-                            next_subvol, next_subvol->fops->readdir,
-                            local->fd, local->size, next_offset, NULL);
+                STACK_WIND_COOKIE (frame, tier_readdir_cbk, next_subvol,
+                                   next_subvol, next_subvol->fops->readdir,
+                                   local->fd, local->size, next_offset, NULL);
                 return 0;
         }
 
@@ -841,7 +840,7 @@ tier_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret
         gf_dirent_t   entries;
         gf_dirent_t  *orig_entry = NULL;
         gf_dirent_t  *entry = NULL;
-        call_frame_t *prev = NULL;
+        xlator_t     *prev = NULL;
         xlator_t     *next_subvol = NULL;
         off_t         next_offset = 0;
         int           count = 0;
@@ -911,7 +910,7 @@ tier_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret
                         }
                 } else {
                         if (orig_entry->inode) {
-                                ret = dht_layout_preset (this, prev->this,
+                                ret = dht_layout_preset (this, prev,
                                                          orig_entry->inode);
                                 if (ret)
                                         gf_msg (this->name, GF_LOG_WARNING, 0,
@@ -957,15 +956,15 @@ done:
                    EOF is not yet hit on the current subvol
                 */
                 if (next_offset != 0) {
-                        next_subvol = prev->this;
+                        next_subvol = prev;
                 } else {
                         goto unwind;
                 }
 
-                STACK_WIND (frame, tier_readdirp_cbk,
-                            next_subvol, next_subvol->fops->readdirp,
-                            local->fd, local->size, next_offset,
-                            local->xattr);
+                STACK_WIND_COOKIE (frame, tier_readdirp_cbk, next_subvol,
+                                   next_subvol, next_subvol->fops->readdirp,
+                                   local->fd, local->size, next_offset,
+                                   local->xattr);
                 return 0;
         }
 
@@ -1029,14 +1028,14 @@ tier_do_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
 
                 }
 
-                STACK_WIND (frame, tier_readdirp_cbk, hashed_subvol,
-                            hashed_subvol->fops->readdirp,
-                            fd, size, yoff, local->xattr);
+                STACK_WIND_COOKIE (frame, tier_readdirp_cbk, hashed_subvol,
+                                   hashed_subvol, hashed_subvol->fops->readdirp,
+                                   fd, size, yoff, local->xattr);
 
         } else {
-                STACK_WIND (frame, tier_readdir_cbk, hashed_subvol,
-                            hashed_subvol->fops->readdir,
-                            fd, size, yoff, local->xattr);
+                STACK_WIND_COOKIE (frame, tier_readdir_cbk, hashed_subvol,
+                                   hashed_subvol, hashed_subvol->fops->readdir,
+                                   fd, size, yoff, local->xattr);
         }
 
         return 0;
-- 
1.8.3.1