[PATCH] mm: 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/mm/.

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>
This commit is contained in:
Josef "Jeff" Sipek 2006-12-08 02:36:44 -08:00 committed by Linus Torvalds
parent f3a43f3f64
commit d3ac7f892b
6 changed files with 20 additions and 20 deletions

View File

@ -38,7 +38,7 @@ asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice)
if (!file) if (!file)
return -EBADF; return -EBADF;
if (S_ISFIFO(file->f_dentry->d_inode->i_mode)) { if (S_ISFIFO(file->f_path.dentry->d_inode->i_mode)) {
ret = -ESPIPE; ret = -ESPIPE;
goto out; goto out;
} }

View File

@ -2269,7 +2269,7 @@ __generic_file_aio_write_nolock(struct kiocb *iocb, const struct iovec *iov,
if (count == 0) if (count == 0)
goto out; goto out;
err = remove_suid(file->f_dentry); err = remove_suid(file->f_path.dentry);
if (err) if (err)
goto out; goto out;

View File

@ -379,7 +379,7 @@ xip_file_write(struct file *filp, const char __user *buf, size_t len,
if (count == 0) if (count == 0)
goto out_backing; goto out_backing;
ret = remove_suid(filp->f_dentry); ret = remove_suid(filp->f_path.dentry);
if (ret) if (ret)
goto out_backing; goto out_backing;

View File

@ -188,7 +188,7 @@ static void __remove_shared_vm_struct(struct vm_area_struct *vma,
struct file *file, struct address_space *mapping) struct file *file, struct address_space *mapping)
{ {
if (vma->vm_flags & VM_DENYWRITE) if (vma->vm_flags & VM_DENYWRITE)
atomic_inc(&file->f_dentry->d_inode->i_writecount); atomic_inc(&file->f_path.dentry->d_inode->i_writecount);
if (vma->vm_flags & VM_SHARED) if (vma->vm_flags & VM_SHARED)
mapping->i_mmap_writable--; mapping->i_mmap_writable--;
@ -399,7 +399,7 @@ static inline void __vma_link_file(struct vm_area_struct *vma)
struct address_space *mapping = file->f_mapping; struct address_space *mapping = file->f_mapping;
if (vma->vm_flags & VM_DENYWRITE) if (vma->vm_flags & VM_DENYWRITE)
atomic_dec(&file->f_dentry->d_inode->i_writecount); atomic_dec(&file->f_path.dentry->d_inode->i_writecount);
if (vma->vm_flags & VM_SHARED) if (vma->vm_flags & VM_SHARED)
mapping->i_mmap_writable++; mapping->i_mmap_writable++;
@ -907,7 +907,7 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr,
* mounted, in which case we dont add PROT_EXEC.) * mounted, in which case we dont add PROT_EXEC.)
*/ */
if ((prot & PROT_READ) && (current->personality & READ_IMPLIES_EXEC)) if ((prot & PROT_READ) && (current->personality & READ_IMPLIES_EXEC))
if (!(file && (file->f_vfsmnt->mnt_flags & MNT_NOEXEC))) if (!(file && (file->f_path.mnt->mnt_flags & MNT_NOEXEC)))
prot |= PROT_EXEC; prot |= PROT_EXEC;
if (!len) if (!len)
@ -960,7 +960,7 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr,
return -EAGAIN; return -EAGAIN;
} }
inode = file ? file->f_dentry->d_inode : NULL; inode = file ? file->f_path.dentry->d_inode : NULL;
if (file) { if (file) {
switch (flags & MAP_TYPE) { switch (flags & MAP_TYPE) {
@ -989,7 +989,7 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr,
case MAP_PRIVATE: case MAP_PRIVATE:
if (!(file->f_mode & FMODE_READ)) if (!(file->f_mode & FMODE_READ))
return -EACCES; return -EACCES;
if (file->f_vfsmnt->mnt_flags & MNT_NOEXEC) { if (file->f_path.mnt->mnt_flags & MNT_NOEXEC) {
if (vm_flags & VM_EXEC) if (vm_flags & VM_EXEC)
return -EPERM; return -EPERM;
vm_flags &= ~VM_MAYEXEC; vm_flags &= ~VM_MAYEXEC;

View File

@ -1225,7 +1225,7 @@ failed:
struct page *shmem_nopage(struct vm_area_struct *vma, unsigned long address, int *type) struct page *shmem_nopage(struct vm_area_struct *vma, unsigned long address, int *type)
{ {
struct inode *inode = vma->vm_file->f_dentry->d_inode; struct inode *inode = vma->vm_file->f_path.dentry->d_inode;
struct page *page = NULL; struct page *page = NULL;
unsigned long idx; unsigned long idx;
int error; int error;
@ -1248,7 +1248,7 @@ static int shmem_populate(struct vm_area_struct *vma,
unsigned long addr, unsigned long len, unsigned long addr, unsigned long len,
pgprot_t prot, unsigned long pgoff, int nonblock) pgprot_t prot, unsigned long pgoff, int nonblock)
{ {
struct inode *inode = vma->vm_file->f_dentry->d_inode; struct inode *inode = vma->vm_file->f_path.dentry->d_inode;
struct mm_struct *mm = vma->vm_mm; struct mm_struct *mm = vma->vm_mm;
enum sgp_type sgp = nonblock? SGP_QUICK: SGP_CACHE; enum sgp_type sgp = nonblock? SGP_QUICK: SGP_CACHE;
unsigned long size; unsigned long size;
@ -1293,14 +1293,14 @@ static int shmem_populate(struct vm_area_struct *vma,
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
int shmem_set_policy(struct vm_area_struct *vma, struct mempolicy *new) int shmem_set_policy(struct vm_area_struct *vma, struct mempolicy *new)
{ {
struct inode *i = vma->vm_file->f_dentry->d_inode; struct inode *i = vma->vm_file->f_path.dentry->d_inode;
return mpol_set_shared_policy(&SHMEM_I(i)->policy, vma, new); return mpol_set_shared_policy(&SHMEM_I(i)->policy, vma, new);
} }
struct mempolicy * struct mempolicy *
shmem_get_policy(struct vm_area_struct *vma, unsigned long addr) shmem_get_policy(struct vm_area_struct *vma, unsigned long addr)
{ {
struct inode *i = vma->vm_file->f_dentry->d_inode; struct inode *i = vma->vm_file->f_path.dentry->d_inode;
unsigned long idx; unsigned long idx;
idx = ((addr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff; idx = ((addr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
@ -1310,7 +1310,7 @@ shmem_get_policy(struct vm_area_struct *vma, unsigned long addr)
int shmem_lock(struct file *file, int lock, struct user_struct *user) int shmem_lock(struct file *file, int lock, struct user_struct *user)
{ {
struct inode *inode = file->f_dentry->d_inode; struct inode *inode = file->f_path.dentry->d_inode;
struct shmem_inode_info *info = SHMEM_I(inode); struct shmem_inode_info *info = SHMEM_I(inode);
int retval = -ENOMEM; int retval = -ENOMEM;
@ -1422,7 +1422,7 @@ shmem_prepare_write(struct file *file, struct page *page, unsigned offset, unsig
static ssize_t static ssize_t
shmem_file_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) shmem_file_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{ {
struct inode *inode = file->f_dentry->d_inode; struct inode *inode = file->f_path.dentry->d_inode;
loff_t pos; loff_t pos;
unsigned long written; unsigned long written;
ssize_t err; ssize_t err;
@ -1442,7 +1442,7 @@ shmem_file_write(struct file *file, const char __user *buf, size_t count, loff_t
if (err || !count) if (err || !count)
goto out; goto out;
err = remove_suid(file->f_dentry); err = remove_suid(file->f_path.dentry);
if (err) if (err)
goto out; goto out;
@ -1524,7 +1524,7 @@ out:
static void do_shmem_file_read(struct file *filp, loff_t *ppos, read_descriptor_t *desc, read_actor_t actor) static void do_shmem_file_read(struct file *filp, loff_t *ppos, read_descriptor_t *desc, read_actor_t actor)
{ {
struct inode *inode = filp->f_dentry->d_inode; struct inode *inode = filp->f_path.dentry->d_inode;
struct address_space *mapping = inode->i_mapping; struct address_space *mapping = inode->i_mapping;
unsigned long index, offset; unsigned long index, offset;
@ -2493,8 +2493,8 @@ struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags)
d_instantiate(dentry, inode); d_instantiate(dentry, inode);
inode->i_size = size; inode->i_size = size;
inode->i_nlink = 0; /* It is unlinked */ inode->i_nlink = 0; /* It is unlinked */
file->f_vfsmnt = mntget(shm_mnt); file->f_path.mnt = mntget(shm_mnt);
file->f_dentry = dentry; file->f_path.dentry = dentry;
file->f_mapping = inode->i_mapping; file->f_mapping = inode->i_mapping;
file->f_op = &shmem_file_operations; file->f_op = &shmem_file_operations;
file->f_mode = FMODE_WRITE | FMODE_READ; file->f_mode = FMODE_WRITE | FMODE_READ;

View File

@ -1357,10 +1357,10 @@ static int swap_show(struct seq_file *swap, void *v)
} }
file = ptr->swap_file; file = ptr->swap_file;
len = seq_path(swap, file->f_vfsmnt, file->f_dentry, " \t\n\\"); len = seq_path(swap, file->f_path.mnt, file->f_path.dentry, " \t\n\\");
seq_printf(swap, "%*s%s\t%u\t%u\t%d\n", seq_printf(swap, "%*s%s\t%u\t%u\t%d\n",
len < 40 ? 40 - len : 1, " ", len < 40 ? 40 - len : 1, " ",
S_ISBLK(file->f_dentry->d_inode->i_mode) ? S_ISBLK(file->f_path.dentry->d_inode->i_mode) ?
"partition" : "file\t", "partition" : "file\t",
ptr->pages << (PAGE_SHIFT - 10), ptr->pages << (PAGE_SHIFT - 10),
ptr->inuse_pages << (PAGE_SHIFT - 10), ptr->inuse_pages << (PAGE_SHIFT - 10),