Linux Container Development
 help / color / mirror / Atom feed
* [PATCH 15/20] Make proc_flush_task() actually from entries from multiple namespaces
@ 2007-08-07  9:30 xemul-GEFAQzZX7r8dnm+yROfE0A
  0 siblings, 0 replies; only message in thread
From: xemul-GEFAQzZX7r8dnm+yROfE0A @ 2007-08-07  9:30 UTC (permalink / raw)
  To: sukadev-r/Jw6+rmf7HQT0dZR+AlfA, oleg-6lXkIZvqkOAvJsYlp49lxw
  Cc: containers-qjLDD68F18O7TbgM5vRIOg, xemul-GEFAQzZX7r8dnm+yROfE0A

This means that proc_flush_task_mnt() is to be called for many proc
mounts and with different ids, depending on the namespace this pid
is to be flushed from.

Signed-off-by: Pavel Emelyanov <xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>

---

 base.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

--- ./fs/proc/base.c.ve12	2007-08-06 14:58:51.000000000 +0400
+++ ./fs/proc/base.c	2007-08-06 14:58:51.000000000 +0400
@@ -2170,8 +2170,22 @@ out:
 
 void proc_flush_task(struct task_struct *task)
 {
-	proc_flush_task_mnt(proc_mnt, task->pid,
-			thread_group_leader(task) ? 0 : task->tgid);
+	int i, leader;
+	struct pid *pid, *tgid;
+	struct upid *upid;
+
+	leader = thread_group_leader(task);
+	proc_flush_task_mnt(proc_mnt, task->pid, leader ? task->tgid : 0);
+	pid = task_pid(task);
+	if (pid->level == 0)
+		return;
+
+	tgid = task_tgid(task);
+	for (i = 1; i <= pid->level; i++) {
+		upid = &pid->numbers[i];
+		proc_flush_task_mnt(upid->ns->proc_mnt, upid->nr,
+				leader ? 0 : tgid->numbers[i].nr);
+	}
 }
 
 static struct dentry *proc_pid_instantiate(struct inode *dir,

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-08-07  9:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-07  9:30 [PATCH 15/20] Make proc_flush_task() actually from entries from multiple namespaces xemul-GEFAQzZX7r8dnm+yROfE0A

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox