- msg = running_with_devpath(loop_msg);
- if (!msg) {
- /* move event to run list */
- list_move_tail(&loop_msg->node, &running_list);
- execute_udev(loop_msg);
- running++;
- dbg("moved seq %llu to running list", loop_msg->seqnum);
- } else {
- dbg("delay seq %llu (%s), cause seq %llu (%s) is still running",
- loop_msg->seqnum, loop_msg->devpath, msg->seqnum, msg->devpath);
- }
- }
-}
-
-static void msg_move_exec(struct hotplug_msg *msg)
-{
- list_move_tail(&msg->node, &exec_list);
- run_exec_q = 1;
- expected_seqnum = msg->seqnum+1;
- dbg("moved seq %llu to exec, next expected is %llu",
- msg->seqnum, expected_seqnum);
-}
-
-/* msg queue management routine handles the timeouts and dispatches the events */
-static void msg_queue_manager(void)
-{
- struct hotplug_msg *loop_msg;
- struct hotplug_msg *tmp_msg;
- struct sysinfo info;
- long msg_age = 0;
- static int timeout = EVENT_INIT_TIMEOUT_SEC;
- static int init = 1;
-
- dbg("msg queue manager, next expected is %llu", expected_seqnum);
-recheck:
- list_for_each_entry_safe(loop_msg, tmp_msg, &msg_list, node) {
- /* move event with expected sequence to the exec list */
- if (loop_msg->seqnum == expected_seqnum) {
- msg_move_exec(loop_msg);
+ /* don't run two processes for the same devpath and wait for the parent*/
+ if (running_with_devpath(loop_msg, max_childs)) {
+ dbg("delay seq %llu (%s)", loop_msg->seqnum, loop_msg->devpath);