Skip to contentSkip to conversation

cpuset: use cgroup_path() in proc_cpuset_show()

PATCH In review Lai Jiangshan 3 participants 3 messages Nov 21, 2008 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 cpuset: use cgroup_path() in proc_cpuset_show()

use cgroup_path() instead of
task_subsys_state(tsk, cpuset_subsys_id)->cgroup

---

kernel/cpuset.c +3 -3
index 3e00526..e0e087e 100644
@@ -2387,7 +2386,7 @@ static int proc_cpuset_show(struct seq_file *m, void *unused_v)
 	struct pid *pid;
 	struct task_struct *tsk;
 	char *buf;
-	struct cgroup_subsys_state *css;
+	struct cgroup *cgp;
 	int retval;
 
 	retval = -ENOMEM;
@@ -2403,8 +2402,8 @@ static int proc_cpuset_show(struct seq_file *m, void *unused_v)
 
 	retval = -EINVAL;
 	cgroup_lock();
-	css = task_subsys_state(tsk, cpuset_subsys_id);
-	retval = cgroup_path(css->cgroup, buf, PAGE_SIZE);
+	cgp = task_cgroup(tsk, cpuset_subsys_id);
+	retval = cgroup_path(cgp, buf, PAGE_SIZE);
 	if (retval < 0)
 		goto out_unlock;
 	seq_puts(m, buf);

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 3 lines · Lai Jiangshan

use cgroup_path() instead of
task_subsys_state(tsk, cpuset_subsys_id)->cgroup

You mean:

use task_cgroup() instead of task_subsys_state()->cgroup

Quoted 30 lines

---

kernel/cpuset.c +3 -3
index 3e00526..e0e087e 100644
@@ -2387,7 +2386,7 @@ static int proc_cpuset_show(struct seq_file *m, void *unused_v)
       struct pid *pid;
       struct task_struct *tsk;
       char *buf;
-       struct cgroup_subsys_state *css;
+       struct cgroup *cgp;
       int retval;
 
       retval = -ENOMEM;
@@ -2403,8 +2402,8 @@ static int proc_cpuset_show(struct seq_file *m, void *unused_v)
 
       retval = -EINVAL;
       cgroup_lock();
-       css = task_subsys_state(tsk, cpuset_subsys_id);
-       retval = cgroup_path(css->cgroup, buf, PAGE_SIZE);
+       cgp = task_cgroup(tsk, cpuset_subsys_id);
+       retval = cgroup_path(cgp, buf, PAGE_SIZE);
       if (retval < 0)
               goto out_unlock;
       seq_puts(m, buf);
#3 lore raw
In reply to Lai Jiangshan
Quoted 3 lines · Lai Jiangshan

use cgroup_path() instead of
task_subsys_state(tsk, cpuset_subsys_id)->cgroup

You mean:

use task_cgroup() instead of task_subsys_state()->cgroup

Quoted 30 lines

---

kernel/cpuset.c +3 -3
index 3e00526..e0e087e 100644
@@ -2387,7 +2386,7 @@ static int proc_cpuset_show(struct seq_file *m, void *unused_v)
       struct pid *pid;
       struct task_struct *tsk;
       char *buf;
-       struct cgroup_subsys_state *css;
+       struct cgroup *cgp;
       int retval;
 
       retval = -ENOMEM;
@@ -2403,8 +2402,8 @@ static int proc_cpuset_show(struct seq_file *m, void *unused_v)
 
       retval = -EINVAL;
       cgroup_lock();
-       css = task_subsys_state(tsk, cpuset_subsys_id);
-       retval = cgroup_path(css->cgroup, buf, PAGE_SIZE);
+       cgp = task_cgroup(tsk, cpuset_subsys_id);
+       retval = cgroup_path(cgp, buf, PAGE_SIZE);
       if (retval < 0)
               goto out_unlock;
       seq_puts(m, buf);