X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fproc%2Froot.c;h=15e159924923d97dee02370c1d2ea32c26d9f695;hb=refs%2Fheads%2Fvserver;hp=307ba7be02c39292b74aaeb86a0b8b9d8a54dc84;hpb=64ba3f394c830ec48a1c31b53dcae312c56f1604;p=linux-2.6.git diff --git a/fs/proc/root.c b/fs/proc/root.c index 307ba7be0..15e159924 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c @@ -12,11 +12,12 @@ #include #include #include -#include #include +#include #include #include #include +#include #include "internal.h" @@ -29,10 +30,21 @@ struct proc_dir_entry *proc_virtual; extern void proc_vx_init(void); -static struct super_block *proc_get_sb(struct file_system_type *fs_type, - int flags, const char *dev_name, void *data) +static int proc_get_sb(struct file_system_type *fs_type, + int flags, const char *dev_name, void *data, struct vfsmount *mnt) { - return get_sb_single(fs_type, flags, data, proc_fill_super); + if (proc_mnt) { + /* Seed the root directory with a pid so it doesn't need + * to be special in base.c. I would do this earlier but + * the only task alive when /proc is mounted the first time + * is the init_task and it doesn't have any pids. + */ + struct proc_inode *ei; + ei = PROC_I(proc_mnt->mnt_sb->s_root->d_inode); + if (!ei->pid) + ei->pid = find_get_pid(1); + } + return get_sb_single(fs_type, flags, data, proc_fill_super, mnt); } static struct file_system_type proc_fs_type = {