resource-c: remove extra resource callback calls and shortcuts.
authorIsmo Puustinen <ismo.puustinen@intel.com>
Thu, 25 Apr 2013 10:41:33 +0000 (13:41 +0300)
committerIsmo Puustinen <ismo.puustinen@intel.com>
Thu, 25 Apr 2013 11:55:04 +0000 (14:55 +0300)
The Murphy resource backend should now control the flow with the event
notifications.

src/plugins/resource-native/libmurphy-resource/resource.c
src/plugins/resource-native/libmurphy-resource/rset.c

index 34ef7dc..94c6aad 100644 (file)
@@ -317,13 +317,6 @@ static void recvfrom_msg(mrp_transport_t *transp, mrp_msg_t *msg,
 
             rset->priv->seqno = 0;
 
-            /* call the resource set callback */
-
-            if (rset->priv->cb) {
-                increase_ref(cx, rset);
-                rset->priv->cb(cx, rset, rset->priv->user_data);
-                decrease_ref(cx, rset);
-            }
             break;
         }
         case RESPROTO_RELEASE_RESOURCE_SET:
@@ -340,13 +333,6 @@ static void recvfrom_msg(mrp_transport_t *transp, mrp_msg_t *msg,
             /* TODO: make new aqcuires fail until seqno == 0 */
             rset->priv->seqno = 0;
 
-            /* call the resource set callback */
-
-            if (rset->priv->cb) {
-                increase_ref(cx, rset);
-                rset->priv->cb(cx, rset, rset->priv->user_data);
-                decrease_ref(cx, rset);
-            }
             break;
         }
         case RESPROTO_RESOURCES_EVENT:
index d742ce6..5e83463 100644 (file)
@@ -568,10 +568,6 @@ int mrp_res_release_resource_set(mrp_res_context_t *cx,
     if (!internal_set)
         goto error;
 
-    if (internal_set->state != MRP_RES_RESOURCE_ACQUIRED) {
-        return 0;
-    }
-
     return release_resource_set_request(cx, internal_set);
 
 error: