summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/switch.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/dht/src/switch.c')
-rw-r--r--xlators/cluster/dht/src/switch.c73
1 files changed, 38 insertions, 35 deletions
diff --git a/xlators/cluster/dht/src/switch.c b/xlators/cluster/dht/src/switch.c
index f1e9a399442..9795ff4af4d 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;