Skip to content

Commit

Permalink
cgroup: remove redundant check in cgroup_ino()
Browse files Browse the repository at this point in the history
After we implemented default unified hierarchy, cgrp->kn can never
be NULL.

Signed-off-by: Zefan Li <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
  • Loading branch information
lizf-os authored and htejun committed Sep 19, 2014
1 parent 52de477 commit f29374b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions include/linux/cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion mm/memory-failure.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f29374b

Please sign in to comment.