core/bpf-foreign: drop unnecessary check for cgroup v1
This commit is contained in:
@@ -4,10 +4,6 @@
|
||||
|
||||
#include "unit.h"
|
||||
|
||||
static inline int bpf_foreign_supported(void) {
|
||||
return cg_all_unified();
|
||||
}
|
||||
|
||||
/*
|
||||
* Attach cgroup-bpf programs foreign to systemd, i.e. loaded to the kernel by an entity
|
||||
* external to systemd.
|
||||
|
||||
+2
-6
@@ -3542,12 +3542,8 @@ static int cg_bpf_mask_supported(CGroupMask *ret) {
|
||||
if (r > 0)
|
||||
mask |= CGROUP_MASK_BPF_DEVICES;
|
||||
|
||||
/* BPF pinned prog */
|
||||
r = bpf_foreign_supported();
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r > 0)
|
||||
mask |= CGROUP_MASK_BPF_FOREIGN;
|
||||
/* BPF pinned prog (always supported by cgroup v2) */
|
||||
mask |= CGROUP_MASK_BPF_FOREIGN;
|
||||
|
||||
/* BPF-based bind{4|6} hooks */
|
||||
r = bpf_socket_bind_supported();
|
||||
|
||||
@@ -714,17 +714,6 @@ static int bus_cgroup_set_transient_property(
|
||||
return r;
|
||||
|
||||
unit_write_setting(u, flags, name, buf);
|
||||
|
||||
if (c->bpf_foreign_programs) {
|
||||
r = bpf_foreign_supported();
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r == 0)
|
||||
log_full(LOG_DEBUG,
|
||||
"Transient unit %s configures a BPF program pinned to BPF "
|
||||
"filesystem, but the local system does not support that.\n"
|
||||
"Starting this unit will fail!", u->id);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user