Thread (1 message) 1 message, 1 author, 2012-08-24
DORMANTno replies

[PATCH v2 10/10] cgroup: net_prio: Merge builtin and module version of task_netprioidx()

From: Daniel Wagner <hidden>
Date: 2012-08-24 14:01:44
Also in: netdev
Subsystem: networking [general], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

From: Daniel Wagner <redacted>

Signed-off-by: Daniel Wagner <redacted>
Cc: "David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Cc: Gao feng <redacted>
Cc: Jamal Hadi Salim <jhs-jkUAjuhPggJWk0Htik3J/w@public.gmane.org>
Cc: John Fastabend <redacted>
Cc: Li Zefan <redacted>
Cc: Neil Horman <redacted>
Cc: Tejun Heo <redacted>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
---
 include/net/netprio_cgroup.h | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/include/net/netprio_cgroup.h b/include/net/netprio_cgroup.h
index ab22019..180ff5e 100644
--- a/include/net/netprio_cgroup.h
+++ b/include/net/netprio_cgroup.h
@@ -35,24 +35,15 @@ extern void sock_update_netprioidx(struct sock *sk, struct task_struct *task);
 
 #if IS_BUILTIN(CONFIG_NETPRIO_CGROUP)
 
-static inline u32 task_netprioidx(struct task_struct *p)
-{
-	struct cgroup_netprio_state *state;
-	u32 idx;
-
-	rcu_read_lock();
-	state = container_of(task_subsys_state(p, net_prio_subsys_id),
-			     struct cgroup_netprio_state, css);
-	idx = state->prioidx;
-	rcu_read_unlock();
-	return idx;
-}
+#define netpriocg_enabled 1
 
 #elif IS_MODULE(CONFIG_NETPRIO_CGROUP)
 
 extern struct static_key cgroup_netprio_enabled;
 #define netpriocg_enabled static_key_false(&cgroup_netprio_enabled)
 
+#endif
+
 static inline u32 task_netprioidx(struct task_struct *p)
 {
 	struct cgroup_netprio_state *state;
@@ -69,8 +60,6 @@ static inline u32 task_netprioidx(struct task_struct *p)
 	return idx;
 }
 
-#endif
-
 #else  /* !CONFIG_NETPRIO_CGROUP */
 
 static inline u32 task_netprioidx(struct task_struct *p)
-- 
1.7.12.rc1.16.g05a20c8
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help