/* This function enqueues a work defined by @wrk to the tail of the pending works list.  */
static void schedule_ubi_work(struct ubi_device *ubi, struct ubi_work *wrk)
/* This function enqueues a work defined by @wrk to the tail of the pending works list.  */
static void schedule_ubi_work(struct ubi_device *ubi, struct ubi_work *wrk)
{
	spin_lock(&ubi->wl_lock);
	list_add_tail(&wrk->list, &ubi->works);
	ubi_assert(ubi->works_count >= 0);
	ubi->works_count += 1;
	if (ubi->thread_enabled)
		wake_up_process(ubi->bgt_thread);
	spin_unlock(&ubi->wl_lock);
}