cgroup: remove redundant check in cgroup_ino()
authorZefan Li <lizefan@huawei.com>
Fri, 19 Sep 2014 08:29:31 +0000 (16:29 +0800)
committerTejun Heo <tj@kernel.org>
Fri, 19 Sep 2014 13:16:23 +0000 (09:16 -0400)
After we implemented default unified hierarchy, cgrp->kn can never
be NULL.

Signed-off-by: Zefan Li <lizefan@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
include/linux/cgroup.h
mm/memory-failure.c

index 77a1d37b742b35c6c6f0bee8a21553f867106cd3..818a81fe7ccc3b3cdc91c5c931204af96360fb68 100644 (file)
@@ -532,13 +532,10 @@ static inline bool cgroup_has_tasks(struct cgroup *cgrp)
        return !list_empty(&cgrp->cset_links);
 }
 
-/* returns ino associated with a cgroup, 0 indicates unmounted root */
+/* returns ino associated with a cgroup */
 static inline ino_t cgroup_ino(struct cgroup *cgrp)
 {
-       if (cgrp->kn)
-               return cgrp->kn->ino;
-       else
-               return 0;
+       return cgrp->kn->ino;
 }
 
 /* cft/css accessors for cftype->write() operation */
index 44c6bd201d3a1cac7120527b45e2a86f5f77abff..8639f6b28746b313bcd12bca3693a11079e18143 100644 (file)
@@ -148,7 +148,7 @@ static int hwpoison_filter_task(struct page *p)
        ino = cgroup_ino(css->cgroup);
        css_put(css);
 
-       if (!ino || ino != hwpoison_filter_memcg)
+       if (ino != hwpoison_filter_memcg)
                return -EINVAL;
 
        return 0;