diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2013-07-16 04:24:48 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2013-07-18 06:44:34 -0400 |
commit | 1eeb74782d354175ef9f3bff02fae62c6e0aef24 (patch) | |
tree | d65adca381b40b040659f510c8951049e6b5315a /arch | |
parent | dae7fd42961e9ae9386f527b6d0e14f6e3da2317 (diff) |
s390/bpf,jit: call module_free() from any context
The workqueue workaround is no longer needed. Same as 5199dfe531
"sparc: bpf_jit_comp: can call module_free() from any context".
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/net/bpf_jit_comp.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c index 82f165f8078c..a41f0b15faa1 100644 --- a/arch/s390/net/bpf_jit_comp.c +++ b/arch/s390/net/bpf_jit_comp.c | |||
@@ -772,8 +772,7 @@ void bpf_jit_compile(struct sk_filter *fp) | |||
772 | } else if (jit.prg == cjit.prg && jit.lit == cjit.lit) { | 772 | } else if (jit.prg == cjit.prg && jit.lit == cjit.lit) { |
773 | prg_len = jit.prg - jit.start; | 773 | prg_len = jit.prg - jit.start; |
774 | lit_len = jit.lit - jit.mid; | 774 | lit_len = jit.lit - jit.mid; |
775 | size = max_t(unsigned long, prg_len + lit_len, | 775 | size = prg_len + lit_len; |
776 | sizeof(struct work_struct)); | ||
777 | if (size >= BPF_SIZE_MAX) | 776 | if (size >= BPF_SIZE_MAX) |
778 | goto out; | 777 | goto out; |
779 | jit.start = module_alloc(size); | 778 | jit.start = module_alloc(size); |
@@ -804,21 +803,8 @@ out: | |||
804 | kfree(addrs); | 803 | kfree(addrs); |
805 | } | 804 | } |
806 | 805 | ||
807 | static void jit_free_defer(struct work_struct *arg) | ||
808 | { | ||
809 | module_free(NULL, arg); | ||
810 | } | ||
811 | |||
812 | /* run from softirq, we must use a work_struct to call | ||
813 | * module_free() from process context | ||
814 | */ | ||
815 | void bpf_jit_free(struct sk_filter *fp) | 806 | void bpf_jit_free(struct sk_filter *fp) |
816 | { | 807 | { |
817 | struct work_struct *work; | 808 | if (fp->bpf_func != sk_run_filter) |
818 | 809 | module_free(NULL, fp->bpf_func); | |
819 | if (fp->bpf_func == sk_run_filter) | ||
820 | return; | ||
821 | work = (struct work_struct *)fp->bpf_func; | ||
822 | INIT_WORK(work, jit_free_defer); | ||
823 | schedule_work(work); | ||
824 | } | 810 | } |