summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/call-stub.c
diff options
context:
space:
mode:
authorSusant Palai <spalai@redhat.com>2016-04-17 10:21:59 +0530
committerNiels de Vos <ndevos@redhat.com>2016-05-01 18:04:42 -0700
commit30f5e460a814358668425860530e5186570e9530 (patch)
tree22051808de01bb00d075656a981130ecec7be758 /libglusterfs/src/call-stub.c
parent90a8d15ea9778b5089521767137b14cb52b9a2b3 (diff)
core: add setactivelk () fop
Change-Id: Ic2ba77a1fdd27801a6e579e04e6c0dd93cd7127b BUG: 1326085 Signed-off-by: Susant Palai <spalai@redhat.com> Reviewed-on: http://review.gluster.org/14011 Reviewed-by: Niels de Vos <ndevos@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'libglusterfs/src/call-stub.c')
-rw-r--r--libglusterfs/src/call-stub.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/libglusterfs/src/call-stub.c b/libglusterfs/src/call-stub.c
index 13466e38551..9ed2493e80b 100644
--- a/libglusterfs/src/call-stub.c
+++ b/libglusterfs/src/call-stub.c
@@ -1924,6 +1924,50 @@ out:
}
+call_stub_t *
+fop_setactivelk_cbk_stub (call_frame_t *frame, fop_setactivelk_cbk_t fn,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata)
+{
+ call_stub_t *stub = NULL;
+
+ GF_VALIDATE_OR_GOTO ("call-stub", frame, out);
+
+ stub = stub_new (frame, 0, GF_FOP_SETACTIVELK);
+ GF_VALIDATE_OR_GOTO ("call-stub", stub, out);
+
+ stub->fn_cbk.setactivelk = fn;
+ stub->args_cbk.op_ret = op_ret;
+ stub->args_cbk.op_errno = op_errno;
+
+ if (xdata)
+ stub->args.xdata = dict_ref (xdata);
+
+out:
+ return stub;
+}
+
+call_stub_t *
+fop_setactivelk_stub (call_frame_t *frame, fop_setactivelk_t fn,
+ loc_t *loc, lock_migration_info_t *locklist,
+ dict_t *xdata)
+{
+ call_stub_t *stub = NULL;
+
+ GF_VALIDATE_OR_GOTO ("call-stub", frame, out);
+ GF_VALIDATE_OR_GOTO ("call-stub", fn, out);
+
+ stub = stub_new (frame, 1, GF_FOP_SETACTIVELK);
+ GF_VALIDATE_OR_GOTO ("call-stub", stub, out);
+
+ stub->fn.setactivelk = fn;
+
+ args_setactivelk_store (&stub->args, loc, locklist, xdata);
+
+out:
+ return stub;
+
+}
+
void
call_resume_wind (call_stub_t *stub)
{
@@ -2175,6 +2219,11 @@ call_resume_wind (call_stub_t *stub)
stub->fn.getactivelk (stub->frame, stub->frame->this,
&stub->args.loc, stub->args.xdata);
+ case GF_FOP_SETACTIVELK:
+ stub->fn.setactivelk (stub->frame, stub->frame->this,
+ &stub->args.loc, &stub->args.locklist,
+ stub->args.xdata);
+
default:
gf_msg_callingfn ("call-stub", GF_LOG_ERROR, EINVAL,
LG_MSG_INVALID_ENTRY, "Invalid value of FOP"
@@ -2397,6 +2446,9 @@ call_resume_unwind (call_stub_t *stub)
STUB_UNWIND (stub, getactivelk, &stub->args_cbk.locklist,
stub->args_cbk.xdata);
+ case GF_FOP_SETACTIVELK:
+ STUB_UNWIND (stub, setactivelk, stub->args_cbk.xdata);
+
default:
gf_msg_callingfn ("call-stub", GF_LOG_ERROR, EINVAL,
LG_MSG_INVALID_ENTRY, "Invalid value of FOP"