lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon,  7 Sep 2020 11:17:17 +0200
From:   Dietmar Eggemann <dietmar.eggemann@....com>
To:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...nel.org>
Cc:     linux-kernel@...r.kernel.org,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Qais Yousef <qais.yousef@....com>,
        Phil Auld <pauld@...hat.com>,
        Vincent Donnefort <vincent.donnefort@....com>
Subject: [PATCH 3/3] sched/autogroup: Change autogroup_path() into a static inline function

cfs_rq_tg_path() uses, besides cgroup_path(), autogroup_path() to
format the path of a taskgroup or autogroup respectively.

Provide autogroup_path() as a static inline function like cgroup_path()
so cfs_rq_tg_path() (from a tp-2-te converter) can use both in a kernel
module build.

Signed-off-by: Dietmar Eggemann <dietmar.eggemann@....com>
---
 kernel/sched/autogroup.c | 8 --------
 kernel/sched/autogroup.h | 8 +++++++-
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/kernel/sched/autogroup.c b/kernel/sched/autogroup.c
index 2067080bb235..3c6c78d909dd 100644
--- a/kernel/sched/autogroup.c
+++ b/kernel/sched/autogroup.c
@@ -258,11 +258,3 @@ void proc_sched_autogroup_show_task(struct task_struct *p, struct seq_file *m)
 	autogroup_kref_put(ag);
 }
 #endif /* CONFIG_PROC_FS */
-
-int autogroup_path(struct task_group *tg, char *buf, int buflen)
-{
-	if (!task_group_is_autogroup(tg))
-		return 0;
-
-	return snprintf(buf, buflen, "%s-%ld", "/autogroup", tg->autogroup->id);
-}
diff --git a/kernel/sched/autogroup.h b/kernel/sched/autogroup.h
index b96419974a1f..001f4826d781 100644
--- a/kernel/sched/autogroup.h
+++ b/kernel/sched/autogroup.h
@@ -35,7 +35,13 @@ autogroup_task_group(struct task_struct *p, struct task_group *tg)
 	return tg;
 }
 
-extern int autogroup_path(struct task_group *tg, char *buf, int buflen);
+static inline int autogroup_path(struct task_group *tg, char *buf, int buflen)
+{
+	if (!task_group_is_autogroup(tg))
+		return 0;
+
+	return snprintf(buf, buflen, "%s-%ld", "/autogroup", tg->autogroup->id);
+}
 
 #else /* !CONFIG_SCHED_AUTOGROUP */
 
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ