From 78c388aed2b7184182c08428db1de6c872d815f5 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Mon, 4 Jan 1999 16:03:48 +0000 Subject: Merge with Linux 2.1.131 and more MIPS goodies. (Did I mention that CVS is buggy ...) --- fs/proc/root.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'fs/proc/root.c') diff --git a/fs/proc/root.c b/fs/proc/root.c index e2889d123..5f3044f1f 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c @@ -55,9 +55,6 @@ static struct file_operations proc_dir_operations = { NULL /* can't fsync */ }; -int proc_readlink(struct dentry * dentry, char * buffer, int buflen); -struct dentry * proc_follow_link(struct dentry *dentry, struct dentry *base); - /* * proc directories can do almost nothing.. */ @@ -388,12 +385,13 @@ static int proc_self_readlink(struct dentry *dentry, char *buffer, int buflen) } static struct dentry * proc_self_follow_link(struct dentry *dentry, - struct dentry *base) + struct dentry *base, + unsigned int follow) { char tmp[30]; sprintf(tmp, "%d", current->pid); - return lookup_dentry(tmp, base, 1); + return lookup_dentry(tmp, base, follow); } int proc_readlink(struct dentry * dentry, char * buffer, int buflen) @@ -420,7 +418,7 @@ int proc_readlink(struct dentry * dentry, char * buffer, int buflen) return len; } -struct dentry * proc_follow_link(struct dentry * dentry, struct dentry *base) +struct dentry * proc_follow_link(struct dentry * dentry, struct dentry *base, unsigned int follow) { struct inode *inode = dentry->d_inode; struct proc_dir_entry * de; @@ -435,7 +433,7 @@ struct dentry * proc_follow_link(struct dentry * dentry, struct dentry *base) if (de->readlink_proc) len = de->readlink_proc(de, page); - d = lookup_dentry(page, base, 1); + d = lookup_dentry(page, base, follow); free_page((unsigned long) page); return d; } @@ -742,7 +740,7 @@ proc_delete_dentry(struct dentry * dentry) d_drop(dentry); } -static struct dentry_operations proc_dentry_operations = +struct dentry_operations proc_dentry_operations = { NULL, /* revalidate */ NULL, /* d_hash */ @@ -839,6 +837,7 @@ static int proc_root_lookup(struct inode * dir, struct dentry * dentry) inode = proc_get_inode(dir->i_sb, ino, &proc_pid); if (!inode) return -EINVAL; + inode->i_flags|=S_IMMUTABLE; } dentry->d_op = &proc_dentry_operations; @@ -955,6 +954,7 @@ static int proc_root_readdir(struct file * filp, for (i = 0; i < nr_pids; i++) { int pid = pid_array[i]; + ino_t ino = (pid << 16) + PROC_PID_INO; unsigned long j = PROC_NUMBUF; do { @@ -963,7 +963,7 @@ static int proc_root_readdir(struct file * filp, pid /= 10; } while (pid); - if (filldir(dirent, buf+j, PROC_NUMBUF-j, filp->f_pos, (pid << 16) + PROC_PID_INO) < 0) + if (filldir(dirent, buf+j, PROC_NUMBUF-j, filp->f_pos, ino) < 0) break; filp->f_pos++; } -- cgit v1.2.3