linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cgroup: remove redundant check in cgroup_ino()
@ 2014-09-19  8:29 Zefan Li
  2014-09-19 13:17 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Zefan Li @ 2014-09-19  8:29 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Cgroups, LKML, Naoya Horiguchi

After we implemented default unified hierarchy, cgrp->kn can never
be NULL.

Signed-off-by: Zefan Li <lizefan@huawei.com>
---
 include/linux/cgroup.h | 7 ++-----
 mm/memory-failure.c    | 2 +-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 77a1d37..818a81f 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -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 */
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 44c6bd2..8639f6b 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -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;
-- 
1.8.0.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cgroup: remove redundant check in cgroup_ino()
  2014-09-19  8:29 [PATCH] cgroup: remove redundant check in cgroup_ino() Zefan Li
@ 2014-09-19 13:17 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2014-09-19 13:17 UTC (permalink / raw)
  To: Zefan Li; +Cc: Cgroups, LKML, Naoya Horiguchi

On Fri, Sep 19, 2014 at 04:29:31PM +0800, Zefan Li wrote:
> After we implemented default unified hierarchy, cgrp->kn can never
> be NULL.
> 
> Signed-off-by: Zefan Li <lizefan@huawei.com>

Applied to cgroup/for-3.18.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-19 13:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-19  8:29 [PATCH] cgroup: remove redundant check in cgroup_ino() Zefan Li
2014-09-19 13:17 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).