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/default-args.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/default-args.c')
-rw-r--r-- | libglusterfs/src/default-args.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/libglusterfs/src/default-args.c b/libglusterfs/src/default-args.c index ca24c2fe08c..9f788011ecb 100644 --- a/libglusterfs/src/default-args.c +++ b/libglusterfs/src/default-args.c @@ -1472,6 +1472,44 @@ out: return ret; } +int +args_setactivelk_store (default_args_t *args, loc_t *loc, + lock_migration_info_t *locklist, dict_t *xdata) +{ + lock_migration_info_t *stub_entry = NULL, *entry = NULL; + int ret = 0; + + list_for_each_entry (entry, &locklist->list, list) { + stub_entry = GF_CALLOC (1, sizeof (*stub_entry), + gf_common_mt_lock_mig); + if (!stub_entry) { + ret = -1; + goto out; + } + + INIT_LIST_HEAD (&stub_entry->list); + stub_entry->flock = entry->flock; + + stub_entry->client_uid = gf_strdup (entry->client_uid); + if (!stub_entry->client_uid) { + GF_FREE (stub_entry); + ret = -1; + goto out; + } + + list_add_tail (&stub_entry->list, + &args->locklist.list); + } + + loc_copy (&args->loc, loc); + + if (xdata) + args->xdata = dict_ref (xdata); + +out: + return ret; +} + void args_lease_store (default_args_t *args, loc_t *loc, struct gf_lease *lease, dict_t *xdata) |