summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client/src/client-callback.c
diff options
context:
space:
mode:
authorPoornima G <pgurusid@redhat.com>2015-07-09 15:22:43 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-04-29 22:37:39 -0700
commit3c8922d123471de0c5da499420fcac6b10179786 (patch)
tree0f8df8166f53ae77fa9117beb57db55a19ea08e3 /xlators/protocol/client/src/client-callback.c
parent80e3832ec16f69d4184172cfc9afa9e42533e0ef (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-callback.c')
-rw-r--r--xlators/protocol/client/src/client-callback.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/xlators/protocol/client/src/client-callback.c b/xlators/protocol/client/src/client-callback.c
index 7ee2113762a..4935ef5de7c 100644
--- a/xlators/protocol/client/src/client-callback.c
+++ b/xlators/protocol/client/src/client-callback.c
@@ -38,6 +38,45 @@ client_cbk_ino_flush (struct rpc_clnt *rpc, void *mydata, void *data)
}
int
+client_cbk_recall_lease (struct rpc_clnt *rpc, void *mydata, void *data)
+{
+ int ret = -1;
+ struct iovec *iov = NULL;
+ struct gf_upcall upcall_data = {0,};
+ uuid_t gfid;
+ struct gf_upcall_recall_lease rl_data = {0,};
+ gfs3_recall_lease_req recall_lease = {{0,},};
+
+ GF_VALIDATE_OR_GOTO ("client-callback", rpc, out);
+ GF_VALIDATE_OR_GOTO ("client-callback", mydata, out);
+ GF_VALIDATE_OR_GOTO ("client-callback", data, out);
+
+ iov = (struct iovec *)data;
+ ret = xdr_to_generic (*iov, &recall_lease,
+ (xdrproc_t)xdr_gfs3_recall_lease_req);
+
+ if (ret < 0) {
+ gf_msg (THIS->name, GF_LOG_WARNING, -ret,
+ PC_MSG_RECALL_LEASE_FAIL,
+ "XDR decode of recall lease failed.");
+ goto out;
+ }
+
+ upcall_data.data = &rl_data;
+ gf_proto_recall_lease_to_upcall (&recall_lease, &upcall_data);
+ upcall_data.event_type = GF_UPCALL_RECALL_LEASE;
+
+ gf_msg_trace (THIS->name, 0, "Upcall gfid = %s, ret = %d",
+ recall_lease.gfid, ret);
+
+ default_notify (THIS, GF_EVENT_UPCALL, &upcall_data);
+
+out:
+ return ret;
+}
+
+
+int
client_cbk_cache_invalidation (struct rpc_clnt *rpc, void *mydata, void *data)
{
int ret = -1;
@@ -128,6 +167,7 @@ rpcclnt_cb_actor_t gluster_cbk_actors[GF_CBK_MAXVALUE] = {
[GF_CBK_CACHE_INVALIDATION] = {"CACHE_INVALIDATION", GF_CBK_CACHE_INVALIDATION, client_cbk_cache_invalidation },
[GF_CBK_CHILD_UP] = {"CHILD_UP", GF_CBK_CHILD_UP, client_cbk_child_up },
[GF_CBK_CHILD_DOWN] = {"CHILD_DOWN", GF_CBK_CHILD_DOWN, client_cbk_child_down },
+ [GF_CBK_RECALL_LEASE] = {"RECALL_LEASE", GF_CBK_RECALL_LEASE, client_cbk_recall_lease },
};