diff options
| author | Ingo Molnar <mingo@kernel.org> | 2015-08-25 10:59:19 +0300 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2015-08-25 10:59:19 +0300 |
| commit | 8d58b66ed2b000f27658c88a4ed70e8042e86a58 (patch) | |
| tree | 5bae2c74f932b5d863f72cb698a6f71260340b26 /lib/timerqueue.c | |
| parent | 13fe86f465b72fc9328d4f5ebc33223c011852ae (diff) | |
| parent | c13dcf9f2d6f5f06ef1bf79ec456df614c5e058b (diff) | |
| download | linux-8d58b66ed2b000f27658c88a4ed70e8042e86a58.tar.xz | |
Merge tag 'v4.2-rc8' into x86/mm, before applying new changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'lib/timerqueue.c')
| -rw-r--r-- | lib/timerqueue.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/timerqueue.c b/lib/timerqueue.c index a382e4a32609..782ae8ca2c06 100644 --- a/lib/timerqueue.c +++ b/lib/timerqueue.c @@ -36,7 +36,7 @@ * Adds the timer node to the timerqueue, sorted by the * node's expires value. */ -void timerqueue_add(struct timerqueue_head *head, struct timerqueue_node *node) +bool timerqueue_add(struct timerqueue_head *head, struct timerqueue_node *node) { struct rb_node **p = &head->head.rb_node; struct rb_node *parent = NULL; @@ -56,8 +56,11 @@ void timerqueue_add(struct timerqueue_head *head, struct timerqueue_node *node) rb_link_node(&node->node, parent, p); rb_insert_color(&node->node, &head->head); - if (!head->next || node->expires.tv64 < head->next->expires.tv64) + if (!head->next || node->expires.tv64 < head->next->expires.tv64) { head->next = node; + return true; + } + return false; } EXPORT_SYMBOL_GPL(timerqueue_add); @@ -69,7 +72,7 @@ EXPORT_SYMBOL_GPL(timerqueue_add); * * Removes the timer node from the timerqueue. */ -void timerqueue_del(struct timerqueue_head *head, struct timerqueue_node *node) +bool timerqueue_del(struct timerqueue_head *head, struct timerqueue_node *node) { WARN_ON_ONCE(RB_EMPTY_NODE(&node->node)); @@ -82,6 +85,7 @@ void timerqueue_del(struct timerqueue_head *head, struct timerqueue_node *node) } rb_erase(&node->node, &head->head); RB_CLEAR_NODE(&node->node); + return head->next != NULL; } EXPORT_SYMBOL_GPL(timerqueue_del); |
