Commit 2fddfeef authored by Josef "Jeff" Sipek's avatar Josef "Jeff" Sipek Committed by Linus Torvalds

[PATCH] proc: change uses of f_{dentry, vfsmnt} to use f_path

Change all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the proc
filesystem code.
Signed-off-by: default avatarJosef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f427f5d5
...@@ -472,7 +472,7 @@ static struct file_operations proc_mountstats_operations = { ...@@ -472,7 +472,7 @@ static struct file_operations proc_mountstats_operations = {
static ssize_t proc_info_read(struct file * file, char __user * buf, static ssize_t proc_info_read(struct file * file, char __user * buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct inode * inode = file->f_dentry->d_inode; struct inode * inode = file->f_path.dentry->d_inode;
unsigned long page; unsigned long page;
ssize_t length; ssize_t length;
struct task_struct *task = get_proc_task(inode); struct task_struct *task = get_proc_task(inode);
...@@ -512,7 +512,7 @@ static int mem_open(struct inode* inode, struct file* file) ...@@ -512,7 +512,7 @@ static int mem_open(struct inode* inode, struct file* file)
static ssize_t mem_read(struct file * file, char __user * buf, static ssize_t mem_read(struct file * file, char __user * buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct task_struct *task = get_proc_task(file->f_dentry->d_inode); struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode);
char *page; char *page;
unsigned long src = *ppos; unsigned long src = *ppos;
int ret = -ESRCH; int ret = -ESRCH;
...@@ -584,7 +584,7 @@ static ssize_t mem_write(struct file * file, const char * buf, ...@@ -584,7 +584,7 @@ static ssize_t mem_write(struct file * file, const char * buf,
{ {
int copied; int copied;
char *page; char *page;
struct task_struct *task = get_proc_task(file->f_dentry->d_inode); struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode);
unsigned long dst = *ppos; unsigned long dst = *ppos;
copied = -ESRCH; copied = -ESRCH;
...@@ -654,7 +654,7 @@ static struct file_operations proc_mem_operations = { ...@@ -654,7 +654,7 @@ static struct file_operations proc_mem_operations = {
static ssize_t oom_adjust_read(struct file *file, char __user *buf, static ssize_t oom_adjust_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct task_struct *task = get_proc_task(file->f_dentry->d_inode); struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode);
char buffer[PROC_NUMBUF]; char buffer[PROC_NUMBUF];
size_t len; size_t len;
int oom_adjust; int oom_adjust;
...@@ -694,7 +694,7 @@ static ssize_t oom_adjust_write(struct file *file, const char __user *buf, ...@@ -694,7 +694,7 @@ static ssize_t oom_adjust_write(struct file *file, const char __user *buf,
return -EINVAL; return -EINVAL;
if (*end == '\n') if (*end == '\n')
end++; end++;
task = get_proc_task(file->f_dentry->d_inode); task = get_proc_task(file->f_path.dentry->d_inode);
if (!task) if (!task)
return -ESRCH; return -ESRCH;
if (oom_adjust < task->oomkilladj && !capable(CAP_SYS_RESOURCE)) { if (oom_adjust < task->oomkilladj && !capable(CAP_SYS_RESOURCE)) {
...@@ -718,7 +718,7 @@ static struct file_operations proc_oom_adjust_operations = { ...@@ -718,7 +718,7 @@ static struct file_operations proc_oom_adjust_operations = {
static ssize_t proc_loginuid_read(struct file * file, char __user * buf, static ssize_t proc_loginuid_read(struct file * file, char __user * buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct inode * inode = file->f_dentry->d_inode; struct inode * inode = file->f_path.dentry->d_inode;
struct task_struct *task = get_proc_task(inode); struct task_struct *task = get_proc_task(inode);
ssize_t length; ssize_t length;
char tmpbuf[TMPBUFLEN]; char tmpbuf[TMPBUFLEN];
...@@ -734,7 +734,7 @@ static ssize_t proc_loginuid_read(struct file * file, char __user * buf, ...@@ -734,7 +734,7 @@ static ssize_t proc_loginuid_read(struct file * file, char __user * buf,
static ssize_t proc_loginuid_write(struct file * file, const char __user * buf, static ssize_t proc_loginuid_write(struct file * file, const char __user * buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct inode * inode = file->f_dentry->d_inode; struct inode * inode = file->f_path.dentry->d_inode;
char *page, *tmp; char *page, *tmp;
ssize_t length; ssize_t length;
uid_t loginuid; uid_t loginuid;
...@@ -1078,7 +1078,7 @@ static int proc_fill_cache(struct file *filp, void *dirent, filldir_t filldir, ...@@ -1078,7 +1078,7 @@ static int proc_fill_cache(struct file *filp, void *dirent, filldir_t filldir,
char *name, int len, char *name, int len,
instantiate_t instantiate, struct task_struct *task, void *ptr) instantiate_t instantiate, struct task_struct *task, void *ptr)
{ {
struct dentry *child, *dir = filp->f_dentry; struct dentry *child, *dir = filp->f_path.dentry;
struct inode *inode; struct inode *inode;
struct qstr qname; struct qstr qname;
ino_t ino = 0; ino_t ino = 0;
...@@ -1157,8 +1157,8 @@ static int proc_fd_link(struct inode *inode, struct dentry **dentry, struct vfsm ...@@ -1157,8 +1157,8 @@ static int proc_fd_link(struct inode *inode, struct dentry **dentry, struct vfsm
spin_lock(&files->file_lock); spin_lock(&files->file_lock);
file = fcheck_files(files, fd); file = fcheck_files(files, fd);
if (file) { if (file) {
*mnt = mntget(file->f_vfsmnt); *mnt = mntget(file->f_path.mnt);
*dentry = dget(file->f_dentry); *dentry = dget(file->f_path.dentry);
spin_unlock(&files->file_lock); spin_unlock(&files->file_lock);
put_files_struct(files); put_files_struct(files);
return 0; return 0;
...@@ -1293,7 +1293,7 @@ static int proc_fd_fill_cache(struct file *filp, void *dirent, filldir_t filldir ...@@ -1293,7 +1293,7 @@ static int proc_fd_fill_cache(struct file *filp, void *dirent, filldir_t filldir
static int proc_readfd(struct file * filp, void * dirent, filldir_t filldir) static int proc_readfd(struct file * filp, void * dirent, filldir_t filldir)
{ {
struct dentry *dentry = filp->f_dentry; struct dentry *dentry = filp->f_path.dentry;
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
struct task_struct *p = get_proc_task(inode); struct task_struct *p = get_proc_task(inode);
unsigned int fd, tid, ino; unsigned int fd, tid, ino;
...@@ -1440,7 +1440,7 @@ static int proc_pident_readdir(struct file *filp, ...@@ -1440,7 +1440,7 @@ static int proc_pident_readdir(struct file *filp,
{ {
int i; int i;
int pid; int pid;
struct dentry *dentry = filp->f_dentry; struct dentry *dentry = filp->f_path.dentry;
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
struct task_struct *task = get_proc_task(inode); struct task_struct *task = get_proc_task(inode);
struct pid_entry *p, *last; struct pid_entry *p, *last;
...@@ -1496,7 +1496,7 @@ static int proc_pident_readdir(struct file *filp, ...@@ -1496,7 +1496,7 @@ static int proc_pident_readdir(struct file *filp,
static ssize_t proc_pid_attr_read(struct file * file, char __user * buf, static ssize_t proc_pid_attr_read(struct file * file, char __user * buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct inode * inode = file->f_dentry->d_inode; struct inode * inode = file->f_path.dentry->d_inode;
unsigned long page; unsigned long page;
ssize_t length; ssize_t length;
struct task_struct *task = get_proc_task(inode); struct task_struct *task = get_proc_task(inode);
...@@ -1512,7 +1512,7 @@ static ssize_t proc_pid_attr_read(struct file * file, char __user * buf, ...@@ -1512,7 +1512,7 @@ static ssize_t proc_pid_attr_read(struct file * file, char __user * buf,
goto out; goto out;
length = security_getprocattr(task, length = security_getprocattr(task,
(char*)file->f_dentry->d_name.name, (char*)file->f_path.dentry->d_name.name,
(void*)page, count); (void*)page, count);
if (length >= 0) if (length >= 0)
length = simple_read_from_buffer(buf, count, ppos, (char *)page, length); length = simple_read_from_buffer(buf, count, ppos, (char *)page, length);
...@@ -1526,7 +1526,7 @@ static ssize_t proc_pid_attr_read(struct file * file, char __user * buf, ...@@ -1526,7 +1526,7 @@ static ssize_t proc_pid_attr_read(struct file * file, char __user * buf,
static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf, static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct inode * inode = file->f_dentry->d_inode; struct inode * inode = file->f_path.dentry->d_inode;
char *page; char *page;
ssize_t length; ssize_t length;
struct task_struct *task = get_proc_task(inode); struct task_struct *task = get_proc_task(inode);
...@@ -1552,7 +1552,7 @@ static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf, ...@@ -1552,7 +1552,7 @@ static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf,
goto out_free; goto out_free;
length = security_setprocattr(task, length = security_setprocattr(task,
(char*)file->f_dentry->d_name.name, (char*)file->f_path.dentry->d_name.name,
(void*)page, count); (void*)page, count);
out_free: out_free:
free_page((unsigned long) page); free_page((unsigned long) page);
...@@ -1994,7 +1994,7 @@ static int proc_pid_fill_cache(struct file *filp, void *dirent, filldir_t filldi ...@@ -1994,7 +1994,7 @@ static int proc_pid_fill_cache(struct file *filp, void *dirent, filldir_t filldi
int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir) int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
{ {
unsigned int nr = filp->f_pos - FIRST_PROCESS_ENTRY; unsigned int nr = filp->f_pos - FIRST_PROCESS_ENTRY;
struct task_struct *reaper = get_proc_task(filp->f_dentry->d_inode); struct task_struct *reaper = get_proc_task(filp->f_path.dentry->d_inode);
struct task_struct *task; struct task_struct *task;
int tgid; int tgid;
...@@ -2235,7 +2235,7 @@ static int proc_task_fill_cache(struct file *filp, void *dirent, filldir_t filld ...@@ -2235,7 +2235,7 @@ static int proc_task_fill_cache(struct file *filp, void *dirent, filldir_t filld
/* for the /proc/TGID/task/ directories */ /* for the /proc/TGID/task/ directories */
static int proc_task_readdir(struct file * filp, void * dirent, filldir_t filldir) static int proc_task_readdir(struct file * filp, void * dirent, filldir_t filldir)
{ {
struct dentry *dentry = filp->f_dentry; struct dentry *dentry = filp->f_path.dentry;
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
struct task_struct *leader = get_proc_task(inode); struct task_struct *leader = get_proc_task(inode);
struct task_struct *task; struct task_struct *task;
......
...@@ -52,7 +52,7 @@ static ssize_t ...@@ -52,7 +52,7 @@ static ssize_t
proc_file_read(struct file *file, char __user *buf, size_t nbytes, proc_file_read(struct file *file, char __user *buf, size_t nbytes,
loff_t *ppos) loff_t *ppos)
{ {
struct inode * inode = file->f_dentry->d_inode; struct inode * inode = file->f_path.dentry->d_inode;
char *page; char *page;
ssize_t retval=0; ssize_t retval=0;
int eof=0; int eof=0;
...@@ -203,7 +203,7 @@ static ssize_t ...@@ -203,7 +203,7 @@ static ssize_t
proc_file_write(struct file *file, const char __user *buffer, proc_file_write(struct file *file, const char __user *buffer,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct inode *inode = file->f_dentry->d_inode; struct inode *inode = file->f_path.dentry->d_inode;
struct proc_dir_entry * dp; struct proc_dir_entry * dp;
dp = PDE(inode); dp = PDE(inode);
...@@ -432,7 +432,7 @@ int proc_readdir(struct file * filp, ...@@ -432,7 +432,7 @@ int proc_readdir(struct file * filp,
struct proc_dir_entry * de; struct proc_dir_entry * de;
unsigned int ino; unsigned int ino;
int i; int i;
struct inode *inode = filp->f_dentry->d_inode; struct inode *inode = filp->f_path.dentry->d_inode;
int ret = 0; int ret = 0;
lock_kernel(); lock_kernel();
...@@ -453,7 +453,7 @@ int proc_readdir(struct file * filp, ...@@ -453,7 +453,7 @@ int proc_readdir(struct file * filp,
/* fall through */ /* fall through */
case 1: case 1:
if (filldir(dirent, "..", 2, i, if (filldir(dirent, "..", 2, i,
parent_ino(filp->f_dentry), parent_ino(filp->f_path.dentry),
DT_DIR) < 0) DT_DIR) < 0)
goto out; goto out;
i++; i++;
...@@ -558,7 +558,7 @@ static void proc_kill_inodes(struct proc_dir_entry *de) ...@@ -558,7 +558,7 @@ static void proc_kill_inodes(struct proc_dir_entry *de)
file_list_lock(); file_list_lock();
list_for_each(p, &sb->s_files) { list_for_each(p, &sb->s_files) {
struct file * filp = list_entry(p, struct file, f_u.fu_list); struct file * filp = list_entry(p, struct file, f_u.fu_list);
struct dentry * dentry = filp->f_dentry; struct dentry * dentry = filp->f_path.dentry;
struct inode * inode; struct inode * inode;
const struct file_operations *fops; const struct file_operations *fops;
......
...@@ -46,7 +46,7 @@ int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma) ...@@ -46,7 +46,7 @@ int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma)
file = vma->vm_file; file = vma->vm_file;
if (file) { if (file) {
struct inode *inode = vma->vm_file->f_dentry->d_inode; struct inode *inode = vma->vm_file->f_path.dentry->d_inode;
dev = inode->i_sb->s_dev; dev = inode->i_sb->s_dev;
ino = inode->i_ino; ino = inode->i_ino;
} }
...@@ -67,7 +67,7 @@ int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma) ...@@ -67,7 +67,7 @@ int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma)
if (len < 1) if (len < 1)
len = 1; len = 1;
seq_printf(m, "%*c", len, ' '); seq_printf(m, "%*c", len, ' ');
seq_path(m, file->f_vfsmnt, file->f_dentry, ""); seq_path(m, file->f_path.mnt, file->f_path.dentry, "");
} }
seq_putc(m, '\n'); seq_putc(m, '\n');
......
...@@ -94,8 +94,8 @@ int proc_exe_link(struct inode *inode, struct dentry **dentry, struct vfsmount * ...@@ -94,8 +94,8 @@ int proc_exe_link(struct inode *inode, struct dentry **dentry, struct vfsmount *
} }
if (vma) { if (vma) {
*mnt = mntget(vma->vm_file->f_vfsmnt); *mnt = mntget(vma->vm_file->f_path.mnt);
*dentry = dget(vma->vm_file->f_dentry); *dentry = dget(vma->vm_file->f_path.dentry);
result = 0; result = 0;
} }
...@@ -135,7 +135,7 @@ static int show_map_internal(struct seq_file *m, void *v, struct mem_size_stats ...@@ -135,7 +135,7 @@ static int show_map_internal(struct seq_file *m, void *v, struct mem_size_stats
int len; int len;
if (file) { if (file) {
struct inode *inode = vma->vm_file->f_dentry->d_inode; struct inode *inode = vma->vm_file->f_path.dentry->d_inode;
dev = inode->i_sb->s_dev; dev = inode->i_sb->s_dev;
ino = inode->i_ino; ino = inode->i_ino;
} }
...@@ -156,7 +156,7 @@ static int show_map_internal(struct seq_file *m, void *v, struct mem_size_stats ...@@ -156,7 +156,7 @@ static int show_map_internal(struct seq_file *m, void *v, struct mem_size_stats
*/ */
if (file) { if (file) {
pad_len_spaces(m, len); pad_len_spaces(m, len);
seq_path(m, file->f_vfsmnt, file->f_dentry, "\n"); seq_path(m, file->f_path.mnt, file->f_path.dentry, "\n");
} else { } else {
const char *name = arch_vma_name(vma); const char *name = arch_vma_name(vma);
if (!name) { if (!name) {
......
...@@ -126,8 +126,8 @@ int proc_exe_link(struct inode *inode, struct dentry **dentry, struct vfsmount * ...@@ -126,8 +126,8 @@ int proc_exe_link(struct inode *inode, struct dentry **dentry, struct vfsmount *
} }
if (vma) { if (vma) {
*mnt = mntget(vma->vm_file->f_vfsmnt); *mnt = mntget(vma->vm_file->f_path.mnt);
*dentry = dget(vma->vm_file->f_dentry); *dentry = dget(vma->vm_file->f_path.dentry);
result = 0; result = 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment