diff options
author | Susant Palai <spalai@redhat.com> | 2016-04-17 10:21:59 +0530 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2016-05-01 18:04:42 -0700 |
commit | 30f5e460a814358668425860530e5186570e9530 (patch) | |
tree | 22051808de01bb00d075656a981130ecec7be758 /libglusterfs/src/syncop.c | |
parent | 90a8d15ea9778b5089521767137b14cb52b9a2b3 (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/syncop.c')
-rw-r--r-- | libglusterfs/src/syncop.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c index 4fa23002e24..e3d48577d2c 100644 --- a/libglusterfs/src/syncop.c +++ b/libglusterfs/src/syncop.c @@ -3141,3 +3141,47 @@ syncop_getactivelk (xlator_t *subvol, loc_t *loc, return args.op_ret; } + +int +syncop_setactivelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + int32_t op_ret, int32_t op_errno, dict_t *xdata) +{ + struct syncargs *args = NULL; + + args = cookie; + + args->op_ret = op_ret; + args->op_errno = op_errno; + + if (xdata) + args->xdata = dict_ref (xdata); + + + __wake (args); + + return 0; + +} + +int +syncop_setactivelk (xlator_t *subvol, loc_t *loc, + lock_migration_info_t *locklist, dict_t *xdata_in, + dict_t **xdata_out) +{ + struct syncargs args = {0, }; + + SYNCOP (subvol, (&args), syncop_setactivelk_cbk, + subvol->fops->setactivelk, + loc, locklist, xdata_in); + + if (xdata_out) + *xdata_out = args.xdata; + else if (args.xdata) + dict_unref (args.xdata); + + if (args.op_ret < 0) + return -args.op_errno; + + return args.op_ret; + +} |