From a2ade7b6ca37c808128810687cd56e8a44443e65 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Wed, 12 Jan 2011 17:00:32 -0800 Subject: proc: use unsigned long inside /proc/*/statm /proc/*/statm code needlessly truncates data from unsigned long to int. One needs only 8+ TB of RAM to make truncation visible. Signed-off-by: Alexey Dobriyan Reviewed-by: WANG Cong Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/proc/internal.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fs/proc/internal.h') diff --git a/fs/proc/internal.h b/fs/proc/internal.h index 1f24a3e..659ea6a 100644 --- a/fs/proc/internal.h +++ b/fs/proc/internal.h @@ -96,7 +96,8 @@ extern spinlock_t proc_subdir_lock; struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *); 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 *); +unsigned long task_statm(struct mm_struct *, + unsigned long *, unsigned long *, unsigned long *, unsigned long *); void task_mem(struct seq_file *, struct mm_struct *); static inline struct proc_dir_entry *pde_get(struct proc_dir_entry *pde) -- cgit v1.1 From 6d1b6e4eff89475785f60fa00f65da780f869f36 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Wed, 12 Jan 2011 17:00:33 -0800 Subject: proc: ->low_ino cleanup - ->low_ino is write-once field -- reading it under locks is unnecessary. - /proc/$PID stuff never reaches pde_put()/free_proc_entry() -- PROC_DYNAMIC_FIRST check never triggers. - in proc_get_inode(), inode number always matches proc dir entry, so save one parameter. Signed-off-by: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/proc/internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/proc/internal.h') diff --git a/fs/proc/internal.h b/fs/proc/internal.h index 659ea6a..9ad561d 100644 --- a/fs/proc/internal.h +++ b/fs/proc/internal.h @@ -109,7 +109,7 @@ void pde_put(struct proc_dir_entry *pde); extern struct vfsmount *proc_mnt; int proc_fill_super(struct super_block *); -struct inode *proc_get_inode(struct super_block *, unsigned int, struct proc_dir_entry *); +struct inode *proc_get_inode(struct super_block *, struct proc_dir_entry *); /* * These are generic /proc routines that use the internal -- cgit v1.1