diff options
Diffstat (limited to 'xlators/cluster/nsr-server/src/all-templates.c')
-rw-r--r-- | xlators/cluster/nsr-server/src/all-templates.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/xlators/cluster/nsr-server/src/all-templates.c b/xlators/cluster/nsr-server/src/all-templates.c index 5a62ae507..3403aed8c 100644 --- a/xlators/cluster/nsr-server/src/all-templates.c +++ b/xlators/cluster/nsr-server/src/all-templates.c @@ -58,6 +58,7 @@ nsr_$NAME$ (call_frame_t *frame, xlator_t *this, int op_errno = ENOMEM; int from_leader; int from_recon; + uint32_t ti = 0; local = mem_get0(this->local_pool); if (!local) { @@ -112,6 +113,15 @@ nsr_$NAME$ (call_frame_t *frame, xlator_t *this, goto err; } + LOCK(&priv->index_lock); + ti = ++(priv->index); + UNLOCK(&priv->index_lock); + if (dict_set_int32(xdata,NSR_INDEX_XATTR,ti) != 0) { + gf_log (this->name, GF_LOG_ERROR, + "failed to set index"); + goto err; + } + local->stub = fop_$NAME$_stub (frame,nsr_$NAME$_continue, $ARGS_SHORT$); if (!local->stub) { |