diff options
| author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2020-08-03 15:37:31 +0300 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2020-08-03 15:37:31 +0300 |
| commit | b1aa3db2c13ec0c63a73bd8fc5dfbfb112e3ff56 (patch) | |
| tree | 92ce9158daae144032cc6297ab8fdbad12664247 /include/linux/skmsg.h | |
| parent | 7c43b0c1d499c790cdb5623d27fdcef544ddb566 (diff) | |
| parent | bcf876870b95592b52519ed4aafcf9d95999bc9c (diff) | |
| download | linux-b1aa3db2c13ec0c63a73bd8fc5dfbfb112e3ff56.tar.xz | |
Merge remote-tracking branch 'torvalds/master' into perf/core
Minor conflict in tools/perf/arch/arm/util/auxtrace.c as one fix there
was cherry-picked for the last perf/urgent pull req to Linus, so was
already there.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'include/linux/skmsg.h')
| -rw-r--r-- | include/linux/skmsg.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h index 08674cd14d5a..1e9ed840b9fc 100644 --- a/include/linux/skmsg.h +++ b/include/linux/skmsg.h @@ -430,6 +430,19 @@ static inline void psock_set_prog(struct bpf_prog **pprog, bpf_prog_put(prog); } +static inline int psock_replace_prog(struct bpf_prog **pprog, + struct bpf_prog *prog, + struct bpf_prog *old) +{ + if (cmpxchg(pprog, old, prog) != old) + return -ENOENT; + + if (old) + bpf_prog_put(old); + + return 0; +} + static inline void psock_progs_drop(struct sk_psock_progs *progs) { psock_set_prog(&progs->msg_parser, NULL); |
