Skip to content

Commit 2fddfee

Browse files
Josef "Jeff" SipekLinus Torvalds
authored andcommitted
[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: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent f427f5d commit 2fddfee

5 files changed

Lines changed: 31 additions & 31 deletions

File tree

‎fs/proc/base.c‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ static struct file_operations proc_mountstats_operations = {
472472
static ssize_t proc_info_read(struct file * file, char __user * buf,
473473
size_t count, loff_t *ppos)
474474
{
475-
struct inode * inode = file->f_dentry->d_inode;
475+
struct inode * inode = file->f_path.dentry->d_inode;
476476
unsigned long page;
477477
ssize_t length;
478478
struct task_struct *task = get_proc_task(inode);
@@ -512,7 +512,7 @@ static int mem_open(struct inode* inode, struct file* file)
512512
static ssize_t mem_read(struct file * file, char __user * buf,
513513
size_t count, loff_t *ppos)
514514
{
515-
struct task_struct *task = get_proc_task(file->f_dentry->d_inode);
515+
struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode);
516516
char *page;
517517
unsigned long src = *ppos;
518518
int ret = -ESRCH;
@@ -584,7 +584,7 @@ static ssize_t mem_write(struct file * file, const char * buf,
584584
{
585585
int copied;
586586
char *page;
587-
struct task_struct *task = get_proc_task(file->f_dentry->d_inode);
587+
struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode);
588588
unsigned long dst = *ppos;
589589

590590
copied = -ESRCH;
@@ -654,7 +654,7 @@ static struct file_operations proc_mem_operations = {
654654
static ssize_t oom_adjust_read(struct file *file, char __user *buf,
655655
size_t count, loff_t *ppos)
656656
{
657-
struct task_struct *task = get_proc_task(file->f_dentry->d_inode);
657+
struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode);
658658
char buffer[PROC_NUMBUF];
659659
size_t len;
660660
int oom_adjust;
@@ -694,7 +694,7 @@ static ssize_t oom_adjust_write(struct file *file, const char __user *buf,
694694
return -EINVAL;
695695
if (*end == '\n')
696696
end++;
697-
task = get_proc_task(file->f_dentry->d_inode);
697+
task = get_proc_task(file->f_path.dentry->d_inode);
698698
if (!task)
699699
return -ESRCH;
700700
if (oom_adjust < task->oomkilladj && !capable(CAP_SYS_RESOURCE)) {
@@ -718,7 +718,7 @@ static struct file_operations proc_oom_adjust_operations = {
718718
static ssize_t proc_loginuid_read(struct file * file, char __user * buf,
719719
size_t count, loff_t *ppos)
720720
{
721-
struct inode * inode = file->f_dentry->d_inode;
721+
struct inode * inode = file->f_path.dentry->d_inode;
722722
struct task_struct *task = get_proc_task(inode);
723723
ssize_t length;
724724
char tmpbuf[TMPBUFLEN];
@@ -734,7 +734,7 @@ static ssize_t proc_loginuid_read(struct file * file, char __user * buf,
734734
static ssize_t proc_loginuid_write(struct file * file, const char __user * buf,
735735
size_t count, loff_t *ppos)
736736
{
737-
struct inode * inode = file->f_dentry->d_inode;
737+
struct inode * inode = file->f_path.dentry->d_inode;
738738
char *page, *tmp;
739739
ssize_t length;
740740
uid_t loginuid;
@@ -1078,7 +1078,7 @@ static int proc_fill_cache(struct file *filp, void *dirent, filldir_t filldir,
10781078
char *name, int len,
10791079
instantiate_t instantiate, struct task_struct *task, void *ptr)
10801080
{
1081-
struct dentry *child, *dir = filp->f_dentry;
1081+
struct dentry *child, *dir = filp->f_path.dentry;
10821082
struct inode *inode;
10831083
struct qstr qname;
10841084
ino_t ino = 0;
@@ -1157,8 +1157,8 @@ static int proc_fd_link(struct inode *inode, struct dentry **dentry, struct vfsm
11571157
spin_lock(&files->file_lock);
11581158
file = fcheck_files(files, fd);
11591159
if (file) {
1160-
*mnt = mntget(file->f_vfsmnt);
1161-
*dentry = dget(file->f_dentry);
1160+
*mnt = mntget(file->f_path.mnt);
1161+
*dentry = dget(file->f_path.dentry);
11621162
spin_unlock(&files->file_lock);
11631163
put_files_struct(files);
11641164
return 0;
@@ -1293,7 +1293,7 @@ static int proc_fd_fill_cache(struct file *filp, void *dirent, filldir_t filldir
12931293

12941294
static int proc_readfd(struct file * filp, void * dirent, filldir_t filldir)
12951295
{
1296-
struct dentry *dentry = filp->f_dentry;
1296+
struct dentry *dentry = filp->f_path.dentry;
12971297
struct inode *inode = dentry->d_inode;
12981298
struct task_struct *p = get_proc_task(inode);
12991299
unsigned int fd, tid, ino;
@@ -1440,7 +1440,7 @@ static int proc_pident_readdir(struct file *filp,
14401440
{
14411441
int i;
14421442
int pid;
1443-
struct dentry *dentry = filp->f_dentry;
1443+
struct dentry *dentry = filp->f_path.dentry;
14441444
struct inode *inode = dentry->d_inode;
14451445
struct task_struct *task = get_proc_task(inode);
14461446
struct pid_entry *p, *last;
@@ -1496,7 +1496,7 @@ static int proc_pident_readdir(struct file *filp,
14961496
static ssize_t proc_pid_attr_read(struct file * file, char __user * buf,
14971497
size_t count, loff_t *ppos)
14981498
{
1499-
struct inode * inode = file->f_dentry->d_inode;
1499+
struct inode * inode = file->f_path.dentry->d_inode;
15001500
unsigned long page;
15011501
ssize_t length;
15021502
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,
15121512
goto out;
15131513

15141514
length = security_getprocattr(task,
1515-
(char*)file->f_dentry->d_name.name,
1515+
(char*)file->f_path.dentry->d_name.name,
15161516
(void*)page, count);
15171517
if (length >= 0)
15181518
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,
15261526
static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf,
15271527
size_t count, loff_t *ppos)
15281528
{
1529-
struct inode * inode = file->f_dentry->d_inode;
1529+
struct inode * inode = file->f_path.dentry->d_inode;
15301530
char *page;
15311531
ssize_t length;
15321532
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,
15521552
goto out_free;
15531553

15541554
length = security_setprocattr(task,
1555-
(char*)file->f_dentry->d_name.name,
1555+
(char*)file->f_path.dentry->d_name.name,
15561556
(void*)page, count);
15571557
out_free:
15581558
free_page((unsigned long) page);
@@ -1994,7 +1994,7 @@ static int proc_pid_fill_cache(struct file *filp, void *dirent, filldir_t filldi
19941994
int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
19951995
{
19961996
unsigned int nr = filp->f_pos - FIRST_PROCESS_ENTRY;
1997-
struct task_struct *reaper = get_proc_task(filp->f_dentry->d_inode);
1997+
struct task_struct *reaper = get_proc_task(filp->f_path.dentry->d_inode);
19981998
struct task_struct *task;
19991999
int tgid;
20002000

@@ -2235,7 +2235,7 @@ static int proc_task_fill_cache(struct file *filp, void *dirent, filldir_t filld
22352235
/* for the /proc/TGID/task/ directories */
22362236
static int proc_task_readdir(struct file * filp, void * dirent, filldir_t filldir)
22372237
{
2238-
struct dentry *dentry = filp->f_dentry;
2238+
struct dentry *dentry = filp->f_path.dentry;
22392239
struct inode *inode = dentry->d_inode;
22402240
struct task_struct *leader = get_proc_task(inode);
22412241
struct task_struct *task;

‎fs/proc/generic.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static ssize_t
5252
proc_file_read(struct file *file, char __user *buf, size_t nbytes,
5353
loff_t *ppos)
5454
{
55-
struct inode * inode = file->f_dentry->d_inode;
55+
struct inode * inode = file->f_path.dentry->d_inode;
5656
char *page;
5757
ssize_t retval=0;
5858
int eof=0;
@@ -203,7 +203,7 @@ static ssize_t
203203
proc_file_write(struct file *file, const char __user *buffer,
204204
size_t count, loff_t *ppos)
205205
{
206-
struct inode *inode = file->f_dentry->d_inode;
206+
struct inode *inode = file->f_path.dentry->d_inode;
207207
struct proc_dir_entry * dp;
208208

209209
dp = PDE(inode);
@@ -432,7 +432,7 @@ int proc_readdir(struct file * filp,
432432
struct proc_dir_entry * de;
433433
unsigned int ino;
434434
int i;
435-
struct inode *inode = filp->f_dentry->d_inode;
435+
struct inode *inode = filp->f_path.dentry->d_inode;
436436
int ret = 0;
437437

438438
lock_kernel();
@@ -453,7 +453,7 @@ int proc_readdir(struct file * filp,
453453
/* fall through */
454454
case 1:
455455
if (filldir(dirent, "..", 2, i,
456-
parent_ino(filp->f_dentry),
456+
parent_ino(filp->f_path.dentry),
457457
DT_DIR) < 0)
458458
goto out;
459459
i++;
@@ -558,7 +558,7 @@ static void proc_kill_inodes(struct proc_dir_entry *de)
558558
file_list_lock();
559559
list_for_each(p, &sb->s_files) {
560560
struct file * filp = list_entry(p, struct file, f_u.fu_list);
561-
struct dentry * dentry = filp->f_dentry;
561+
struct dentry * dentry = filp->f_path.dentry;
562562
struct inode * inode;
563563
const struct file_operations *fops;
564564

‎fs/proc/nommu.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma)
4646
file = vma->vm_file;
4747

4848
if (file) {
49-
struct inode *inode = vma->vm_file->f_dentry->d_inode;
49+
struct inode *inode = vma->vm_file->f_path.dentry->d_inode;
5050
dev = inode->i_sb->s_dev;
5151
ino = inode->i_ino;
5252
}
@@ -67,7 +67,7 @@ int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma)
6767
if (len < 1)
6868
len = 1;
6969
seq_printf(m, "%*c", len, ' ');
70-
seq_path(m, file->f_vfsmnt, file->f_dentry, "");
70+
seq_path(m, file->f_path.mnt, file->f_path.dentry, "");
7171
}
7272

7373
seq_putc(m, '\n');

‎fs/proc/task_mmu.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ int proc_exe_link(struct inode *inode, struct dentry **dentry, struct vfsmount *
9494
}
9595

9696
if (vma) {
97-
*mnt = mntget(vma->vm_file->f_vfsmnt);
98-
*dentry = dget(vma->vm_file->f_dentry);
97+
*mnt = mntget(vma->vm_file->f_path.mnt);
98+
*dentry = dget(vma->vm_file->f_path.dentry);
9999
result = 0;
100100
}
101101

@@ -135,7 +135,7 @@ static int show_map_internal(struct seq_file *m, void *v, struct mem_size_stats
135135
int len;
136136

137137
if (file) {
138-
struct inode *inode = vma->vm_file->f_dentry->d_inode;
138+
struct inode *inode = vma->vm_file->f_path.dentry->d_inode;
139139
dev = inode->i_sb->s_dev;
140140
ino = inode->i_ino;
141141
}
@@ -156,7 +156,7 @@ static int show_map_internal(struct seq_file *m, void *v, struct mem_size_stats
156156
*/
157157
if (file) {
158158
pad_len_spaces(m, len);
159-
seq_path(m, file->f_vfsmnt, file->f_dentry, "\n");
159+
seq_path(m, file->f_path.mnt, file->f_path.dentry, "\n");
160160
} else {
161161
const char *name = arch_vma_name(vma);
162162
if (!name) {

‎fs/proc/task_nommu.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ int proc_exe_link(struct inode *inode, struct dentry **dentry, struct vfsmount *
126126
}
127127

128128
if (vma) {
129-
*mnt = mntget(vma->vm_file->f_vfsmnt);
130-
*dentry = dget(vma->vm_file->f_dentry);
129+
*mnt = mntget(vma->vm_file->f_path.mnt);
130+
*dentry = dget(vma->vm_file->f_path.dentry);
131131
result = 0;
132132
}
133133

0 commit comments

Comments
 (0)