summaryrefslogtreecommitdiffstats
path: root/kernel/events/ring_buffer.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-02-11 11:52:47 -0500
committerTejun Heo <tj@kernel.org>2014-02-11 11:52:47 -0500
commit5a17f543ed6808e9085063277fe46795dea484bd (patch)
tree8b6e2afd5619bcff76438470670247eb55bef908 /kernel/events/ring_buffer.c
parent398f878789fceb51bf5e424b753a3756643513c4 (diff)
downloadblackbird-op-linux-5a17f543ed6808e9085063277fe46795dea484bd.tar.gz
blackbird-op-linux-5a17f543ed6808e9085063277fe46795dea484bd.zip
cgroup: improve css_from_dir() into css_tryget_from_dir()
css_from_dir() returns the matching css (cgroup_subsys_state) given a dentry and subsystem. The function doesn't pin the css before returning and requires the caller to be holding RCU read lock or cgroup_mutex and handling pinning on the caller side. Given that users of the function are likely to want to pin the returned css (both existing users do) and that getting and putting css's are very cheap, there's no reason for the interface to be tricky like this. Rename css_from_dir() to css_tryget_from_dir() and make it try to pin the found css and return it only if pinning succeeded. The callers are updated so that they no longer do RCU locking and pinning around the function and just use the returned css. This will also ease converting cgroup to kernfs. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Michal Hocko <mhocko@suse.cz> Acked-by: Li Zefan <lizefan@huawei.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Balbir Singh <bsingharora@gmail.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Diffstat (limited to 'kernel/events/ring_buffer.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud