Incrementally update my proc-dont-lock-task_structs-indefinitely patches so
that they work with struct pid instead of struct task_ref.
Mostly this is a straight 1-1 substitution.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
if (!capable(CAP_AUDIT_CONTROL))
return -EPERM;
if (!capable(CAP_AUDIT_CONTROL))
return -EPERM;
- if (current != proc_tref(inode)->task)
+ if (current != pid_task(proc_pid(inode), PIDTYPE_PID))
return -EPERM;
if (count >= PAGE_SIZE)
return -EPERM;
if (count >= PAGE_SIZE)
/*
* grab the reference to task.
*/
/*
* grab the reference to task.
*/
- ei->tref = tref_get_by_task(task);
- if (!tref_task(ei->tref))
+ ei->pid = get_pid(task->pids[PIDTYPE_PID].pid);
+ if (!ei->pid)
goto out_unlock;
inode->i_uid = 0;
goto out_unlock;
inode->i_uid = 0;
* If so, then don't put the dentry on the lru list,
* kill it immediately.
*/
* If so, then don't put the dentry on the lru list,
* kill it immediately.
*/
- return !proc_tref(dentry->d_inode)->task;
+ return !proc_pid(dentry->d_inode)->tasks[PIDTYPE_PID].first;
}
static struct dentry_operations tid_fd_dentry_operations =
}
static struct dentry_operations tid_fd_dentry_operations =
truncate_inode_pages(&inode->i_data, 0);
/* Stop tracking associated processes */
truncate_inode_pages(&inode->i_data, 0);
/* Stop tracking associated processes */
- tref_put(PROC_I(inode)->tref);
+ put_pid(PROC_I(inode)->pid);
/* Let go of any associated proc directory entry */
de = PROC_I(inode)->pde;
/* Let go of any associated proc directory entry */
de = PROC_I(inode)->pde;
ei = (struct proc_inode *)kmem_cache_alloc(proc_inode_cachep, SLAB_KERNEL);
if (!ei)
return NULL;
ei = (struct proc_inode *)kmem_cache_alloc(proc_inode_cachep, SLAB_KERNEL);
if (!ei)
return NULL;
ei->fd = 0;
ei->op.proc_get_link = NULL;
ei->pde = NULL;
ei->fd = 0;
ei->op.proc_get_link = NULL;
ei->pde = NULL;
*/
#include <linux/proc_fs.h>
*/
#include <linux/proc_fs.h>
-#include <linux/task_ref.h>
struct vmalloc_info {
unsigned long used;
struct vmalloc_info {
unsigned long used;
int proc_init_inodecache(void);
int proc_init_inodecache(void);
-static inline struct task_ref *proc_tref(struct inode *inode)
+static inline struct pid *proc_pid(struct inode *inode)
- return PROC_I(inode)->tref;
+ return PROC_I(inode)->pid;
}
static inline struct task_struct *get_proc_task(struct inode *inode)
{
}
static inline struct task_struct *get_proc_task(struct inode *inode)
{
- return get_tref_task(proc_tref(inode));
+ return get_pid_task(proc_pid(inode), PIDTYPE_PID);
}
static inline int proc_fd(struct inode *inode)
}
static inline int proc_fd(struct inode *inode)
if (last_addr == -1UL)
return NULL;
if (last_addr == -1UL)
return NULL;
- priv->task = get_tref_task(priv->tref);
+ priv->task = get_pid_task(priv->pid, PIDTYPE_PID);
if (!priv->task)
return NULL;
if (!priv->task)
return NULL;
int ret = -ENOMEM;
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (priv) {
int ret = -ENOMEM;
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (priv) {
- priv->tref = proc_tref(inode);
+ priv->pid = proc_pid(inode);
ret = seq_open(file, ops);
if (!ret) {
struct seq_file *m = file->private_data;
ret = seq_open(file, ops);
if (!ret) {
struct seq_file *m = file->private_data;
#endif
struct proc_inode {
#endif
struct proc_inode {
int fd;
union {
int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **);
int fd;
union {
int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **);
}
struct proc_maps_private {
}
struct proc_maps_private {
struct task_struct *task;
struct vm_area_struct *tail_vma;
};
struct task_struct *task;
struct vm_area_struct *tail_vma;
};
#include <linux/time.h>
#include <linux/backing-dev.h>
#include <linux/sort.h>
#include <linux/time.h>
#include <linux/backing-dev.h>
#include <linux/sort.h>
-#include <linux/task_ref.h>
#include <asm/uaccess.h>
#include <asm/atomic.h>
#include <asm/uaccess.h>
#include <asm/atomic.h>
*/
static int proc_cpuset_show(struct seq_file *m, void *v)
{
*/
static int proc_cpuset_show(struct seq_file *m, void *v)
{
struct task_struct *tsk;
char *buf;
int retval;
struct task_struct *tsk;
char *buf;
int retval;
goto out;
retval = -ESRCH;
goto out;
retval = -ESRCH;
- tref = m->private;
- tsk = get_tref_task(tref);
+ pid = m->private;
+ tsk = get_pid_task(pid, PIDTYPE_PID);
static int cpuset_open(struct inode *inode, struct file *file)
{
static int cpuset_open(struct inode *inode, struct file *file)
{
- struct task_ref *tref = PROC_I(inode)->tref;
- return single_open(file, proc_cpuset_show, tref);
+ struct pid *pid = PROC_I(inode)->pid;
+ return single_open(file, proc_cpuset_show, pid);
}
struct file_operations proc_cpuset_operations = {
}
struct file_operations proc_cpuset_operations = {