diff options
author | Amar Tumballi <amarts@redhat.com> | 2012-03-20 17:22:24 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-03-22 16:40:27 -0700 |
commit | 9d3af972f516b6ba38d2736ce2016e34a452d569 (patch) | |
tree | 1dcdc620748a42cdfb5464c3adaae5a4a3a6f869 /xlators/lib/src | |
parent | afe542eca18888463798747d2a95e5a9d239a4a0 (diff) |
core: adding extra data for fops
with this change, the xlator APIs will have a dictionary as extra
argument, which is passed between all the layers. This can be
utilized for overloading in some of the operations.
Change-Id: I58a8186b3ef647650280e63f3e5e9b9de7827b40
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 782265
Reviewed-on: http://review.gluster.com/2960
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/lib/src')
-rw-r--r-- | xlators/lib/src/libxlator.c | 20 | ||||
-rw-r--r-- | xlators/lib/src/libxlator.h | 7 |
2 files changed, 15 insertions, 12 deletions
diff --git a/xlators/lib/src/libxlator.c b/xlators/lib/src/libxlator.c index 85b5f685e..fe11e35b5 100644 --- a/xlators/lib/src/libxlator.c +++ b/xlators/lib/src/libxlator.c @@ -77,7 +77,7 @@ marker_local_incr_errcount (xl_marker_local_t *local, int op_errno) /* Aggregate all the <volid>.xtime attrs of the cluster and send the max*/ int32_t cluster_markerxtime_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *dict) + int op_ret, int op_errno, dict_t *dict, dict_t *xdata) { @@ -186,10 +186,11 @@ out: if (need_unwind && local && local->xl_specf_unwind) { frame->local = local->xl_local; local->xl_specf_unwind (frame, op_ret, - op_errno, dict); + op_errno, dict, xdata); return 0; } else if (need_unwind) { - STACK_UNWIND_STRICT (getxattr, frame, op_ret, op_errno, dict); + STACK_UNWIND_STRICT (getxattr, frame, op_ret, op_errno, + dict, xdata); } return 0; @@ -198,7 +199,7 @@ out: int32_t cluster_markeruuid_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *dict) + int op_ret, int op_errno, dict_t *dict, dict_t *xdata) { int32_t callcnt = 0; struct volume_mark *volmark = NULL; @@ -296,10 +297,11 @@ unlock: if (need_unwind && local && local->xl_specf_unwind) { frame->local = local->xl_local; local->xl_specf_unwind (frame, op_ret, - op_errno, dict); + op_errno, dict, xdata); return 0; } else if (need_unwind){ - STACK_UNWIND_STRICT (getxattr, frame, op_ret, op_errno, dict); + STACK_UNWIND_STRICT (getxattr, frame, op_ret, op_errno, + dict, xdata); } return 0; } @@ -341,12 +343,12 @@ cluster_getmarkerattr (call_frame_t *frame,xlator_t *this, loc_t *loc, STACK_WIND (frame, cluster_markeruuid_cbk, *(sub_volumes + i), (*(sub_volumes + i))->fops->getxattr, - loc, name); + loc, name, NULL); else if (MARKER_XTIME_TYPE == type) STACK_WIND (frame, cluster_markerxtime_cbk, *(sub_volumes + i), (*(sub_volumes + i))->fops->getxattr, - loc, name); + loc, name, NULL); else { gf_log (this->name, GF_LOG_WARNING, "Unrecognized type (%d) of marker attr " @@ -354,7 +356,7 @@ cluster_getmarkerattr (call_frame_t *frame,xlator_t *this, loc_t *loc, STACK_WIND (frame, default_getxattr_cbk, *(sub_volumes + i), (*(sub_volumes + i))->fops->getxattr, - loc, name); + loc, name, NULL); break; } } diff --git a/xlators/lib/src/libxlator.h b/xlators/lib/src/libxlator.h index 1bc20ac6b..560e388c7 100644 --- a/xlators/lib/src/libxlator.h +++ b/xlators/lib/src/libxlator.h @@ -44,7 +44,8 @@ typedef int32_t (*xlator_specf_unwind_t) (call_frame_t *frame, - int op_ret, int op_errno, dict_t *dict); + int op_ret, int op_errno, + dict_t *dict, dict_t *xdata); struct volume_mark { @@ -90,11 +91,11 @@ marker_has_volinfo (xl_marker_local_t *marker) int32_t cluster_markerxtime_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *dict); + int op_ret, int op_errno, dict_t *dict, dict_t *xdata); int32_t cluster_markeruuid_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *dict); + int op_ret, int op_errno, dict_t *dict, dict_t *xdata); int32_t cluster_getmarkerattr (call_frame_t *frame,xlator_t *this, loc_t *loc, |