aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/base.c8
-rw-r--r--fs/proc/inode.c4
-rw-r--r--fs/proc/internal.h7
-rw-r--r--fs/proc/task_mmu.c4
4 files changed, 11 insertions, 12 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 489810abc72d..c7f855441573 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -951,7 +951,7 @@ static ssize_t proc_loginuid_write(struct file * file, const char __user * buf,
951 if (!capable(CAP_AUDIT_CONTROL)) 951 if (!capable(CAP_AUDIT_CONTROL))
952 return -EPERM; 952 return -EPERM;
953 953
954 if (current != proc_tref(inode)->task) 954 if (current != pid_task(proc_pid(inode), PIDTYPE_PID))
955 return -EPERM; 955 return -EPERM;
956 956
957 if (count >= PAGE_SIZE) 957 if (count >= PAGE_SIZE)
@@ -1363,8 +1363,8 @@ static struct inode *proc_pid_make_inode(struct super_block * sb, struct task_st
1363 /* 1363 /*
1364 * grab the reference to task. 1364 * grab the reference to task.
1365 */ 1365 */
1366 ei->tref = tref_get_by_task(task); 1366 ei->pid = get_pid(task->pids[PIDTYPE_PID].pid);
1367 if (!tref_task(ei->tref)) 1367 if (!ei->pid)
1368 goto out_unlock; 1368 goto out_unlock;
1369 1369
1370 inode->i_uid = 0; 1370 inode->i_uid = 0;
@@ -1482,7 +1482,7 @@ static int pid_delete_dentry(struct dentry * dentry)
1482 * If so, then don't put the dentry on the lru list, 1482 * If so, then don't put the dentry on the lru list,
1483 * kill it immediately. 1483 * kill it immediately.
1484 */ 1484 */
1485 return !proc_tref(dentry->d_inode)->task; 1485 return !proc_pid(dentry->d_inode)->tasks[PIDTYPE_PID].first;
1486} 1486}
1487 1487
1488static struct dentry_operations tid_fd_dentry_operations = 1488static struct dentry_operations tid_fd_dentry_operations =
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 31e0475c6cb9..6dcef089e18e 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -62,7 +62,7 @@ static void proc_delete_inode(struct inode *inode)
62 truncate_inode_pages(&inode->i_data, 0); 62 truncate_inode_pages(&inode->i_data, 0);
63 63
64 /* Stop tracking associated processes */ 64 /* Stop tracking associated processes */
65 tref_put(PROC_I(inode)->tref); 65 put_pid(PROC_I(inode)->pid);
66 66
67 /* Let go of any associated proc directory entry */ 67 /* Let go of any associated proc directory entry */
68 de = PROC_I(inode)->pde; 68 de = PROC_I(inode)->pde;
@@ -91,7 +91,7 @@ static struct inode *proc_alloc_inode(struct super_block *sb)
91 ei = (struct proc_inode *)kmem_cache_alloc(proc_inode_cachep, SLAB_KERNEL); 91 ei = (struct proc_inode *)kmem_cache_alloc(proc_inode_cachep, SLAB_KERNEL);
92 if (!ei) 92 if (!ei)
93 return NULL; 93 return NULL;
94 ei->tref = NULL; 94 ei->pid = NULL;
95 ei->fd = 0; 95 ei->fd = 0;
96 ei->op.proc_get_link = NULL; 96 ei->op.proc_get_link = NULL;
97 ei->pde = NULL; 97 ei->pde = NULL;
diff --git a/fs/proc/internal.h b/fs/proc/internal.h
index 37f1648adc23..146a434ba944 100644
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
@@ -10,7 +10,6 @@
10 */ 10 */
11 11
12#include <linux/proc_fs.h> 12#include <linux/proc_fs.h>
13#include <linux/task_ref.h>
14 13
15struct vmalloc_info { 14struct vmalloc_info {
16 unsigned long used; 15 unsigned long used;
@@ -51,14 +50,14 @@ void free_proc_entry(struct proc_dir_entry *de);
51 50
52int proc_init_inodecache(void); 51int proc_init_inodecache(void);
53 52
54static inline struct task_ref *proc_tref(struct inode *inode) 53static inline struct pid *proc_pid(struct inode *inode)
55{ 54{
56 return PROC_I(inode)->tref; 55 return PROC_I(inode)->pid;
57} 56}
58 57
59static inline struct task_struct *get_proc_task(struct inode *inode) 58static inline struct task_struct *get_proc_task(struct inode *inode)
60{ 59{
61 return get_tref_task(proc_tref(inode)); 60 return get_pid_task(proc_pid(inode), PIDTYPE_PID);
62} 61}
63 62
64static inline int proc_fd(struct inode *inode) 63static inline int proc_fd(struct inode *inode)
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index abf3208c3f60..0137ec4c1368 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -320,7 +320,7 @@ static void *m_start(struct seq_file *m, loff_t *pos)
320 if (last_addr == -1UL) 320 if (last_addr == -1UL)
321 return NULL; 321 return NULL;
322 322
323 priv->task = get_tref_task(priv->tref); 323 priv->task = get_pid_task(priv->pid, PIDTYPE_PID);
324 if (!priv->task) 324 if (!priv->task)
325 return NULL; 325 return NULL;
326 326
@@ -416,7 +416,7 @@ static int do_maps_open(struct inode *inode, struct file *file,
416 int ret = -ENOMEM; 416 int ret = -ENOMEM;
417 priv = kzalloc(sizeof(*priv), GFP_KERNEL); 417 priv = kzalloc(sizeof(*priv), GFP_KERNEL);
418 if (priv) { 418 if (priv) {
419 priv->tref = proc_tref(inode); 419 priv->pid = proc_pid(inode);
420 ret = seq_open(file, ops); 420 ret = seq_open(file, ops);
421 if (!ret) { 421 if (!ret) {
422 struct seq_file *m = file->private_data; 422 struct seq_file *m = file->private_data;