fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / fs / proc / inode.c
index 6d25888..5b0367f 100644 (file)
@@ -58,14 +58,11 @@ static void de_put(struct proc_dir_entry *de)
 static void proc_delete_inode(struct inode *inode)
 {
        struct proc_dir_entry *de;
-       struct task_struct *tsk;
 
        truncate_inode_pages(&inode->i_data, 0);
 
-       /* Let go of any associated process */
-       tsk = PROC_I(inode)->task;
-       if (tsk)
-               put_task_struct(tsk);
+       /* Stop tracking associated processes */
+       put_pid(PROC_I(inode)->pid);
 
        /* Let go of any associated proc directory entry */
        de = PROC_I(inode)->pde;
@@ -84,18 +81,18 @@ static void proc_read_inode(struct inode * inode)
        inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
 }
 
-static kmem_cache_t * proc_inode_cachep;
+static struct kmem_cache * proc_inode_cachep;
 
 static struct inode *proc_alloc_inode(struct super_block *sb)
 {
        struct proc_inode *ei;
        struct inode *inode;
 
-       ei = (struct proc_inode *)kmem_cache_alloc(proc_inode_cachep, SLAB_KERNEL);
+       ei = (struct proc_inode *)kmem_cache_alloc(proc_inode_cachep, GFP_KERNEL);
        if (!ei)
                return NULL;
-       ei->task = NULL;
-       ei->type = 0;
+       ei->pid = NULL;
+       ei->fd = 0;
        ei->op.proc_get_link = NULL;
        ei->pde = NULL;
        inode = &ei->vfs_inode;
@@ -108,7 +105,7 @@ static void proc_destroy_inode(struct inode *inode)
        kmem_cache_free(proc_inode_cachep, PROC_I(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
 {
        struct proc_inode *ei = (struct proc_inode *) foo;
 
@@ -121,7 +118,8 @@ int __init proc_init_inodecache(void)
 {
        proc_inode_cachep = kmem_cache_create("proc_inode_cache",
                                             sizeof(struct proc_inode),
-                                            0, SLAB_RECLAIM_ACCOUNT,
+                                            0, (SLAB_RECLAIM_ACCOUNT|
+                                               SLAB_MEM_SPREAD),
                                             init_once, NULL);
        if (proc_inode_cachep == NULL)
                return -ENOMEM;
@@ -196,7 +194,7 @@ int proc_fill_super(struct super_block *s, void *data, int silent)
 {
        struct inode * root_inode;
 
-       s->s_flags |= MS_NODIRATIME;
+       s->s_flags |= MS_NODIRATIME | MS_NOSUID | MS_NOEXEC;
        s->s_blocksize = 1024;
        s->s_blocksize_bits = 10;
        s->s_magic = PROC_SUPER_MAGIC;