summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2026-08-15 14:06:50 -1000
committerTejun Heo <tj@kernel.org>2026-08-15 14:06:50 -1000
commitc384ab8a0b13741982669790a36a152acb2ede82 (patch)
treee15c55fd97dee35648096616edbbd421ddea5f81 /kernel
parent3167bd3e0c22b1821df9987b9f4509e147cdad1f (diff)
sched_ext: Move the config-off sub-cap kfunc stubs into sub.c
The EOPNOTSUPP stubs for the sub-cap kfuncs live in ext.c under #ifndef CONFIG_EXT_SUB_SCHED while the real definitions live in sub.c. Move the stubs into sub.c so all sub kfunc definitions live in one file. Pure code move, no functional change. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/ext/ext.c29
-rw-r--r--kernel/sched/ext/sub.c33
2 files changed, 33 insertions, 29 deletions
diff --git a/kernel/sched/ext/ext.c b/kernel/sched/ext/ext.c
index cbbf3fa7462b..2ae1df58939d 100644
--- a/kernel/sched/ext/ext.c
+++ b/kernel/sched/ext/ext.c
@@ -10682,35 +10682,6 @@ out:
}
#endif /* CONFIG_CGROUP_SCHED */
-#ifndef CONFIG_EXT_SUB_SCHED
-__bpf_kfunc s32 scx_bpf_sub_grant(u64 cgroup_id, u64 caps,
- const struct scx_cmask *cmask__ign,
- struct scx_cmask *denied_out__ign,
- const struct bpf_prog_aux *aux)
-{
- return -EOPNOTSUPP;
-}
-
-__bpf_kfunc void scx_bpf_sub_revoke(u64 cgroup_id, u64 caps,
- const struct scx_cmask *cmask__ign,
- const struct bpf_prog_aux *aux)
-{
-}
-
-__bpf_kfunc s32 scx_bpf_sub_caps(u64 cgroup_id, u64 caps, struct scx_cmask *out__ign,
- const struct bpf_prog_aux *aux)
-{
- return -EOPNOTSUPP;
-}
-
-__bpf_kfunc s32 scx_bpf_sub_kill_bstr(u64 cgroup_id, char *fmt,
- unsigned long long *data, u32 data__sz,
- const struct bpf_prog_aux *aux)
-{
- return -EOPNOTSUPP;
-}
-#endif /* !CONFIG_EXT_SUB_SCHED */
-
__bpf_kfunc_end_defs();
BTF_KFUNCS_START(scx_kfunc_ids_any)
diff --git a/kernel/sched/ext/sub.c b/kernel/sched/ext/sub.c
index a7b38c90d095..92720a00b711 100644
--- a/kernel/sched/ext/sub.c
+++ b/kernel/sched/ext/sub.c
@@ -2648,4 +2648,37 @@ __bpf_kfunc s32 scx_bpf_sub_kill_bstr(u64 cgroup_id, char *fmt,
__bpf_kfunc_end_defs();
+#else /* !CONFIG_EXT_SUB_SCHED */
+
+__bpf_kfunc_start_defs();
+
+__bpf_kfunc s32 scx_bpf_sub_grant(u64 cgroup_id, u64 caps,
+ const struct scx_cmask *cmask__ign,
+ struct scx_cmask *denied_out__ign,
+ const struct bpf_prog_aux *aux)
+{
+ return -EOPNOTSUPP;
+}
+
+__bpf_kfunc void scx_bpf_sub_revoke(u64 cgroup_id, u64 caps,
+ const struct scx_cmask *cmask__ign,
+ const struct bpf_prog_aux *aux)
+{
+}
+
+__bpf_kfunc s32 scx_bpf_sub_caps(u64 cgroup_id, u64 caps, struct scx_cmask *out__ign,
+ const struct bpf_prog_aux *aux)
+{
+ return -EOPNOTSUPP;
+}
+
+__bpf_kfunc s32 scx_bpf_sub_kill_bstr(u64 cgroup_id, char *fmt,
+ unsigned long long *data, u32 data__sz,
+ const struct bpf_prog_aux *aux)
+{
+ return -EOPNOTSUPP;
+}
+
+__bpf_kfunc_end_defs();
+
#endif /* CONFIG_EXT_SUB_SCHED */