diff options
Diffstat (limited to 'xlators/cluster/dht/src/dht-rename.c')
-rw-r--r-- | xlators/cluster/dht/src/dht-rename.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/xlators/cluster/dht/src/dht-rename.c b/xlators/cluster/dht/src/dht-rename.c index 82a97bc0457..4ed659b588e 100644 --- a/xlators/cluster/dht/src/dht-rename.c +++ b/xlators/cluster/dht/src/dht-rename.c @@ -565,7 +565,7 @@ dht_rename_unlock_cbk (call_frame_t *frame, void *cookie, DHT_STACK_UNWIND (rename, frame, local->op_ret, local->op_errno, &local->stbuf, &local->preoldparent, &local->postoldparent, &local->preparent, - &local->postparent, NULL); + &local->postparent, local->xattr); return 0; } @@ -876,6 +876,12 @@ dht_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this, uuid_utoa(local->loc.inode->gfid):""); } } + if (xdata) { + if (!local->xattr) + local->xattr = dict_ref (xdata); + else + local->xattr = dict_copy_with_ref (xdata, local->xattr); + } if ((src_cached == dst_cached) && (dst_hashed != dst_cached)) { link_frame = copy_frame (frame); @@ -1026,7 +1032,6 @@ dht_do_rename (call_frame_t *frame) xlator_t *dst_cached = NULL; xlator_t *this = NULL; xlator_t *rename_subvol = NULL; - dict_t *dict = NULL; local = frame->local; this = frame->this; @@ -1041,11 +1046,12 @@ dht_do_rename (call_frame_t *frame) rename_subvol = dst_hashed; if ((src_cached != dst_hashed) && (rename_subvol == dst_hashed)) { - DHT_MARKER_DONT_ACCOUNT(dict); + DHT_MARKER_DONT_ACCOUNT(local->xattr_req); } if (rename_subvol == src_cached) { - DHT_CHANGELOG_TRACK_AS_RENAME(dict, &local->loc, &local->loc2); + DHT_CHANGELOG_TRACK_AS_RENAME(local->xattr_req, &local->loc, + &local->loc2); } gf_msg_trace (this->name, 0, @@ -1056,10 +1062,7 @@ dht_do_rename (call_frame_t *frame) FRAME_SU_DO (frame, dht_local_t); STACK_WIND (frame, dht_rename_cbk, rename_subvol, rename_subvol->fops->rename, - &local->loc, &local->loc2, dict); - if (dict) - dict_unref (dict); - + &local->loc, &local->loc2, local->xattr_req); return 0; } @@ -1554,6 +1557,8 @@ dht_rename (call_frame_t *frame, xlator_t *this, local->src_cached = src_cached; local->dst_hashed = dst_hashed; local->dst_cached = dst_cached; + if (xdata) + local->xattr_req = dict_ref (xdata); gf_msg (this->name, GF_LOG_INFO, 0, DHT_MSG_RENAME_INFO, |