summaryrefslogtreecommitdiffstats
path: root/xlators/performance
diff options
context:
space:
mode:
authorPoornima G <pgurusid@redhat.com>2018-01-04 19:39:05 +0530
committerAmar Tumballi <amarts@redhat.com>2018-01-19 04:02:26 +0000
commite2323cc387562b3b65ee4e57b73a223182c48abf (patch)
treece39269d74420d7635845b7f776ac0a1e068523a /xlators/performance
parentefc30e60e233164bd4fe7fc903a7c5f718b0448b (diff)
readdir-ahead: Cleanup the xattr request code
Updates #297 Change-Id: Ia0c697583751290a455da3cd1894e0c5685d1bd8 Signed-off-by: Poornima G <pgurusid@redhat.com>
Diffstat (limited to 'xlators/performance')
-rw-r--r--xlators/performance/readdir-ahead/src/readdir-ahead.c42
1 files changed, 2 insertions, 40 deletions
diff --git a/xlators/performance/readdir-ahead/src/readdir-ahead.c b/xlators/performance/readdir-ahead/src/readdir-ahead.c
index 8f5a1f44ca5..db20c211ae6 100644
--- a/xlators/performance/readdir-ahead/src/readdir-ahead.c
+++ b/xlators/performance/readdir-ahead/src/readdir-ahead.c
@@ -475,31 +475,6 @@ err:
return -1;
}
-
-static int
-rda_unpack_mdc_loaded_keys_to_dict(char *payload, dict_t *dict)
-{
- int ret = -1;
- char *mdc_key = NULL;
-
- if (!payload || !dict) {
- goto out;
- }
-
- mdc_key = strtok(payload, " ");
- while (mdc_key != NULL) {
- ret = dict_set_int8 (dict, mdc_key, 0);
- if (ret) {
- goto out;
- }
- mdc_key = strtok(NULL, " ");
- }
-
-out:
- return ret;
-}
-
-
static int32_t
rda_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata)
@@ -529,9 +504,7 @@ static int32_t
rda_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd,
dict_t *xdata)
{
- int ret = -1;
int op_errno = 0;
- char *payload = NULL;
struct rda_local *local = NULL;
dict_t *xdata_from_req = NULL;
@@ -553,21 +526,10 @@ rda_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd,
* Retrieve list of keys set by md-cache xlator and store it
* in local to be consumed in rda_opendir_cbk
*/
- ret = dict_get_str (xdata, GF_MDC_LOADED_KEY_NAMES, &payload);
- if (ret)
- goto wind;
- ret = rda_unpack_mdc_loaded_keys_to_dict((char *) payload,
- xdata_from_req);
- if (ret)
- goto wind;
-
- dict_copy (xdata, xdata_from_req);
- dict_del (xdata_from_req, GF_MDC_LOADED_KEY_NAMES);
-
- local->xattrs = xdata_from_req;
+ local->xattrs = dict_ref (xdata);
frame->local = local;
}
-wind:
+
STACK_WIND(frame, rda_opendir_cbk, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->opendir, loc, fd, xdata);
return 0;