Skip to content

Commit 5a7b5f3

Browse files
liulangrenaaahtejun
authored andcommitted
cgroup/cgroup.c: replace 'of->kn->priv' with of_cft()
we have supplied the inline function: of_cft() in cgroup.h. So replace the direct use 'of->kn->priv' with inline func of_cft(), which is more readable. Signed-off-by: Hui Su <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 58315c9 commit 5a7b5f3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

kernel/cgroup/cgroup.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3657,7 +3657,7 @@ static ssize_t cgroup_freeze_write(struct kernfs_open_file *of,
36573657

36583658
static int cgroup_file_open(struct kernfs_open_file *of)
36593659
{
3660-
struct cftype *cft = of->kn->priv;
3660+
struct cftype *cft = of_cft(of);
36613661

36623662
if (cft->open)
36633663
return cft->open(of);
@@ -3666,7 +3666,7 @@ static int cgroup_file_open(struct kernfs_open_file *of)
36663666

36673667
static void cgroup_file_release(struct kernfs_open_file *of)
36683668
{
3669-
struct cftype *cft = of->kn->priv;
3669+
struct cftype *cft = of_cft(of);
36703670

36713671
if (cft->release)
36723672
cft->release(of);
@@ -3677,7 +3677,7 @@ static ssize_t cgroup_file_write(struct kernfs_open_file *of, char *buf,
36773677
{
36783678
struct cgroup_namespace *ns = current->nsproxy->cgroup_ns;
36793679
struct cgroup *cgrp = of->kn->parent->priv;
3680-
struct cftype *cft = of->kn->priv;
3680+
struct cftype *cft = of_cft(of);
36813681
struct cgroup_subsys_state *css;
36823682
int ret;
36833683

@@ -3727,7 +3727,7 @@ static ssize_t cgroup_file_write(struct kernfs_open_file *of, char *buf,
37273727

37283728
static __poll_t cgroup_file_poll(struct kernfs_open_file *of, poll_table *pt)
37293729
{
3730-
struct cftype *cft = of->kn->priv;
3730+
struct cftype *cft = of_cft(of);
37313731

37323732
if (cft->poll)
37333733
return cft->poll(of, pt);

0 commit comments

Comments
 (0)