From df5f8314ca30d6a76735748e5ba4ca9809c0f434 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Fri, 8 Feb 2008 04:18:33 -0800 Subject: proc: seqfile convert proc_pid_status to properly handle pid namespaces Currently we possibly lookup the pid in the wrong pid namespace. So seq_file convert proc_pid_status which ensures the proper pid namespaces is passed in. [akpm@linux-foundation.org: coding-style fixes] [akpm@linux-foundation.org: build fix] [akpm@linux-foundation.org: another build fix] [akpm@linux-foundation.org: s390 build fix] [akpm@linux-foundation.org: fix task_name() output] [akpm@linux-foundation.org: fix nommu build] Signed-off-by: Eric W. Biederman Cc: Andrew Morgan Cc: Serge Hallyn Cc: Cedric Le Goater Cc: Pavel Emelyanov Cc: Martin Schwidefsky Cc: Heiko Carstens Cc: Paul Menage Cc: Paul Jackson Cc: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/cpuset.h | 9 +++++---- include/linux/proc_fs.h | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'include/linux') diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index ecae585ec3da..f8c9a2752f06 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h @@ -57,7 +57,9 @@ extern int cpuset_memory_pressure_enabled; extern void __cpuset_memory_pressure_bump(void); extern const struct file_operations proc_cpuset_operations; -extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); +struct seq_file; +extern void cpuset_task_status_allowed(struct seq_file *m, + struct task_struct *task); extern void cpuset_lock(void); extern void cpuset_unlock(void); @@ -126,10 +128,9 @@ static inline int cpuset_mems_allowed_intersects(const struct task_struct *tsk1, static inline void cpuset_memory_pressure_bump(void) {} -static inline char *cpuset_task_status_allowed(struct task_struct *task, - char *buffer) +static inline void cpuset_task_status_allowed(struct seq_file *m, + struct task_struct *task) { - return buffer; } static inline void cpuset_lock(void) {} diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index b04ebf09fb91..e4a8f9aef188 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -118,7 +118,8 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir); unsigned long task_vsize(struct mm_struct *); int task_statm(struct mm_struct *, int *, int *, int *, int *); -char *task_mem(struct mm_struct *, char *); +void task_mem(struct seq_file *, struct mm_struct *); +void clear_refs_smap(struct mm_struct *mm); struct proc_dir_entry *de_get(struct proc_dir_entry *de); void de_put(struct proc_dir_entry *de); -- cgit v1.2.3-59-g8ed1b