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

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

Change all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in
linux/kernel/.
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 c941192a
...@@ -118,7 +118,7 @@ static int check_free_space(struct file *file) ...@@ -118,7 +118,7 @@ static int check_free_space(struct file *file)
spin_unlock(&acct_globals.lock); spin_unlock(&acct_globals.lock);
/* May block */ /* May block */
if (vfs_statfs(file->f_dentry, &sbuf)) if (vfs_statfs(file->f_path.dentry, &sbuf))
return res; return res;
suspend = sbuf.f_blocks * SUSPEND; suspend = sbuf.f_blocks * SUSPEND;
resume = sbuf.f_blocks * RESUME; resume = sbuf.f_blocks * RESUME;
...@@ -194,7 +194,7 @@ static void acct_file_reopen(struct file *file) ...@@ -194,7 +194,7 @@ static void acct_file_reopen(struct file *file)
add_timer(&acct_globals.timer); add_timer(&acct_globals.timer);
} }
if (old_acct) { if (old_acct) {
mnt_unpin(old_acct->f_vfsmnt); mnt_unpin(old_acct->f_path.mnt);
spin_unlock(&acct_globals.lock); spin_unlock(&acct_globals.lock);
do_acct_process(old_acct); do_acct_process(old_acct);
filp_close(old_acct, NULL); filp_close(old_acct, NULL);
...@@ -212,7 +212,7 @@ static int acct_on(char *name) ...@@ -212,7 +212,7 @@ static int acct_on(char *name)
if (IS_ERR(file)) if (IS_ERR(file))
return PTR_ERR(file); return PTR_ERR(file);
if (!S_ISREG(file->f_dentry->d_inode->i_mode)) { if (!S_ISREG(file->f_path.dentry->d_inode->i_mode)) {
filp_close(file, NULL); filp_close(file, NULL);
return -EACCES; return -EACCES;
} }
...@@ -229,11 +229,11 @@ static int acct_on(char *name) ...@@ -229,11 +229,11 @@ static int acct_on(char *name)
} }
spin_lock(&acct_globals.lock); spin_lock(&acct_globals.lock);
mnt_pin(file->f_vfsmnt); mnt_pin(file->f_path.mnt);
acct_file_reopen(file); acct_file_reopen(file);
spin_unlock(&acct_globals.lock); spin_unlock(&acct_globals.lock);
mntput(file->f_vfsmnt); /* it's pinned, now give up active reference */ mntput(file->f_path.mnt); /* it's pinned, now give up active reference */
return 0; return 0;
} }
...@@ -283,7 +283,7 @@ asmlinkage long sys_acct(const char __user *name) ...@@ -283,7 +283,7 @@ asmlinkage long sys_acct(const char __user *name)
void acct_auto_close_mnt(struct vfsmount *m) void acct_auto_close_mnt(struct vfsmount *m)
{ {
spin_lock(&acct_globals.lock); spin_lock(&acct_globals.lock);
if (acct_globals.file && acct_globals.file->f_vfsmnt == m) if (acct_globals.file && acct_globals.file->f_path.mnt == m)
acct_file_reopen(NULL); acct_file_reopen(NULL);
spin_unlock(&acct_globals.lock); spin_unlock(&acct_globals.lock);
} }
...@@ -299,7 +299,7 @@ void acct_auto_close(struct super_block *sb) ...@@ -299,7 +299,7 @@ void acct_auto_close(struct super_block *sb)
{ {
spin_lock(&acct_globals.lock); spin_lock(&acct_globals.lock);
if (acct_globals.file && if (acct_globals.file &&
acct_globals.file->f_vfsmnt->mnt_sb == sb) { acct_globals.file->f_path.mnt->mnt_sb == sb) {
acct_file_reopen(NULL); acct_file_reopen(NULL);
} }
spin_unlock(&acct_globals.lock); spin_unlock(&acct_globals.lock);
......
...@@ -252,7 +252,7 @@ static inline int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) ...@@ -252,7 +252,7 @@ static inline int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
anon_vma_link(tmp); anon_vma_link(tmp);
file = tmp->vm_file; file = tmp->vm_file;
if (file) { if (file) {
struct inode *inode = file->f_dentry->d_inode; struct inode *inode = file->f_path.dentry->d_inode;
get_file(file); get_file(file);
if (tmp->vm_flags & VM_DENYWRITE) if (tmp->vm_flags & VM_DENYWRITE)
atomic_dec(&inode->i_writecount); atomic_dec(&inode->i_writecount);
......
...@@ -166,7 +166,7 @@ static inline int match_futex(union futex_key *key1, union futex_key *key2) ...@@ -166,7 +166,7 @@ static inline int match_futex(union futex_key *key1, union futex_key *key2)
/* /*
* Get parameters which are the keys for a futex. * Get parameters which are the keys for a futex.
* *
* For shared mappings, it's (page->index, vma->vm_file->f_dentry->d_inode, * For shared mappings, it's (page->index, vma->vm_file->f_path.dentry->d_inode,
* offset_within_page). For private mappings, it's (uaddr, current->mm). * offset_within_page). For private mappings, it's (uaddr, current->mm).
* We can usually work out the index without swapping in the page. * We can usually work out the index without swapping in the page.
* *
...@@ -223,7 +223,7 @@ static int get_futex_key(u32 __user *uaddr, union futex_key *key) ...@@ -223,7 +223,7 @@ static int get_futex_key(u32 __user *uaddr, union futex_key *key)
/* /*
* Linear file mappings are also simple. * Linear file mappings are also simple.
*/ */
key->shared.inode = vma->vm_file->f_dentry->d_inode; key->shared.inode = vma->vm_file->f_path.dentry->d_inode;
key->both.offset++; /* Bit 0 of offset indicates inode-based key. */ key->both.offset++; /* Bit 0 of offset indicates inode-based key. */
if (likely(!(vma->vm_flags & VM_NONLINEAR))) { if (likely(!(vma->vm_flags & VM_NONLINEAR))) {
key->shared.pgoff = (((address - vma->vm_start) >> PAGE_SHIFT) key->shared.pgoff = (((address - vma->vm_start) >> PAGE_SHIFT)
...@@ -1528,9 +1528,9 @@ static int futex_fd(u32 __user *uaddr, int signal) ...@@ -1528,9 +1528,9 @@ static int futex_fd(u32 __user *uaddr, int signal)
goto out; goto out;
} }
filp->f_op = &futex_fops; filp->f_op = &futex_fops;
filp->f_vfsmnt = mntget(futex_mnt); filp->f_path.mnt = mntget(futex_mnt);
filp->f_dentry = dget(futex_mnt->mnt_root); filp->f_path.dentry = dget(futex_mnt->mnt_root);
filp->f_mapping = filp->f_dentry->d_inode->i_mapping; filp->f_mapping = filp->f_path.dentry->d_inode->i_mapping;
if (signal) { if (signal) {
err = __f_setown(filp, task_pid(current), PIDTYPE_PID, 1); err = __f_setown(filp, task_pid(current), PIDTYPE_PID, 1);
......
...@@ -959,7 +959,7 @@ static inline ssize_t relay_file_read_subbufs(struct file *filp, ...@@ -959,7 +959,7 @@ static inline ssize_t relay_file_read_subbufs(struct file *filp,
if (!desc->count) if (!desc->count)
return 0; return 0;
mutex_lock(&filp->f_dentry->d_inode->i_mutex); mutex_lock(&filp->f_path.dentry->d_inode->i_mutex);
do { do {
if (!relay_file_read_avail(buf, *ppos)) if (!relay_file_read_avail(buf, *ppos))
break; break;
...@@ -979,7 +979,7 @@ static inline ssize_t relay_file_read_subbufs(struct file *filp, ...@@ -979,7 +979,7 @@ static inline ssize_t relay_file_read_subbufs(struct file *filp,
*ppos = relay_file_read_end_pos(buf, read_start, ret); *ppos = relay_file_read_end_pos(buf, read_start, ret);
} }
} while (desc->count && ret); } while (desc->count && ret);
mutex_unlock(&filp->f_dentry->d_inode->i_mutex); mutex_unlock(&filp->f_path.dentry->d_inode->i_mutex);
return desc->written; return desc->written;
} }
......
...@@ -1614,7 +1614,7 @@ static ssize_t do_rw_proc(int write, struct file * file, char __user * buf, ...@@ -1614,7 +1614,7 @@ static ssize_t do_rw_proc(int write, struct file * file, char __user * buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
int op; int op;
struct proc_dir_entry *de = PDE(file->f_dentry->d_inode); struct proc_dir_entry *de = PDE(file->f_path.dentry->d_inode);
struct ctl_table *table; struct ctl_table *table;
size_t res; size_t res;
ssize_t error = -ENOTDIR; ssize_t error = -ENOTDIR;
......
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