From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Wagner Subject: [PATCH v2 10/10] cgroup: net_prio: Merge builtin and module version of task_netprioidx() Date: Fri, 24 Aug 2012 16:01:44 +0200 Message-ID: <1345816904-21745-11-git-send-email-wagi@monom.org> References: <1345816904-21745-1-git-send-email-wagi@monom.org> Cc: Daniel Wagner , "David S. Miller" , Gao feng , Jamal Hadi Salim , John Fastabend , Li Zefan , Neil Horman , Tejun Heo To: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Return-path: In-Reply-To: <1345816904-21745-1-git-send-email-wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org From: Daniel Wagner Signed-off-by: Daniel Wagner Cc: "David S. Miller" Cc: Gao feng Cc: Jamal Hadi Salim Cc: John Fastabend Cc: Li Zefan Cc: Neil Horman Cc: Tejun Heo 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