From 3c8922d123471de0c5da499420fcac6b10179786 Mon Sep 17 00:00:00 2001 From: Poornima G Date: Thu, 9 Jul 2015 15:22:43 +0530 Subject: Protocol: Add lease fop Change-Id: I64c361d3e4ae86d57dc18bb887758d044c861237 BUG: 1319992 Signed-off-by: Poornima G Reviewed-on: http://review.gluster.org/11597 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Rajesh Joseph Reviewed-by: Pranith Kumar Karampuri --- xlators/protocol/client/src/client.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'xlators/protocol/client/src/client.c') 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 @@ -1477,6 +1477,34 @@ out: return 0; } +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, }; -- cgit