aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/netprio_cgroup.h
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2012-09-12 10:12:03 -0400
committerTejun Heo <tj@kernel.org>2012-09-14 12:57:28 -0400
commit51e4e7faba786d33e5e33f8776c5027a1c8d6fb7 (patch)
tree47d935eca61b5cfe12012117e7460f2814c0d10d /include/net/netprio_cgroup.h
parent8fb974c937570be38f944986456467b39a2dc252 (diff)
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: Daniel Wagner <daniel.wagner@bmw-carit.de> Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com> Acked-by: Neil 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
Diffstat (limited to 'include/net/netprio_cgroup.h')
-rw-r--r--include/net/netprio_cgroup.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/include/net/netprio_cgroup.h b/include/net/netprio_cgroup.h
index 2719dec6b5a8..b202de882489 100644
--- a/include/net/netprio_cgroup.h
+++ b/include/net/netprio_cgroup.h
@@ -18,14 +18,13 @@
18#include <linux/rcupdate.h> 18#include <linux/rcupdate.h>
19 19
20 20
21#if IS_ENABLED(CONFIG_NETPRIO_CGROUP)
21struct netprio_map { 22struct netprio_map {
22 struct rcu_head rcu; 23 struct rcu_head rcu;
23 u32 priomap_len; 24 u32 priomap_len;
24 u32 priomap[]; 25 u32 priomap[];
25}; 26};
26 27
27#ifdef CONFIG_CGROUPS
28
29struct cgroup_netprio_state { 28struct cgroup_netprio_state {
30 struct cgroup_subsys_state css; 29 struct cgroup_subsys_state css;
31 u32 prioidx; 30 u32 prioidx;
@@ -71,18 +70,17 @@ static inline u32 task_netprioidx(struct task_struct *p)
71 rcu_read_unlock(); 70 rcu_read_unlock();
72 return idx; 71 return idx;
73} 72}
73#endif
74 74
75#else 75#else /* !CONFIG_NETPRIO_CGROUP */
76 76
77static inline u32 task_netprioidx(struct task_struct *p) 77static inline u32 task_netprioidx(struct task_struct *p)
78{ 78{
79 return 0; 79 return 0;
80} 80}
81 81
82#endif /* CONFIG_NETPRIO_CGROUP */
83
84#else
85#define sock_update_netprioidx(sk, task) 82#define sock_update_netprioidx(sk, task)
86#endif 83
84#endif /* CONFIG_NETPRIO_CGROUP */
87 85
88#endif /* _NET_CLS_CGROUP_H */ 86#endif /* _NET_CLS_CGROUP_H */