summaryrefslogtreecommitdiffstats
path: root/fs/proc/root.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-01-04 16:03:48 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-01-04 16:03:48 +0000
commit78c388aed2b7184182c08428db1de6c872d815f5 (patch)
tree4b2003b1b4ceb241a17faa995da8dd1004bb8e45 /fs/proc/root.c
parenteb7a5bf93aaa4be1d7c6181100ab7639e74d67f7 (diff)
Merge with Linux 2.1.131 and more MIPS goodies.
(Did I mention that CVS is buggy ...)
Diffstat (limited to 'fs/proc/root.c')
-rw-r--r--fs/proc/root.c18
1 files changed, 9 insertions, 9 deletions
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++;
}