Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f29374b1 authored by Zefan Li's avatar Zefan Li Committed by Tejun Heo
Browse files

cgroup: remove redundant check in cgroup_ino()



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

Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 52de4779
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -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;
}

/* cft/css accessors for cftype->write() operation */
+1 −1
Original line number Diff line number Diff line
@@ -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;