summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-02-11 16:52:49 (GMT)
committerTejun Heo <tj@kernel.org>2014-02-11 16:52:49 (GMT)
commitb1664924062393bb048203bd4622e0b1c9e1d328 (patch)
tree4fbbb4a62793e72d9dbe44c71db0ea75f54cc21b /kernel
parent2da440a26ce4743bd3e71ba964ba3f983d09bba5 (diff)
downloadlinux-b1664924062393bb048203bd4622e0b1c9e1d328.tar.xz
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 'kernel')
-rw-r--r--kernel/cgroup.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 42e588e..11f7a05 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -792,7 +792,10 @@ static struct inode *cgroup_new_inode(umode_t mode, struct super_block *sb)
struct inode *inode = new_inode(sb);
if (inode) {
- inode->i_ino = get_next_ino();
+ do {
+ /* ino 0 is reserved for dummy_root */
+ inode->i_ino = get_next_ino();
+ } while (!inode->i_ino);
inode->i_mode = mode;
inode->i_uid = current_fsuid();
inode->i_gid = current_fsgid();