Thread (7 messages) 7 messages, 3 authors, 2012-08-27
STALE5034d
Revisions (2)
  1. v2 current
  2. v3 [diff vs current]

[PATCH v2 08/10] cgroup: net_cls: Merge builtin and module version of task_cls_classid()

From: Daniel Wagner <hidden>
Date: 2012-08-24 14:01:53
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@davemloft.net>
Cc: Gao feng <redacted>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: John Fastabend <redacted>
Cc: Li Zefan <redacted>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: netdev@vger.kernel.org
Cc: cgroups@vger.kernel.org
---
 include/net/cls_cgroup.h | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)
diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h
index 5906a25..d96dc59 100644
--- a/include/net/cls_cgroup.h
+++ b/include/net/cls_cgroup.h
@@ -29,26 +29,15 @@ extern void sock_update_classid(struct sock *sk);
 
 #if IS_BUILTIN(CONFIG_NET_CLS_CGROUP)
 
-static inline u32 task_cls_classid(struct task_struct *p)
-{
-	int classid;
-
-	if (in_interrupt())
-		return 0;
-
-	rcu_read_lock();
-	classid = container_of(task_subsys_state(p, net_cls_subsys_id),
-			       struct cgroup_cls_state, css)->classid;
-	rcu_read_unlock();
-
-	return classid;
-}
+#define clscg_enabled 1
 
 #elif IS_MODULE(CONFIG_NET_CLS_CGROUP)
 
 extern struct static_key cgroup_cls_enabled;
 #define clscg_enabled static_key_false(&cgroup_cls_enabled)
 
+#endif
+
 static inline u32 task_cls_classid(struct task_struct *p)
 {
 	u32 classid;
@@ -64,8 +53,6 @@ static inline u32 task_cls_classid(struct task_struct *p)
 	return classid;
 }
 
-#endif
-
 #else /* !CONFIG_NET_CLS_CGROUP */
 
 static inline u32 task_cls_classid(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