Here is a patch that adds code to get saLckLimitGet to work correctly.

Index: include/ipc_lck.h
===================================================================
--- include/ipc_lck.h   (revision 1938)
+++ include/ipc_lck.h   (working copy)
@@ -173,10 +173,12 @@
 
 struct req_lib_lck_limitget {
        coroipc_request_header_t header __attribute__((aligned(8)));
+       mar_uint64_t limit_id __attribute__((aligned(8)));
 } __attribute__((aligned(8)));
 
 struct res_lib_lck_limitget {
        coroipc_response_header_t header __attribute__((aligned(8)));
+       mar_uint64_t value __attribute__((aligned(8)));
 } __attribute__((aligned(8)));
 
 struct res_lib_lck_resourceopen_callback {
Index: lib/lck.c
===================================================================
--- lib/lck.c   (revision 1938)
+++ lib/lck.c   (working copy)
@@ -1270,6 +1270,7 @@
                sizeof (struct req_lib_lck_limitget);
        req_lib_lck_limitget.header.id =
                MESSAGE_REQ_LCK_LIMITGET;
+       req_lib_lck_limitget.limit_id = limitId;
 
        iov.iov_base = &req_lib_lck_limitget;
        iov.iov_len = sizeof (struct req_lib_lck_limitget);
@@ -1290,6 +1291,8 @@
                goto error_put;
        }
 
+       (*limitValue).uint64Value = res_lib_lck_limitget.value;
+
 error_put:
        hdb_handle_put (&lckHandleDatabase, lckHandle);
 error_exit:
Index: services/lck.c
===================================================================
--- services/lck.c      (revision 1938)
+++ services/lck.c      (working copy)
@@ -540,6 +540,7 @@
 struct req_exec_lck_limitget {
        coroipc_request_header_t header __attribute__((aligned(8)));
        mar_message_source_t source __attribute__((aligned(8)));
+       mar_uint64_t limit_id __attribute__((aligned(8)));
 };
 
 struct req_exec_lck_resourcelock_timeout {
@@ -708,6 +709,7 @@
 
        swab_coroipc_request_header_t (&to_swab->header);
        swab_mar_message_source_t (&to_swab->source);
+       swab_mar_uint64_t (&to_swab->limit_id);
 
        return;
 }
@@ -2443,7 +2445,8 @@
                        &res_lib_lck_resourcelockasync,
                        sizeof (struct res_lib_lck_resourcelockasync));
 
-               if ((lock != NULL) && (lock->lock_status == 
SA_LCK_LOCK_GRANTED)) {
+               /* if ((lock != NULL) && (lock->lock_status == 
SA_LCK_LOCK_GRANTED)) { */
+               if ((lock != NULL) && (lock->lock_status != 0)) {
                        lck_lockgrant_callback_send (lock, error);
                }
        }
@@ -2619,10 +2622,21 @@
                message;
        struct res_lib_lck_limitget res_lib_lck_limitget;
        SaAisErrorT error = SA_AIS_OK;
+       SaUint64T value = 0;
 
        /* DEBUG */
-       log_printf (LOGSYS_LEVEL_DEBUG, "EXEC request: 
saLckResourceLimitGet\n");
+       log_printf (LOGSYS_LEVEL_DEBUG, "EXEC request: saLckLimitGet\n");
 
+       switch (req_exec_lck_limitget->limit_id)
+       {
+       case SA_LCK_MAX_NUM_LOCKS_ID:
+               value = MAX_NUM_LOCKS;
+               break;
+       default:
+               error = SA_AIS_ERR_INVALID_PARAM;
+               break;
+       }
+
 /*error_exit:*/
        if (api->ipc_source_is_local (&req_exec_lck_limitget->source))
        {
@@ -2631,6 +2645,7 @@
                res_lib_lck_limitget.header.id =
                        MESSAGE_RES_LCK_LIMITGET;
                res_lib_lck_limitget.header.error = error;
+               res_lib_lck_limitget.value = value;
 
                api->ipc_response_send (
                        req_exec_lck_limitget->source.conn,
@@ -3194,7 +3209,7 @@
        void *conn,
        const void *msg)
 {
-/*     const struct req_lib_lck_limitget *req_lib_lck_limitget = msg;*/
+       const struct req_lib_lck_limitget *req_lib_lck_limitget = msg;
        struct req_exec_lck_limitget req_exec_lck_limitget;
        struct iovec iovec;
 
@@ -3208,6 +3223,8 @@
 
        api->ipc_source_set (&req_exec_lck_limitget.source, conn);
 
+       req_exec_lck_limitget.limit_id = req_lib_lck_limitget->limit_id;
+
        iovec.iov_base = &req_exec_lck_limitget;
        iovec.iov_len = sizeof (struct req_exec_lck_limitget);
 
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to