diff options
author | Jean Delvare <khali@linux-fr.org> | 2009-04-02 19:56:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-02 22:04:50 -0400 |
commit | bf6aede712334d7338d5c47a5ee5ba3883c82a61 (patch) | |
tree | 153483c5ef1de41f8dd3d233ba46117d0676c303 /mm/slab.c | |
parent | e4c2ff1cf2d7fc65d0fc6f88bc98338e0212ad52 (diff) |
workqueue: add to_delayed_work() helper function
It is a fairly common operation to have a pointer to a work and to need a
pointer to the delayed work it is contained in. In particular, all
delayed works which want to rearm themselves will have to do that. So it
would seem fair to offer a helper function for this operation.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Greg KH <greg@kroah.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slab.c')
-rw-r--r-- | mm/slab.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -3992,8 +3992,7 @@ static void cache_reap(struct work_struct *w) | |||
3992 | struct kmem_cache *searchp; | 3992 | struct kmem_cache *searchp; |
3993 | struct kmem_list3 *l3; | 3993 | struct kmem_list3 *l3; |
3994 | int node = numa_node_id(); | 3994 | int node = numa_node_id(); |
3995 | struct delayed_work *work = | 3995 | struct delayed_work *work = to_delayed_work(w); |
3996 | container_of(w, struct delayed_work, work); | ||
3997 | 3996 | ||
3998 | if (!mutex_trylock(&cache_chain_mutex)) | 3997 | if (!mutex_trylock(&cache_chain_mutex)) |
3999 | /* Give up. Setup the next iteration. */ | 3998 | /* Give up. Setup the next iteration. */ |