diff options
author | Tejun Heo <tj@kernel.org> | 2014-02-11 11:52:49 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-02-11 11:52:49 -0500 |
commit | b1664924062393bb048203bd4622e0b1c9e1d328 (patch) | |
tree | 4fbbb4a62793e72d9dbe44c71db0ea75f54cc21b /mm/memory-failure.c | |
parent | 2da440a26ce4743bd3e71ba964ba3f983d09bba5 (diff) |
cgroup: introduce cgroup_ino()
mm/memory-failure.c::hwpoison_filter_task() has been reaching into
cgroup to extract the associated ino to be used as a filtering
criterion. This is an implementation detail which shouldn't be
depended upon from outside cgroup proper and is about to change with
the scheduled kernfs conversion.
This patch introduces a proper interface to determine the associated
ino, cgroup_ino(), and updates hwpoison_filter_task() to use it
instead of reaching directly into cgroup.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Diffstat (limited to 'mm/memory-failure.c')
-rw-r--r-- | mm/memory-failure.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 4f08a2d61487..9b5933c66c16 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c | |||
@@ -145,14 +145,10 @@ static int hwpoison_filter_task(struct page *p) | |||
145 | return -EINVAL; | 145 | return -EINVAL; |
146 | 146 | ||
147 | css = mem_cgroup_css(mem); | 147 | css = mem_cgroup_css(mem); |
148 | /* root_mem_cgroup has NULL dentries */ | 148 | ino = cgroup_ino(css->cgroup); |
149 | if (!css->cgroup->dentry) | ||
150 | return -EINVAL; | ||
151 | |||
152 | ino = css->cgroup->dentry->d_inode->i_ino; | ||
153 | css_put(css); | 149 | css_put(css); |
154 | 150 | ||
155 | if (ino != hwpoison_filter_memcg) | 151 | if (!ino || ino != hwpoison_filter_memcg) |
156 | return -EINVAL; | 152 | return -EINVAL; |
157 | 153 | ||
158 | return 0; | 154 | return 0; |