Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 51e4e7fa authored by Daniel Wagner's avatar Daniel Wagner Committed by Tejun Heo
Browse files

cgroup: net_prio: Do not define task_netpioidx() when not selected



task_netprioidx() should not be defined in case the configuration is
CONFIG_NETPRIO_CGROUP=n. The reason is that in a following patch the
net_prio_subsys_id will only be defined if CONFIG_NETPRIO_CGROUP!=n.
When net_prio is not built at all any callee should only get an empty
task_netprioidx() without any references to net_prio_subsys_id.

Signed-off-by: default avatarDaniel Wagner <daniel.wagner@bmw-carit.de>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarLi Zefan <lizefan@huawei.com>
Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
Cc: Gao feng <gaofeng@cn.fujitsu.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: John Fastabend <john.r.fastabend@intel.com>
Cc: netdev@vger.kernel.org
Cc: cgroups@vger.kernel.org
parent 8fb974c9
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -18,14 +18,13 @@
#include <linux/rcupdate.h>


#if IS_ENABLED(CONFIG_NETPRIO_CGROUP)
struct netprio_map {
	struct rcu_head rcu;
	u32 priomap_len;
	u32 priomap[];
};

#ifdef CONFIG_CGROUPS

struct cgroup_netprio_state {
	struct cgroup_subsys_state css;
	u32 prioidx;
@@ -71,18 +70,17 @@ static inline u32 task_netprioidx(struct task_struct *p)
	rcu_read_unlock();
	return idx;
}
#endif

#else
#else /* !CONFIG_NETPRIO_CGROUP */

static inline u32 task_netprioidx(struct task_struct *p)
{
	return 0;
}

#endif /* CONFIG_NETPRIO_CGROUP */

#else
#define sock_update_netprioidx(sk, task)
#endif

#endif /* CONFIG_NETPRIO_CGROUP */

#endif  /* _NET_CLS_CGROUP_H */
+2 −0
Original line number Diff line number Diff line
@@ -1237,6 +1237,7 @@ void sock_update_classid(struct sock *sk)
EXPORT_SYMBOL(sock_update_classid);
#endif

#if IS_ENABLED(CONFIG_NETPRIO_CGROUP)
void sock_update_netprioidx(struct sock *sk, struct task_struct *task)
{
	if (in_interrupt())
@@ -1246,6 +1247,7 @@ void sock_update_netprioidx(struct sock *sk, struct task_struct *task)
}
EXPORT_SYMBOL_GPL(sock_update_netprioidx);
#endif
#endif

/**
 *	sk_alloc - All socket objects are allocated here