summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server.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/server/src/server.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/server/src/server.c')
-rw-r--r--xlators/protocol/server/src/server.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c
index cb2a0f6c1d9..75b208c98c0 100644
--- a/xlators/protocol/server/src/server.c
+++ b/xlators/protocol/server/src/server.c
@@ -1176,16 +1176,17 @@ fini (xlator_t *this)
int
server_process_event_upcall (xlator_t *this, void *data)
{
- int ret = -1;
- server_conf_t *conf = NULL;
- client_t *client = NULL;
- char *client_uid = NULL;
- struct gf_upcall *upcall_data = NULL;
- void *up_req = NULL;
- rpc_transport_t *xprt = NULL;
- enum gf_cbk_procnum cbk_procnum = GF_CBK_NULL;
- gfs3_cbk_cache_invalidation_req gf_c_req = {0,};
- xdrproc_t xdrproc;
+ int ret = -1;
+ server_conf_t *conf = NULL;
+ client_t *client = NULL;
+ char *client_uid = NULL;
+ struct gf_upcall *upcall_data = NULL;
+ void *up_req = NULL;
+ rpc_transport_t *xprt = NULL;
+ enum gf_cbk_procnum cbk_procnum = GF_CBK_NULL;
+ gfs3_cbk_cache_invalidation_req gf_c_req = {0,};
+ gfs3_recall_lease_req gf_recall_lease = {{0,},};
+ xdrproc_t xdrproc;
GF_VALIDATE_OR_GOTO(this->name, data, out);
@@ -1193,9 +1194,7 @@ server_process_event_upcall (xlator_t *this, void *data)
GF_VALIDATE_OR_GOTO(this->name, conf, out);
upcall_data = (struct gf_upcall *)data;
-
client_uid = upcall_data->client_uid;
-
GF_VALIDATE_OR_GOTO(this->name, client_uid, out);
switch (upcall_data->event_type) {
@@ -1207,6 +1206,12 @@ server_process_event_upcall (xlator_t *this, void *data)
cbk_procnum = GF_CBK_CACHE_INVALIDATION;
xdrproc = (xdrproc_t)xdr_gfs3_cbk_cache_invalidation_req;
break;
+ case GF_UPCALL_RECALL_LEASE:
+ gf_proto_recall_lease_from_upcall (&gf_recall_lease, upcall_data);
+ up_req = &gf_recall_lease;
+ cbk_procnum = GF_CBK_RECALL_LEASE;
+ xdrproc = (xdrproc_t)xdr_gfs3_recall_lease_req;
+ break;
default:
gf_msg (this->name, GF_LOG_WARNING, EINVAL,
PS_MSG_INVALID_ENTRY,