• Roman Gushchin's avatar
    bpf: introduce update_effective_progs() · 85fc4b16
    Roman Gushchin authored
    __cgroup_bpf_attach() and __cgroup_bpf_detach() functions have
    a good amount of duplicated code, which is possible to eliminate
    by introducing the update_effective_progs() helper function.
    
    The update_effective_progs() calls compute_effective_progs()
    and then in case of success it calls activate_effective_progs()
    for each descendant cgroup. In case of failure (OOM), it releases
    allocated prog arrays and return the error code.
    Signed-off-by: default avatarRoman Gushchin <guro@fb.com>
    Cc: Alexei Starovoitov <ast@kernel.org>
    Cc: Daniel Borkmann <daniel@iogearbox.net>
    Acked-by: default avatarSong Liu <songliubraving@fb.com>
    Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    85fc4b16
cgroup.c 18.6 KB