/* Each active partition has a channel manager, who, besides connecting and disconnecting channels, will ensure that each of the partition's connected channels has the required number of assigned kthreads to get the work done.  */
static void xpc_channel_mgr(struct xpc_partition *part)
/* Each active partition has a channel manager, who, besides connecting and disconnecting channels, will ensure that each of the partition's connected channels has the required number of assigned kthreads to get the work done.  */
static void xpc_channel_mgr(struct xpc_partition *part)
{
	while (part->act_state != XPC_P_AS_DEACTIVATING ||
	       atomic_read(&part->nchannels_active) > 0 ||
	       !xpc_partition_disengaged(part)) {
		xpc_process_sent_chctl_flags(part);
		atomic_dec(&part->channel_mgr_requests);
		(void)wait_event_interruptible(part->channel_mgr_wq,
				(atomic_read(&part->channel_mgr_requests) > 0 ||
				 part->chctl.all_flags != 0 ||
				 (part->act_state == XPC_P_AS_DEACTIVATING &&
				 atomic_read(&part->nchannels_active) == 0 &&
				 xpc_partition_disengaged(part))));
		atomic_set(&part->channel_mgr_requests, 1);
	}
}