diff options
| -rw-r--r-- | net/sched/cls_route.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c index 9ddde65915d2..4b14ccd8b8f2 100644 --- a/net/sched/cls_route.c +++ b/net/sched/cls_route.c | |||
| @@ -57,7 +57,10 @@ struct route4_filter { | |||
| 57 | u32 handle; | 57 | u32 handle; |
| 58 | struct route4_bucket *bkt; | 58 | struct route4_bucket *bkt; |
| 59 | struct tcf_proto *tp; | 59 | struct tcf_proto *tp; |
| 60 | struct rcu_head rcu; | 60 | union { |
| 61 | struct work_struct work; | ||
| 62 | struct rcu_head rcu; | ||
| 63 | }; | ||
| 61 | }; | 64 | }; |
| 62 | 65 | ||
| 63 | #define ROUTE4_FAILURE ((struct route4_filter *)(-1L)) | 66 | #define ROUTE4_FAILURE ((struct route4_filter *)(-1L)) |
| @@ -254,12 +257,22 @@ static int route4_init(struct tcf_proto *tp) | |||
| 254 | return 0; | 257 | return 0; |
| 255 | } | 258 | } |
| 256 | 259 | ||
| 257 | static void route4_delete_filter(struct rcu_head *head) | 260 | static void route4_delete_filter_work(struct work_struct *work) |
| 258 | { | 261 | { |
| 259 | struct route4_filter *f = container_of(head, struct route4_filter, rcu); | 262 | struct route4_filter *f = container_of(work, struct route4_filter, work); |
| 260 | 263 | ||
| 264 | rtnl_lock(); | ||
| 261 | tcf_exts_destroy(&f->exts); | 265 | tcf_exts_destroy(&f->exts); |
| 262 | kfree(f); | 266 | kfree(f); |
| 267 | rtnl_unlock(); | ||
| 268 | } | ||
| 269 | |||
| 270 | static void route4_delete_filter(struct rcu_head *head) | ||
| 271 | { | ||
| 272 | struct route4_filter *f = container_of(head, struct route4_filter, rcu); | ||
| 273 | |||
| 274 | INIT_WORK(&f->work, route4_delete_filter_work); | ||
| 275 | tcf_queue_work(&f->work); | ||
| 263 | } | 276 | } |
| 264 | 277 | ||
| 265 | static void route4_destroy(struct tcf_proto *tp) | 278 | static void route4_destroy(struct tcf_proto *tp) |
