lxip: implement 'mod_delayed_work()'

Fixes #2258
This commit is contained in:
Christian Prochaska 2017-01-26 17:20:17 +01:00 committed by Norman Feske
parent bdb3bc0299
commit 8fcfcbce0e
2 changed files with 28 additions and 1 deletions

View File

@ -335,7 +335,6 @@ DUMMY(-1, linkwatch_run_queue)
DUMMY(-1, local_softirq_pending)
DUMMY(-1, lockdep_rtnl_is_held)
DUMMY(-1, min)
DUMMY_STOP(-1, mod_delayed_work)
DUMMY(-1, module_put)
DUMMY(-1, move_addr_to_kernel)
DUMMY(-1, mq_qdisc_ops)

View File

@ -690,3 +690,31 @@ size_t csum_and_copy_to_iter(void *addr, size_t bytes, __wsum *csum, struct iov_
******************/
void __wake_up(wait_queue_head_t *q, bool all) { }
/***********************
** linux/workqueue.h **
***********************/
static void execute_delayed_work(unsigned long dwork)
{
delayed_work *d = (delayed_work *)dwork;
d->work.func(&d->work);
}
bool mod_delayed_work(struct workqueue_struct *wq, struct delayed_work *dwork,
unsigned long delay)
{
/* treat delayed work without delay like any other work */
if (delay == 0) {
execute_delayed_work((unsigned long)dwork);
} else {
if (!dwork->timer.function) {
setup_timer(&dwork->timer, execute_delayed_work,
(unsigned long)dwork);
}
mod_timer(&dwork->timer, delay);
}
return true;
}