diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-06-19 22:45:37 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-06-19 22:45:37 +0000 |
commit | 6d403070f28cd44860fdb3a53be5da0275c65cf4 (patch) | |
tree | 0d0e7fe7b5fb7568d19e11d7d862b77a866ce081 /fs/proc | |
parent | ecf1bf5f6c2e668d03b0a9fb026db7aa41e292e1 (diff) |
Merge with 2.4.0-test1-ac21 + pile of MIPS cleanups to make merging
possible. Chainsawed RM200 kernel to compile again. Jazz machine
status unknown.
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/base.c | 20 | ||||
-rw-r--r-- | fs/proc/generic.c | 7 | ||||
-rw-r--r-- | fs/proc/inode.c | 12 | ||||
-rw-r--r-- | fs/proc/proc_misc.c | 6 |
4 files changed, 28 insertions, 17 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index d513987d8..fa7ff052d 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -160,6 +160,24 @@ static int proc_pid_cmdline(struct task_struct *task, char * buffer) if (len > PAGE_SIZE) len = PAGE_SIZE; res = access_process_vm(task, mm->arg_start, buffer, len, 0); + // If the nul at the end of args has been overwritten, then + // assume application is using setproctitle(3). + if ( res > 0 && buffer[res-1] != '\0' ) + { + len = strnlen( buffer, res ); + if ( len < res ) + { + res = len; + } + else + { + len = mm->env_end - mm->env_start; + if (len > PAGE_SIZE - res) + len = PAGE_SIZE - res; + res += access_process_vm(task, mm->env_start, buffer+res, len, 0); + res = strnlen( buffer, res ); + } + } mmput(mm); } return res; @@ -285,7 +303,7 @@ static struct file_operations proc_info_file_operations = { }; #define MAY_PTRACE(p) \ -(p==current||(p->p_pptr==current&&(p->flags&PF_PTRACED)&&p->state==TASK_STOPPED)) +(p==current||(p->p_pptr==current&&(p->ptrace&PT_PTRACED)&&p->state==TASK_STOPPED)) static ssize_t mem_read(struct file * file, char * buf, size_t count, loff_t *ppos) diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 1585657a2..dc6f96b17 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -14,6 +14,8 @@ #include <linux/sched.h> #include <linux/proc_fs.h> #include <linux/stat.h> +#define __NO_VERSION__ +#include <linux/module.h> #include <asm/bitops.h> static ssize_t proc_file_read(struct file * file, char * buf, @@ -397,13 +399,14 @@ static void proc_kill_inodes(struct proc_dir_entry *de) continue; if (inode->u.generic_ip != de) continue; + fops_put(filp->f_op); filp->f_op = NULL; } file_list_unlock(); } struct proc_dir_entry *proc_symlink(const char *name, - struct proc_dir_entry *parent, char *dest) + struct proc_dir_entry *parent, const char *dest) { struct proc_dir_entry *ent = NULL; const char *fn = name; @@ -535,7 +538,7 @@ void free_proc_entry(struct proc_dir_entry *de) { int ino = de->low_ino; - if (ino < PROC_DYNAMIC_FIRST && + if (ino < PROC_DYNAMIC_FIRST || ino >= PROC_DYNAMIC_FIRST+PROC_NDYNAMIC) return; if (S_ISLNK(de->mode) && de->data) diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 67273b3ba..7b571398a 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -52,16 +52,6 @@ void de_put(struct proc_dir_entry *de) } } -static void proc_put_inode(struct inode *inode) -{ - /* - * Kill off unused inodes ... VFS will unhash and - * delete the inode if we set i_nlink to zero. - */ - if (inode->i_count == 1) - inode->i_nlink = 0; -} - /* * Decrement the use count of the proc_dir_entry. */ @@ -102,7 +92,7 @@ static int proc_statfs(struct super_block *sb, struct statfs *buf) static struct super_operations proc_sops = { read_inode: proc_read_inode, - put_inode: proc_put_inode, + put_inode: force_delete, delete_inode: proc_delete_inode, statfs: proc_statfs, }; diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index 9afe2d67c..f2503b765 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c @@ -325,14 +325,14 @@ static int kstat_read_proc(char *page, char **start, off_t off, for (major = 0; major < DK_MAX_MAJOR; major++) { for (disk = 0; disk < DK_MAX_DISK; disk++) { - int active = kstat.dk_drive_rio[major][disk] + + int active = kstat.dk_drive[major][disk] + kstat.dk_drive_rblk[major][disk] + - kstat.dk_drive_wio[major][disk] + kstat.dk_drive_wblk[major][disk]; if (active) len += sprintf(page + len, - "(%u,%u):(%u,%u,%u,%u) ", + "(%u,%u):(%u,%u,%u,%u,%u) ", major, disk, + kstat.dk_drive[major][disk], kstat.dk_drive_rio[major][disk], kstat.dk_drive_rblk[major][disk], kstat.dk_drive_wio[major][disk], |