]> Pileus Git - ~andy/linux/blobdiff - fs/proc/base.c
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee13...
[~andy/linux] / fs / proc / base.c
index 725e279c3bdf0dc6aba79cc33ea4c970c593b1cc..82da55b5cffef804f4528bf1bed4d94645f7df2d 100644 (file)
@@ -958,7 +958,7 @@ static struct inode *proc_pid_make_inode(struct super_block * sb, struct task_st
        /*
         * grab the reference to task.
         */
-       ei->pid = get_pid(task_pid(task));
+       ei->pid = get_task_pid(task, PIDTYPE_PID);
        if (!ei->pid)
                goto out_unlock;
 
@@ -1057,6 +1057,18 @@ static struct dentry_operations pid_dentry_operations =
 
 typedef struct dentry *instantiate_t(struct inode *, struct dentry *, struct task_struct *, void *);
 
+/*
+ * Fill a directory entry.
+ *
+ * If possible create the dcache entry and derive our inode number and
+ * file type from dcache entry.
+ *
+ * Since all of the proc inode numbers are dynamically generated, the inode
+ * numbers do not exist until the inode is cache.  This means creating the
+ * the dcache entry in readdir is necessary to keep the inode numbers
+ * reported by readdir in sync with the inode numbers reported
+ * by stat.
+ */
 static int proc_fill_cache(struct file *filp, void *dirent, filldir_t filldir,
        char *name, int len,
        instantiate_t instantiate, struct task_struct *task, void *ptr)
@@ -1247,7 +1259,6 @@ out_iput:
        goto out;
 }
 
-/* SMP-safe */
 static struct dentry *proc_lookupfd(struct inode * dir, struct dentry * dentry, struct nameidata *nd)
 {
        struct task_struct *task = get_proc_task(dir);
@@ -1374,7 +1385,6 @@ out:
        return error;
 }
 
-/* SMP-safe */
 static struct dentry *proc_pident_lookup(struct inode *dir, 
                                         struct dentry *dentry,
                                         struct pid_entry *ents,
@@ -1667,7 +1677,7 @@ static struct dentry *proc_base_instantiate(struct inode *dir,
        /*
         * grab the reference to the task.
         */
-       ei->pid = get_pid(task_pid(task));
+       ei->pid = get_task_pid(task, PIDTYPE_PID);
        if (!ei->pid)
                goto out_iput;
 
@@ -1899,7 +1909,6 @@ out:
        return error;
 }
 
-/* SMP-safe */
 struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *nd)
 {
        struct dentry *result = ERR_PTR(-ENOENT);
@@ -2106,7 +2115,6 @@ out:
        return error;
 }
 
-/* SMP-safe */
 static struct dentry *proc_task_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *nd)
 {
        struct dentry *result = ERR_PTR(-ENOENT);