diff options
author | Poornima G <pgurusid@redhat.com> | 2015-07-09 15:22:43 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2016-04-29 22:37:39 -0700 |
commit | 3c8922d123471de0c5da499420fcac6b10179786 (patch) | |
tree | 0f8df8166f53ae77fa9117beb57db55a19ea08e3 /xlators/protocol/client/src/client.c | |
parent | 80e3832ec16f69d4184172cfc9afa9e42533e0ef (diff) |
Protocol: Add lease fop
Change-Id: I64c361d3e4ae86d57dc18bb887758d044c861237
BUG: 1319992
Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-on: http://review.gluster.org/11597
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>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/protocol/client/src/client.c')
-rw-r--r-- | xlators/protocol/client/src/client.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index f1f58eb822e..aae712acd4b 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -1478,6 +1478,34 @@ out: } int32_t +client_lease (call_frame_t *frame, xlator_t *this, loc_t *loc, + struct gf_lease *lease, dict_t *xdata) +{ + int ret = -1; + clnt_conf_t *conf = NULL; + rpc_clnt_procedure_t *proc = NULL; + clnt_args_t args = {0,}; + + conf = this->private; + if (!conf || !conf->fops) + goto out; + + args.loc = loc; + args.lease = lease; + args.xdata = xdata; + + proc = &conf->fops->proctable[GF_FOP_LEASE]; + if (proc->fn) + ret = proc->fn (frame, this, &args); +out: + if (ret) + STACK_UNWIND_STRICT (lk, frame, -1, ENOTCONN, NULL, NULL); + + return 0; +} + + +int32_t client_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, struct gf_flock *lock, dict_t *xdata) { @@ -2720,6 +2748,7 @@ struct xlator_fops fops = { .getspec = client_getspec, .ipc = client_ipc, .seek = client_seek, + .lease = client_lease, }; |