struct file: Use struct path
Subsystems (30)
PATCH 1/1 struct file: Use struct path
The struct file changes in the following patches were suggested by Al Viro during the discussion of struct path almost a week ago.
The first patch changes struct file to use struct path instead of just having struct dentry and struct vfsmount pointers.
The remaining patches change several filesystem, the kernel/ and mm/ directories, as well as the i386 and x86_64 arch code.
These patches depend on the struct path patches from October 18th already in -mm.
102 files changed, 463 insertions(+), 461 deletions(-)
PATCH 1/1 VFS: change struct file to use struct path
From: Josef "Jeff" Sipek <[email protected]>
This patch changes struct file to use struct path instead of having independent pointers to struct dentry and struct vfsmount, and converts all users of f_{dentry,vfsmnt} in fs/ to use f_path.{dentry,mnt}.
Additionally, it adds two #define's to make the transition easier for users of the f_dentry and f_vfsmnt.
---
32 files changed, 140 insertions(+), 138 deletions(-) fs/binfmt_aout.c | 8 ++++---- fs/binfmt_elf.c | 2 +- fs/binfmt_elf_fdpic.c | 4 ++-- fs/binfmt_flat.c | 2 +- fs/binfmt_misc.c | 10 +++++----- fs/block_dev.c | 8 ++++---- fs/compat.c | 12 ++++++------ fs/compat_ioctl.c | 2 +- fs/dnotify.c | 4 ++-- fs/dquot.c | 4 ++-- fs/eventpoll.c | 4 ++-- fs/exec.c | 10 +++++----- fs/fcntl.c | 2 +- fs/file_table.c | 10 +++++----- fs/inode.c | 2 +- fs/inotify_user.c | 6 +++--- fs/ioctl.c | 14 +++++++------- fs/libfs.c | 14 +++++++------- fs/locks.c | 32 ++++++++++++++++---------------- fs/namei.c | 10 +++++----- fs/open.c | 26 +++++++++++++------------- fs/pipe.c | 28 ++++++++++++++-------------- fs/read_write.c | 20 ++++++++++---------- fs/readdir.c | 2 +- fs/seq_file.c | 2 +- fs/splice.c | 12 ++++++------ fs/stat.c | 2 +- fs/super.c | 2 +- fs/sync.c | 4 ++-- fs/xattr.c | 8 ++++---- include/linux/fs.h | 10 ++++++---- include/linux/fsnotify.h | 2 +-
fs/binfmt_aout.c +4 -4
@@ -274,7 +274,7 @@ static int load_aout_binary(struct linuxif ((N_MAGIC (ex) !=ZMAGIC &&N_MAGIC (ex) !=OMAGIC &&N_MAGIC (ex) !=QMAGIC &&N_MAGIC (ex) !=NMAGIC ) ||N_TRSIZE (ex) ||N_DRSIZE (ex) || -i_size_read (bprm->file->f_dentry->d_inode) < ex.a_text+ex.a_data+N_SYMSIZE (ex)+N_TXTOFF (ex)) { +i_size_read (bprm->file->f_path.dentry->d_inode) < ex.a_text+ex.a_data+N_SYMSIZE (ex)+N_TXTOFF (ex)) {return -ENOEXEC ; }
@@ -389,7 +389,7 @@ static int load_aout_binary(struct linux {printk (KERN_WARNING "fd_offset is not page aligned. Please convert program: %s\n" , - bprm->file->f_dentry->d_name.name); + bprm->file->f_path.dentry->d_name.name); error_time = jiffies; }
@@ -469,7 +469,7 @@ static int load_aout_library(struct fileint retval;struct exec ex; - inode = file->f_dentry->d_inode; + inode = file->f_path.dentry->d_inode; retval = -ENOEXEC ; error =kernel_read (file,0 , (char *) &ex,sizeof (ex));
@@ -506,7 +506,7 @@ static int load_aout_library(struct file {printk (KERN_WARNING "N_TXTOFF is not page aligned. Please convert library: %s\n" , - file->f_dentry->d_name.name); + file->f_path.dentry->d_name.name); error_time = jiffies; }down_write (¤t->mm->mmap_sem);
fs/binfmt_elf.c +1 -1
@@ -1186,7 +1186,7 @@ static int maydump(struct vm_area_struct/* Dump shared memory only if mapped from an anonymous file. */ if (vma->vm_flags &VM_SHARED ) -return vma->vm_file->f_dentry->d_inode->i_nlink ==0 ; +return vma->vm_file->f_path.dentry->d_inode->i_nlink ==0 ;/* If it hasn't been written to, don't write it out */ if (!vma->anon_vma)
fs/binfmt_elf_fdpic.c +2 -2
@@ -858,7 +858,7 @@ static int elf_fdpic_map_file(struct elf dynamic_error:printk ("ELF FDPIC %s with invalid DYNAMIC section (inode=%lu)\n" , - what, file->f_dentry->d_inode->i_ino); + what, file->f_path.dentry->d_inode->i_ino);return -ELIBBAD ; }
@@ -1189,7 +1189,7 @@ static int maydump(struct vm_area_struct/* Dump shared memory only if mapped from an anonymous file. */ if (vma->vm_flags &VM_SHARED ) { -if (vma->vm_file->f_dentry->d_inode->i_nlink ==0 ) { +if (vma->vm_file->f_path.dentry->d_inode->i_nlink ==0 ) {kdcore ("%08lx: %08lx: no (share)" , vma->vm_start, vma->vm_flags);return 1 ; }
fs/binfmt_flat.c +1 -1
@@ -429,7 +429,7 @@ static int load_flat_file(struct linux_bint ret; hdr = ((struct flat_hdr *) bprm->buf);/* exec-header */ - inode = bprm->file->f_dentry->d_inode; + inode = bprm->file->f_path.dentry->d_inode; text_len =ntohl (hdr->data_start); data_len =ntohl (hdr->data_end) -ntohl (hdr->data_start);
fs/binfmt_misc.c +5 -5
@@ -542,7 +542,7 @@ static ssize_tstatic ssize_t bm_entry_read (struct file * file,char __user * buf,size_t nbytes,loff_t *ppos) { -Node *e = file->f_dentry->d_inode->i_private; +Node *e = file->f_path.dentry->d_inode->i_private;loff_t pos = *ppos;ssize_t res;char *page;
@@ -576,7 +576,7 @@ static ssize_t bm_entry_write(struct fil size_t count, loff_t *ppos) { struct dentry *root; -Node *e = file->f_dentry->d_inode->i_private; +Node *e = file->f_path.dentry->d_inode->i_private;int res =parse_command (buffer, count);switch (res) {
@@ -584,7 +584,7 @@ static ssize_t bm_entry_write(struct filbreak ;case 2 :set_bit (Enabled, &e->flags);break ; -case 3 : root =dget (file->f_vfsmnt->mnt_sb->s_root); +case 3 : root =dget (file->f_path.mnt->mnt_sb->s_root);mutex_lock (&root->d_inode->i_mutex);kill_node (e);
@@ -610,7 +610,7 @@ static ssize_t bm_register_write(structNode *e;struct inode *inode;struct dentry *root, *dentry; -struct super_block *sb = file->f_vfsmnt->mnt_sb; +struct super_block *sb = file->f_path.mnt->mnt_sb;int err =0 ; e =create_entry (buffer, count);
@@ -699,7 +699,7 @@ static ssize_t bm_status_write(struct fiswitch (res) {case 1 : enabled =0 ;break ;case 2 : enabled =1 ;break ; -case 3 : root =dget (file->f_vfsmnt->mnt_sb->s_root); +case 3 : root =dget (file->f_path.mnt->mnt_sb->s_root);mutex_lock (&root->d_inode->i_mutex);while (!list_empty (&entries))
fs/block_dev.c +4 -4
@@ -190,7 +190,7 @@ static int blkdev_commit_write(struct fi/* * private llseek: -* for a block special file file->f_dentry->d_inode->i_size is zero +* for a block special file file->f_path.dentry->d_inode->i_size is zero * so we compute the size by hand (just as in block_read/write above) */ static loff_t block_llseek (struct file *file,loff_t offset,int origin)
@@ -1071,7 +1071,7 @@ int blkdev_get(struct block_device *bdevstruct dentry fake_dentry = {}; fake_file.f_mode = mode; fake_file.f_flags = flags; - fake_file.f_dentry = &fake_dentry; + fake_file.f_path.dentry = &fake_dentry; fake_dentry.d_inode = bdev->bd_inode;return do_open (bdev, &fake_file,BD_MUTEX_NORMAL );
@@ -1092,7 +1092,7 @@ blkdev_get_whole(struct block_device *bdstruct dentry fake_dentry = {}; fake_file.f_mode = mode; fake_file.f_flags = flags; - fake_file.f_dentry = &fake_dentry; + fake_file.f_path.dentry = &fake_dentry; fake_dentry.d_inode = bdev->bd_inode;return do_open (bdev, &fake_file,BD_MUTEX_WHOLE );
@@ -1111,7 +1111,7 @@ blkdev_get_partition(struct block_devicestruct dentry fake_dentry = {}; fake_file.f_mode = mode; fake_file.f_flags = flags; - fake_file.f_dentry = &fake_dentry; + fake_file.f_path.dentry = &fake_dentry; fake_dentry.d_inode = bdev->bd_inode;return do_open (bdev, &fake_file,BD_MUTEX_PARTITION );
fs/compat.c +6 -6
@@ -230,7 +230,7 @@ asmlinkage long compat_sys_fstatfs(unsig file =fget (fd);if (!file) goto out; - error =vfs_statfs (file->f_dentry, &tmp); + error =vfs_statfs (file->f_path.dentry, &tmp);if (!error) error =put_compat_statfs (buf, &tmp);fput (file);
@@ -301,7 +301,7 @@ asmlinkage long compat_sys_fstatfs64(uns file =fget (fd);if (!file) goto out; - error =vfs_statfs (file->f_dentry, &tmp); + error =vfs_statfs (file->f_path.dentry, &tmp);if (!error) error =put_compat_statfs64 (buf, &tmp);fput (file);
@@ -363,7 +363,7 @@ static void compat_ioctl_error(struct fi/* find the name of the device. */ path = (char *)__get_free_page (GFP_KERNEL );if (path) { - fn =d_path (filp->f_dentry, filp->f_vfsmnt, path,PAGE_SIZE ); + fn =d_path (filp->f_path.dentry, filp->f_path.mnt, path,PAGE_SIZE );if (IS_ERR (fn)) fn ="?" ; }
@@ -414,7 +414,7 @@ asmlinkage long compat_sys_ioctl(unsignecase FIBMAP :case FIGETBSZ :case FIONREAD : -if (S_ISREG (filp->f_dentry->d_inode->i_mode)) +if (S_ISREG (filp->f_path.dentry->d_inode->i_mode))break ;/*FALL THROUGH*/
@@ -436,7 +436,7 @@ asmlinkage long compat_sys_ioctl(unsigne goto found_handler; } -if (S_ISSOCK (filp->f_dentry->d_inode->i_mode) && +if (S_ISSOCK (filp->f_path.dentry->d_inode->i_mode) && cmd >=SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE +15 )) { error =siocdevprivate_ioctl (fd, cmd, arg); }else {
@@ -1255,7 +1255,7 @@ out:if (iov != iovstack)kfree (iov);if ((ret + (type ==READ )) >0 ) { -struct dentry *dentry = file->f_dentry; +struct dentry *dentry = file->f_path.dentry;if (type ==READ )fsnotify_access (dentry);else
fs/compat_ioctl.c +1 -1
@@ -1173,7 +1173,7 @@ static int vt_check(struct file *file)static int vt_check (struct file *file) {struct tty_struct *tty; -struct inode *inode = file->f_dentry->d_inode; +struct inode *inode = file->f_path.dentry->d_inode;if (file->f_op->ioctl != tty_ioctl)return -EINVAL ;
fs/dnotify.c +2 -2
@@ -42,7 +42,7 @@ void dnotify_flush(struct file *filp, flstruct dnotify_struct **prev;struct inode *inode; - inode = filp->f_dentry->d_inode; + inode = filp->f_path.dentry->d_inode;if (!S_ISDIR (inode->i_mode))return ;spin_lock (&inode->i_lock);
@@ -74,7 +74,7 @@ int fcntl_dirnotify(int fd, struct file }if (!dir_notify_enable)return -EINVAL ; - inode = filp->f_dentry->d_inode; + inode = filp->f_path.dentry->d_inode;if (!S_ISDIR (inode->i_mode))return -ENOTDIR ; dn =kmem_cache_alloc (dn_cache,SLAB_KERNEL );
fs/dquot.c +2 -2
@@ -694,9 +694,9 @@ restart:file_list_lock ();list_for_each (p, &sb->s_files) { struct file *filp = list_entry(p, struct file, f_u.fu_list); -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;if (filp->f_mode &FMODE_WRITE &&dqinit_needed (inode, type)) { -struct dentry *dentry =dget (filp->f_dentry); +struct dentry *dentry =dget (filp->f_path.dentry);file_list_unlock (); sb->dq_op->initialize (inode, type);dput (dentry);
fs/eventpoll.c +2 -2
@@ -795,8 +795,8 @@ static int ep_getfd(int *efd, struct ino goto eexit_4; dentry->d_op = &eventpollfs_dentry_operations;d_add (dentry, inode); - file->f_vfsmnt =mntget (eventpoll_mnt); - file->f_dentry = dentry; + file->f_path.mnt =mntget (eventpoll_mnt); + file->f_path.dentry = dentry; file->f_mapping = inode->i_mapping; file->f_pos =0 ;
fs/exec.c +5 -5
@@ -912,7 +912,7 @@ int prepare_binprm(struct linux_binprm *int prepare_binprm (struct linux_binprm *bprm) {int mode; -struct inode * inode = bprm->file->f_dentry->d_inode; +struct inode * inode = bprm->file->f_path.dentry->d_inode;int retval; mode = inode->i_mode;
@@ -922,7 +922,7 @@ int prepare_binprm(struct linux_binprm * bprm->e_uid = current->euid; bprm->e_gid = current->egid; -if (!(bprm->file->f_vfsmnt->mnt_flags &MNT_NOSUID )) { +if (!(bprm->file->f_path.mnt->mnt_flags &MNT_NOSUID )) {/* Set-uid? */ if (mode &S_ISUID ) { current->personality &= ~PER_CLEAR_ON_SETID ;
@@ -1518,10 +1518,10 @@ int do_coredump(long signr, int exit_cod O_CREAT | 2 | O_NOFOLLOW | O_LARGEFILE, 0600);if (IS_ERR (file)) goto fail_unlock; - inode = file->f_dentry->d_inode; + inode = file->f_path.dentry->d_inode;if (inode->i_nlink >1 ) goto close_fail;/* multiple links - don't dump */ -if (!ispipe &&d_unhashed (file->f_dentry)) +if (!ispipe &&d_unhashed (file->f_path.dentry)) goto close_fail;/* AK: actually i see no reason to not allow this for named pipes etc.,
@@ -1532,7 +1532,7 @@ int do_coredump(long signr, int exit_cod goto close_fail;if (!file->f_op->write) goto close_fail; -if (!ispipe &&do_truncate (file->f_dentry,0 ,0 , file) !=0 ) +if (!ispipe &&do_truncate (file->f_path.dentry,0 ,0 , file) !=0 ) goto close_fail; retval = binfmt->core_dump (signr, regs, file);
fs/fcntl.c +1 -1
@@ -204,7 +204,7 @@ asmlinkage long sys_dup(unsigned int filstatic int setfl (int fd,struct file * filp,unsigned long arg) { -struct inode * inode = filp->f_dentry->d_inode; +struct inode * inode = filp->f_path.dentry->d_inode;int error =0 ;/*
fs/file_table.c +5 -5
@@ -152,8 +152,8 @@ EXPORT_SYMBOL(fput);*/ void fastcall __fput(struct file *file) { -struct dentry *dentry = file->f_dentry; -struct vfsmount *mnt = file->f_vfsmnt; +struct dentry *dentry = file->f_path.dentry; +struct vfsmount *mnt = file->f_path.mnt;struct inode *inode = dentry->d_inode;might_sleep ();
@@ -176,8 +176,8 @@ void fastcall __fput(struct file *file)put_write_access (inode);put_pid (file->f_owner.pid);file_kill (file); - file->f_dentry =NULL ; - file->f_vfsmnt =NULL ; + file->f_path.dentry =NULL ; + file->f_path.mnt =NULL ;file_free (file);dput (dentry);mntput (mnt);
@@ -271,7 +271,7 @@ int fs_may_remount_ro(struct super_blockfile_list_lock ();list_for_each (p, &sb->s_files) { struct file *file = list_entry(p, struct file, f_u.fu_list); -struct inode *inode = file->f_dentry->d_inode; +struct inode *inode = file->f_path.dentry->d_inode;/* File with pending delete? */ if (inode->i_nlink ==0 )
fs/inode.c +1 -1
@@ -1200,7 +1200,7 @@ EXPORT_SYMBOL(touch_atime);void file_update_time (struct file *file) { -struct inode *inode = file->f_dentry->d_inode; +struct inode *inode = file->f_path.dentry->d_inode;struct timespec now;int sync_it =0 ;
fs/inotify_user.c +3 -3
@@ -570,9 +570,9 @@ asmlinkage long sys_inotify_init(void) dev->ih = ih; filp->f_op = &inotify_fops; - filp->f_vfsmnt =mntget (inotify_mnt); - filp->f_dentry =dget (inotify_mnt->mnt_root); - filp->f_mapping = filp->f_dentry->d_inode->i_mapping; + filp->f_path.mnt =mntget (inotify_mnt); + filp->f_path.dentry =dget (inotify_mnt->mnt_root); + filp->f_mapping = filp->f_path.dentry->d_inode->i_mapping; filp->f_mode =FMODE_READ ; filp->f_flags =O_RDONLY ; filp->private_data = dev;
fs/ioctl.c +7 -7
@@ -31,7 +31,7 @@ static long do_ioctl(struct file *filp, goto out; }else if (filp->f_op->ioctl) {lock_kernel (); - error = filp->f_op->ioctl (filp->f_dentry->d_inode, + error = filp->f_op->ioctl (filp->f_path.dentry->d_inode, filp, cmd, arg);unlock_kernel (); }
@@ -45,7 +45,7 @@ static int file_ioctl(struct file *filp, {int error;int block; -struct inode * inode = filp->f_dentry->d_inode; +struct inode * inode = filp->f_path.dentry->d_inode;int __user *p = (int __user *)arg;switch (cmd) {
@@ -137,17 +137,17 @@ int vfs_ioctl(struct file *filp, unsignebreak ;case FIOQSIZE : -if (S_ISDIR (filp->f_dentry->d_inode->i_mode) || -S_ISREG (filp->f_dentry->d_inode->i_mode) || -S_ISLNK (filp->f_dentry->d_inode->i_mode)) { -loff_t res =inode_get_bytes (filp->f_dentry->d_inode); +if (S_ISDIR (filp->f_path.dentry->d_inode->i_mode) || +S_ISREG (filp->f_path.dentry->d_inode->i_mode) || +S_ISLNK (filp->f_path.dentry->d_inode->i_mode)) { +loff_t res =inode_get_bytes (filp->f_path.dentry->d_inode); error =copy_to_user ((loff_t __user *)arg, &res,sizeof (res)) ? -EFAULT :0 ; }else error = -ENOTTY ;break ;default : -if (S_ISREG (filp->f_dentry->d_inode->i_mode)) +if (S_ISREG (filp->f_path.dentry->d_inode->i_mode)) error =file_ioctl (filp, cmd, arg);else error =do_ioctl (filp, cmd, arg);
fs/libfs.c +7 -7
@@ -63,7 +63,7 @@ int dcache_dir_open(struct inode *inode, {static struct qstr cursor_name = {.len =1 , .name ="." }; - file->private_data =d_alloc (file->f_dentry, &cursor_name); + file->private_data =d_alloc (file->f_path.dentry, &cursor_name);return file->private_data ?0 : -ENOMEM ; }
@@ -76,7 +76,7 @@ int dcache_dir_close(struct inode *inodeloff_t dcache_dir_lseek (struct file *file,loff_t offset,int origin) { -mutex_lock (&file->f_dentry->d_inode->i_mutex); +mutex_lock (&file->f_path.dentry->d_inode->i_mutex);switch (origin) {case 1 : offset += file->f_pos;
@@ -84,7 +84,7 @@ loff_t dcache_dir_lseek(struct file *filif (offset >=0 )break ;default : -mutex_unlock (&file->f_dentry->d_inode->i_mutex); +mutex_unlock (&file->f_path.dentry->d_inode->i_mutex);return -EINVAL ; }if (offset != file->f_pos) {
@@ -96,8 +96,8 @@ loff_t dcache_dir_lseek(struct file *filspin_lock (&dcache_lock);list_del (&cursor->d_u.d_child); - p = file->f_dentry->d_subdirs.next; -while (n && p != &file->f_dentry->d_subdirs) { + p = file->f_path.dentry->d_subdirs.next; +while (n && p != &file->f_path.dentry->d_subdirs) {struct dentry *next; next = list_entry(p, struct dentry, d_u.d_child);if (!d_unhashed (next) && next->d_inode)
@@ -108,7 +108,7 @@ loff_t dcache_dir_lseek(struct file *filspin_unlock (&dcache_lock); } } -mutex_unlock (&file->f_dentry->d_inode->i_mutex); +mutex_unlock (&file->f_path.dentry->d_inode->i_mutex);return offset; }
@@ -126,7 +126,7 @@ static inline unsigned char dt_type(struint dcache_readdir (struct file * filp,void * dirent,filldir_t filldir) { -struct dentry *dentry = filp->f_dentry; +struct dentry *dentry = filp->f_path.dentry;struct dentry *cursor = filp->private_data;struct list_head *p, *q = &cursor->d_u.d_child;ino_t ino;
fs/locks.c +16 -16
@@ -321,7 +321,7 @@ static int flock_to_posix_lock(struct fi start = filp->f_pos;break ;case SEEK_END : - start =i_size_read (filp->f_dentry->d_inode); + start =i_size_read (filp->f_path.dentry->d_inode);break ;default :return -EINVAL ;
@@ -371,7 +371,7 @@ static int flock64_to_posix_lock(struct start = filp->f_pos;break ;case SEEK_END : - start =i_size_read (filp->f_dentry->d_inode); + start =i_size_read (filp->f_path.dentry->d_inode);break ;default :return -EINVAL ;
@@ -672,7 +672,7 @@ posix_test_lock(struct file *filp, strucstruct file_lock *cfl;lock_kernel (); -for (cfl = filp->f_dentry->d_inode->i_flock; cfl; cfl = cfl->fl_next) { +for (cfl = filp->f_path.dentry->d_inode->i_flock; cfl; cfl = cfl->fl_next) {if (!IS_POSIX (cfl))continue ;if (posix_locks_conflict (cfl, fl))
@@ -734,7 +734,7 @@ static int flock_lock_file(struct file * {struct file_lock *new_fl =NULL ;struct file_lock **before; -struct inode * inode = filp->f_dentry->d_inode; +struct inode * inode = filp->f_path.dentry->d_inode;int error =0 ;int found =0 ;
@@ -1018,7 +1018,7 @@ static int __posix_lock_file_conf(struct*/ int posix_lock_file (struct file *filp,struct file_lock *fl) { -return __posix_lock_file_conf (filp->f_dentry->d_inode, fl,NULL ); +return __posix_lock_file_conf (filp->f_path.dentry->d_inode, fl,NULL ); }EXPORT_SYMBOL (posix_lock_file);
@@ -1033,7 +1033,7 @@ int posix_lock_file_conf(struct file *fiint posix_lock_file_conf (struct file *filp,struct file_lock *fl,struct file_lock *conflock) { -return __posix_lock_file_conf (filp->f_dentry->d_inode, fl, conflock); +return __posix_lock_file_conf (filp->f_path.dentry->d_inode, fl, conflock); }EXPORT_SYMBOL (posix_lock_file_conf);
@@ -1333,8 +1333,8 @@ int fcntl_getlease(struct file *filp)int type =F_UNLCK ;lock_kernel (); -time_out_leases (filp->f_dentry->d_inode); -for (fl = filp->f_dentry->d_inode->i_flock; fl &&IS_LEASE (fl); +time_out_leases (filp->f_path.dentry->d_inode); +for (fl = filp->f_path.dentry->d_inode->i_flock; fl &&IS_LEASE (fl); fl = fl->fl_next) {if (fl->fl_file == filp) { type = fl->fl_type & ~F_INPROGRESS ;
@@ -1359,7 +1359,7 @@ static int __setlease(struct file *filp,static int __setlease (struct file *filp,long arg,struct file_lock **flp) {struct file_lock *fl, **before, **my_before =NULL , *lease; -struct dentry *dentry = filp->f_dentry; +struct dentry *dentry = filp->f_path.dentry;struct inode *inode = dentry->d_inode;int error, rdlease_count =0 , wrlease_count =0 ;
@@ -1448,7 +1448,7 @@ out:int setlease (struct file *filp,long arg,struct file_lock **lease) { -struct dentry *dentry = filp->f_dentry; +struct dentry *dentry = filp->f_path.dentry;struct inode *inode = dentry->d_inode;int error;
@@ -1482,7 +1482,7 @@ int fcntl_setlease(unsigned int fd, struint fcntl_setlease (unsigned int fd,struct file *filp,long arg) {struct file_lock fl, *flp = &fl; -struct dentry *dentry = filp->f_dentry; +struct dentry *dentry = filp->f_path.dentry;struct inode *inode = dentry->d_inode;int error;
@@ -1692,7 +1692,7 @@ int fcntl_setlk(unsigned int fd, structif (copy_from_user (&flock, l,sizeof (flock))) goto out; - inode = filp->f_dentry->d_inode; + inode = filp->f_path.dentry->d_inode;/* Don't allow mandatory locks on files that may be memory mapped * and shared.
@@ -1835,7 +1835,7 @@ int fcntl_setlk64(unsigned int fd, strucif (copy_from_user (&flock, l,sizeof (flock))) goto out; - inode = filp->f_dentry->d_inode; + inode = filp->f_path.dentry->d_inode;/* Don't allow mandatory locks on files that may be memory mapped * and shared.
@@ -1922,7 +1922,7 @@ void locks_remove_posix(struct file *fil* posix_lock_file(). Another process could be setting a lock on this * file at the same time, but we wouldn't remove that lock anyway. */ -if (!filp->f_dentry->d_inode->i_flock) +if (!filp->f_path.dentry->d_inode->i_flock)return ; lock.fl_type =F_UNLCK ;
@@ -1951,7 +1951,7 @@ EXPORT_SYMBOL(locks_remove_posix);*/ void locks_remove_flock (struct file *filp) { -struct inode * inode = filp->f_dentry->d_inode; +struct inode * inode = filp->f_path.dentry->d_inode;struct file_lock *fl;struct file_lock **before;
@@ -2020,7 +2020,7 @@ static void lock_get_status(char* out, sstruct inode *inode =NULL ;if (fl->fl_file !=NULL ) - inode = fl->fl_file->f_dentry->d_inode; + inode = fl->fl_file->f_path.dentry->d_inode; out +=sprintf (out,"%d:%s " , id, pfx);if (IS_POSIX (fl)) {
fs/namei.c +5 -5
@@ -295,7 +295,7 @@ int vfs_permission(struct nameidata *nd,*/ int file_permission (struct file *file,int mask) { -return permission (file->f_dentry->d_inode, mask,NULL ); +return permission (file->f_path.dentry->d_inode, mask,NULL ); }/*
@@ -331,7 +331,7 @@ int get_write_access(struct inode * inodint deny_write_access (struct file * file) { -struct inode *inode = file->f_dentry->d_inode; +struct inode *inode = file->f_path.dentry->d_inode;spin_lock (&inode->i_lock);if (atomic_read (&inode->i_writecount) >0 ) {
@@ -366,7 +366,7 @@ void path_release_on_umount(struct namei*/ void release_open_intent (struct nameidata *nd) { -if (nd->intent.open.file->f_dentry ==NULL ) +if (nd->intent.open.file->f_path.dentry ==NULL )put_filp (nd->intent.open.file);else fput (nd->intent.open.file);
@@ -1136,7 +1136,7 @@ static int fastcall do_path_lookup(int dif (!file) goto out_fail; - dentry = file->f_dentry; + dentry = file->f_path.dentry; retval = -ENOTDIR ;if (!S_ISDIR (dentry->d_inode->i_mode))
@@ -1146,7 +1146,7 @@ static int fastcall do_path_lookup(int dif (retval) goto fput_fail; - nd->mnt =mntget (file->f_vfsmnt); + nd->mnt =mntget (file->f_path.mnt); nd->dentry =dget (dentry);fput_light (file, fput_needed);
fs/open.c +13 -13
@@ -165,7 +165,7 @@ asmlinkage long sys_fstatfs(unsigned int file =fget (fd);if (!file) goto out; - error =vfs_statfs_native (file->f_dentry, &tmp); + error =vfs_statfs_native (file->f_path.dentry, &tmp);if (!error &©_to_user (buf, &tmp,sizeof (tmp))) error = -EFAULT ;fput (file);
@@ -186,7 +186,7 @@ asmlinkage long sys_fstatfs64(unsigned i file =fget (fd);if (!file) goto out; - error =vfs_statfs64 (file->f_dentry, &tmp); + error =vfs_statfs64 (file->f_path.dentry, &tmp);if (!error &©_to_user (buf, &tmp,sizeof (tmp))) error = -EFAULT ;fput (file);
@@ -302,7 +302,7 @@ static long do_sys_ftruncate(unsigned inif (file->f_flags &O_LARGEFILE ) small =0 ; - dentry = file->f_dentry; + dentry = file->f_path.dentry; inode = dentry->d_inode; error = -EINVAL ;if (!S_ISREG (inode->i_mode) || !(file->f_mode &FMODE_WRITE ))
@@ -448,8 +448,8 @@ asmlinkage long sys_fchdir(unsigned intif (!file) goto out; - dentry = file->f_dentry; - mnt = file->f_vfsmnt; + dentry = file->f_path.dentry; + mnt = file->f_path.mnt; inode = dentry->d_inode; error = -ENOTDIR ;
@@ -503,7 +503,7 @@ asmlinkage long sys_fchmod(unsigned intif (!file) goto out; - dentry = file->f_dentry; + dentry = file->f_path.dentry; inode = dentry->d_inode;audit_inode (NULL , inode);
@@ -662,7 +662,7 @@ asmlinkage long sys_fchown(unsigned intif (!file) goto out; - dentry = file->f_dentry; + dentry = file->f_path.dentry;audit_inode (NULL , dentry->d_inode); error =chown_common (dentry, user, group);fput (file);
@@ -688,8 +688,8 @@ static struct file *__dentry_open(struct } f->f_mapping = inode->i_mapping; - f->f_dentry = dentry; - f->f_vfsmnt = mnt; + f->f_path.dentry = dentry; + f->f_path.mnt = mnt; f->f_pos =0 ; f->f_op =fops_get (inode->i_fop);file_move (f, &inode->i_sb->s_files);
@@ -723,8 +723,8 @@ cleanup_all:if (f->f_mode &FMODE_WRITE )put_write_access (inode);file_kill (f); - f->f_dentry =NULL ; - f->f_vfsmnt =NULL ; + f->f_path.dentry =NULL ; + f->f_path.mnt =NULL ; cleanup_file:put_filp (f);dput (dentry);
@@ -822,7 +822,7 @@ struct file *nameidata_to_filp(struct na/* Pick up the filp from the open intent */ filp = nd->intent.open.file;/* Has the filesystem initialised the file for us? */ -if (filp->f_dentry ==NULL ) +if (filp->f_path.dentry ==NULL ) filp =__dentry_open (nd->dentry, nd->mnt, flags, filp,NULL );else path_release (nd);
@@ -965,7 +965,7 @@ long do_sys_open(int dfd, const char __uput_unused_fd (fd); fd =PTR_ERR (f); }else { -fsnotify_open (f->f_dentry); +fsnotify_open (f->f_path.dentry);fd_install (fd, f); } }
fs/pipe.c +14 -14
@@ -222,7 +222,7 @@ pipe_read(struct kiocb *iocb, const stru unsigned long nr_segs, loff_t pos) {struct file *filp = iocb->ki_filp; -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;struct pipe_inode_info *pipe;int do_wakeup;ssize_t ret;
@@ -335,7 +335,7 @@ pipe_write(struct kiocb *iocb, const str unsigned long nr_segs, loff_t ppos) {struct file *filp = iocb->ki_filp; -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;struct pipe_inode_info *pipe;ssize_t ret;int do_wakeup;
@@ -520,7 +520,7 @@ pipe_ioctl(struct inode *pino, struct fi pipe_ioctl(struct inode *pino, struct file *filp, unsigned int cmd, unsigned long arg) { - struct inode *inode = filp->f_dentry->d_inode; + struct inode *inode = filp->f_path.dentry->d_inode;struct pipe_inode_info *pipe;int count, buf, nrbufs;
@@ -548,7 +548,7 @@ pipe_poll(struct file *filp, poll_table pipe_poll(struct file *filp, poll_table *wait) { unsigned int mask; -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;struct pipe_inode_info *pipe = inode->i_pipe;int nrbufs;
@@ -601,7 +601,7 @@ static intstatic int pipe_read_fasync (int fd,struct file *filp,int on) { -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;int retval;mutex_lock (&inode->i_mutex);
@@ -618,7 +618,7 @@ static intstatic int pipe_write_fasync (int fd,struct file *filp,int on) { -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;int retval;mutex_lock (&inode->i_mutex);
@@ -635,7 +635,7 @@ static intstatic int pipe_rdwr_fasync (int fd,struct file *filp,int on) { -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;struct pipe_inode_info *pipe = inode->i_pipe;int retval;
@@ -902,8 +902,8 @@ struct file *create_write_pipe(void) dentry->d_op = &pipefs_dentry_operations;d_add (dentry, inode); - f->f_vfsmnt =mntget (pipe_mnt); - f->f_dentry = dentry; + f->f_path.mnt =mntget (pipe_mnt); + f->f_path.dentry = dentry; f->f_mapping = inode->i_mapping; f->f_flags =O_WRONLY ;
@@ -923,8 +923,8 @@ struct file *create_write_pipe(void)void free_write_pipe (struct file *f) { -mntput (f->f_vfsmnt); -dput (f->f_dentry); +mntput (f->f_path.mnt); +dput (f->f_path.dentry);put_filp (f); }
@@ -935,9 +935,9 @@ struct file *create_read_pipe(struct filreturn ERR_PTR (-ENFILE );/* Grab pipe from the writer */ - f->f_vfsmnt =mntget (wrf->f_vfsmnt); - f->f_dentry =dget (wrf->f_dentry); - f->f_mapping = wrf->f_dentry->d_inode->i_mapping; + f->f_path.mnt =mntget (wrf->f_path.mnt); + f->f_path.dentry =dget (wrf->f_path.dentry); + f->f_mapping = wrf->f_path.dentry->d_inode->i_mapping; f->f_pos =0 ; f->f_flags =O_RDONLY ;
fs/read_write.c +10 -10
@@ -64,13 +64,13 @@ loff_t remote_llseek(struct file *file,lock_kernel ();switch (origin) {case 2 : - offset +=i_size_read (file->f_dentry->d_inode); + offset +=i_size_read (file->f_path.dentry->d_inode);break ;case 1 : offset += file->f_pos; } retval = -EINVAL ; -if (offset>=0 && offset<=file->f_dentry->d_inode->i_sb->s_maxbytes) { +if (offset>=0 && offset<=file->f_path.dentry->d_inode->i_sb->s_maxbytes) {if (offset != file->f_pos) { file->f_pos = offset; file->f_version =0 ;
@@ -95,7 +95,7 @@ loff_t default_llseek(struct file *file,lock_kernel ();switch (origin) {case 2 : - offset +=i_size_read (file->f_dentry->d_inode); + offset +=i_size_read (file->f_path.dentry->d_inode);break ;case 1 : offset += file->f_pos;
@@ -203,7 +203,7 @@ int rw_verify_area(int read_write, strucif (unlikely ((pos <0 ) || (loff_t) (pos + count) <0 )) goto Einval; - inode = file->f_dentry->d_inode; + inode = file->f_path.dentry->d_inode;if (unlikely (inode->i_flock &&MANDATORY_LOCK (inode))) { int retval = locks_mandatory_area( read_write == READ ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE,
@@ -273,7 +273,7 @@ ssize_t vfs_read(struct file *file, charelse ret =do_sync_read (file, buf, count, pos);if (ret >0 ) { -fsnotify_access (file->f_dentry); +fsnotify_access (file->f_path.dentry); current->rchar += ret; } current->syscr++;
@@ -331,7 +331,7 @@ ssize_t vfs_write(struct file *file, conelse ret =do_sync_write (file, buf, count, pos);if (ret >0 ) { -fsnotify_modify (file->f_dentry); +fsnotify_modify (file->f_path.dentry); current->wchar += ret; } current->syscw++;
@@ -628,9 +628,9 @@ out:kfree (iov);if ((ret + (type ==READ )) >0 ) {if (type ==READ ) -fsnotify_access (file->f_dentry); +fsnotify_access (file->f_path.dentry);else -fsnotify_modify (file->f_dentry); +fsnotify_modify (file->f_path.dentry); }return ret; }
@@ -722,7 +722,7 @@ static ssize_t do_sendfile(int out_fd, iif (!(in_file->f_mode &FMODE_READ )) goto fput_in; retval = -EINVAL ; - in_inode = in_file->f_dentry->d_inode; + in_inode = in_file->f_path.dentry->d_inode;if (!in_inode) goto fput_in;if (!in_file->f_op || !in_file->f_op->sendfile)
@@ -754,7 +754,7 @@ static ssize_t do_sendfile(int out_fd, i retval = -EINVAL ;if (!out_file->f_op || !out_file->f_op->sendpage) goto fput_out; - out_inode = out_file->f_dentry->d_inode; + out_inode = out_file->f_path.dentry->d_inode; retval =rw_verify_area (WRITE , out_file, &out_file->f_pos, count);if (retval <0 ) goto fput_out;
fs/readdir.c +1 -1
@@ -21,7 +21,7 @@int vfs_readdir (struct file *file,filldir_t filler,void *buf) { -struct inode *inode = file->f_dentry->d_inode; +struct inode *inode = file->f_path.dentry->d_inode;int res = -ENOTDIR ;if (!file->f_op || !file->f_op->readdir) goto out;
fs/seq_file.c +1 -1
@@ -269,7 +269,7 @@ EXPORT_SYMBOL(seq_lseek);/** * seq_release - free the structures associated with sequential file. * @file: file in question -* @inode: file->f_dentry->d_inode +* @inode: file->f_path.dentry->d_inode * * Frees the structures associated with sequential file; can be used * as ->f_op->release() if you don't have private data to destroy.
fs/splice.c +6 -6
@@ -941,7 +941,7 @@ long do_splice_direct(struct file *in, l* randomly drop data for eg socket -> socket splicing. Use the * piped splicing for that! */ - i_mode = in->f_dentry->d_inode->i_mode; + i_mode = in->f_path.dentry->d_inode->i_mode;if (unlikely (!S_ISREG (i_mode) && !S_ISBLK (i_mode)))return -EINVAL ;
@@ -1052,7 +1052,7 @@ static long do_splice(struct file *in, lloff_t offset, *off;long ret; - pipe = in->f_dentry->d_inode->i_pipe; + pipe = in->f_path.dentry->d_inode->i_pipe;if (pipe) {if (off_in)return -ESPIPE ;
@@ -1073,7 +1073,7 @@ static long do_splice(struct file *in, lreturn ret; } - pipe = out->f_dentry->d_inode->i_pipe; + pipe = out->f_path.dentry->d_inode->i_pipe;if (pipe) {if (off_out)return -ESPIPE ;
@@ -1231,7 +1231,7 @@ static long do_vmsplice(struct file *filstatic long do_vmsplice (struct file *file,const struct iovec __user *iov,unsigned long nr_segs,unsigned int flags) { -struct pipe_inode_info *pipe = file->f_dentry->d_inode->i_pipe; +struct pipe_inode_info *pipe = file->f_path.dentry->d_inode->i_pipe;struct page *pages[PIPE_BUFFERS ];struct partial_page partial[PIPE_BUFFERS ];struct splice_pipe_desc spd = {
@@ -1475,8 +1475,8 @@ static long do_tee(struct file *in, strustatic long do_tee (struct file *in,struct file *out,size_t len,unsigned int flags) { -struct pipe_inode_info *ipipe = in->f_dentry->d_inode->i_pipe; -struct pipe_inode_info *opipe = out->f_dentry->d_inode->i_pipe; +struct pipe_inode_info *ipipe = in->f_path.dentry->d_inode->i_pipe; +struct pipe_inode_info *opipe = out->f_path.dentry->d_inode->i_pipe;int ret = -EINVAL ;/*
fs/stat.c +1 -1
@@ -109,7 +109,7 @@ int vfs_fstat(unsigned int fd, struct ksint error = -EBADF ;if (f) { - error =vfs_getattr (f->f_vfsmnt, f->f_dentry, stat); + error =vfs_getattr (f->f_path.mnt, f->f_path.dentry, stat);fput (f); }return error;
fs/super.c +1 -1
@@ -552,7 +552,7 @@ static void mark_files_ro(struct super_bfile_list_lock ();list_for_each_entry (f, &sb->s_files, f_u.fu_list) { -if (S_ISREG (f->f_dentry->d_inode->i_mode) &&file_count (f)) +if (S_ISREG (f->f_path.dentry->d_inode->i_mode) &&file_count (f)) f->f_mode &= ~FMODE_WRITE ; }file_list_unlock ();
fs/sync.c +2 -2
@@ -93,7 +93,7 @@ long do_fsync(struct file *file, int dat* livelocks in fsync_buffers_list(). */ mutex_lock (&mapping->host->i_mutex); - err = file->f_op->fsync (file, file->f_dentry, datasync); + err = file->f_op->fsync (file, file->f_path.dentry, datasync);if (!ret) ret = err;mutex_unlock (&mapping->host->i_mutex);
@@ -222,7 +222,7 @@ asmlinkage long sys_sync_file_range(intif (!file) goto out; - i_mode = file->f_dentry->d_inode->i_mode; + i_mode = file->f_path.dentry->d_inode->i_mode; ret = -ESPIPE ;if (!S_ISREG (i_mode) && !S_ISBLK (i_mode) && !S_ISDIR (i_mode) && !S_ISLNK (i_mode))
fs/xattr.c +4 -4
@@ -261,7 +261,7 @@ sys_fsetxattr(int fd, char __user *name, f =fget (fd);if (!f)return error; - dentry = f->f_dentry; + dentry = f->f_path.dentry;audit_inode (NULL , dentry->d_inode); error =setxattr (dentry, name, value, size, flags);fput (f);
@@ -344,7 +344,7 @@ sys_fgetxattr(int fd, char __user *name, f =fget (fd);if (!f)return error; - error =getxattr (f->f_dentry, name, value, size); + error =getxattr (f->f_path.dentry, name, value, size);fput (f);return error; }
@@ -416,7 +416,7 @@ sys_flistxattr(int fd, char __user *list f =fget (fd);if (!f)return error; - error =listxattr (f->f_dentry, list, size); + error =listxattr (f->f_path.dentry, list, size);fput (f);return error; }
@@ -477,7 +477,7 @@ sys_fremovexattr(int fd, char __user *na f =fget (fd);if (!f)return error; - dentry = f->f_dentry; + dentry = f->f_path.dentry;audit_inode (NULL , dentry->d_inode); error =removexattr (dentry, name);fput (f);
include/linux/fs.h +6 -4
@@ -269,6 +269,7 @@ extern int dir_notify_enable;#include <linux/types.h> #include <linux/kdev_t.h> #include <linux/dcache.h> +#include <linux/namei.h> #include <linux/stat.h> #include <linux/cache.h> #include <linux/kobject.h>
@@ -723,8 +724,9 @@ struct file {struct list_head fu_list;struct rcu_head fu_rcuhead; } f_u; -struct dentry *f_dentry; -struct vfsmount *f_vfsmnt; +struct path f_path; +#define f_dentry f_path.dentry +#define f_vfsmnt f_path.mntconst struct file_operations *f_op;atomic_t f_count;unsigned int f_flags;
@@ -1259,7 +1261,7 @@ static inline void file_accessed(structstatic inline void file_accessed (struct file *file) {if (!(file->f_flags &O_NOATIME )) -touch_atime (file->f_vfsmnt, file->f_dentry); +touch_atime (file->f_path.mnt, file->f_path.dentry); }int sync_inode (struct inode *inode,struct writeback_control *wbc);
@@ -1650,7 +1652,7 @@ static inline void allow_write_access(ststatic inline void allow_write_access (struct file *file) {if (file) -atomic_inc (&file->f_dentry->d_inode->i_writecount); +atomic_inc (&file->f_path.dentry->d_inode->i_writecount); }extern int do_pipe (int *);extern struct file *create_read_pipe (struct file *f);
include/linux/fsnotify.h +1 -1
@@ -164,7 +164,7 @@ static inline void fsnotify_open(struct*/ static inline void fsnotify_close (struct file *file) { -struct dentry *dentry = file->f_dentry; +struct dentry *dentry = file->f_path.dentry;struct inode *inode = dentry->d_inode;const char *name = dentry->d_name.name;mode_t mode = file->f_mode;
Re: [PATCH 01 of 23] VFS: change struct file to use struct path
Quoted 6 lines · On Sat, 21 Oct 2006 02:17:26 -0400 Josef "Jeff" Sipek <[email protected]>…
From: Josef "Jeff" Sipek <[email protected]>
This patch changes struct file to use struct path instead of having independent pointers to struct dentry and struct vfsmount, and converts all users of f_{dentry,vfsmnt} in
fs/to use f_path.{dentry,mnt}.
why?
Quoted 12 lines
include/linux/fs.h +3
-2@@ -723,8 +724,9 @@ struct file {struct list_head fu_list;struct rcu_head fu_rcuhead; } f_u; -struct dentry *f_dentry; -struct vfsmount *f_vfsmnt; +struct path f_path; +#define f_dentry f_path.dentry +#define f_vfsmnt f_path.mntconst struct file_operations *f_op;atomic_t f_count;unsigned int f_flags;
Re: [PATCH 01 of 23] VFS: change struct file to use struct path
Quoted 11 lines · Andrew Morton
Quoted 6 lines · On Sat, 21 Oct 2006 02:17:26 -0400 Josef "Jeff" Sipek <[email protected]>…
From: Josef "Jeff" Sipek <[email protected]>
This patch changes struct file to use struct path instead of having independent pointers to struct dentry and struct vfsmount, and converts all users of f_{dentry,vfsmnt} in
fs/to use f_path.{dentry,mnt}.why?
It's little cleaner than having two pointers. In general, there is a number of users of dentry-vfsmount pairs in the kernel, and struct path nicely wraps it.
As to why struct file in particular, and not some other structure, it's mostly because Al suggested it... "I can give you a dozen examples of possible users right now - starting with struct file" (from the struct path thread few days ago.)
Josef "Jeff" Sipek.
Signature · 1 line
Don't drink and derive. Alcohol and algebra don't mix.
Re: [PATCH 01 of 23] VFS: change struct file to use struct path
hoi :)
Quoted 5 lines · Josef Sipek
Quoted 1 line
why?
It's little cleaner than having two pointers. In general, there is a number of users of dentry-vfsmount pairs in the kernel, and struct path nicely wraps it.
Sure, but you can split the patch up:
First, change struct file and introduce the #defines so that everything still works as before.
If this is accepted upstream, you can start to move other kernel code to use the new names.
If all active trees have finally moved to only use the new name, then you can remove the #define.
Signature · 1 line
Martin Waitz
Re: [PATCH 01 of 23] VFS: change struct file to use struct path
Quoted 5 lines · Martin Waitz
hoi :)
Quoted 2 lines · Josef Sipek
Quoted 1 line
why?
Quoted 8 lines
Quoted 3 lines
It's little cleaner than having two pointers. In general, there is a number of users of dentry-vfsmount pairs in the kernel, and struct path nicely wraps it.
Sure, but you can split the patch up:
First, change struct file and introduce the #defines so that everything still works as before.
That's what 01 does (along with fs/*.[ch] changes).
Josef "Jeff" Sipek.
Signature · 3 lines
Mankind invented the atomic bomb, but no mouse would ever construct a mousetrap. - Albert Einstein
PATCH 1/1 ext3: change uses of f_{dentry, vfsmnt} to use f_path
In reply to JosefJeff SipekFrom: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the ext3 filesystem.
---
4 files changed, 8 insertions(+), 8 deletions(-) fs/ext3/dir.c | 8 ++++---- fs/ext3/file.c | 2 +- fs/ext3/ioctl.c | 2 +- fs/ext3/namei.c | 4 ++--
fs/ext3/dir.c +4 -4
@@ -103,7 +103,7 @@ static int ext3_readdir(struct file * fistruct ext3_dir_entry_2 *de;struct super_block *sb;int err; -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;int ret =0 ; sb = inode->i_sb;
@@ -122,7 +122,7 @@ static int ext3_readdir(struct file * fi* We don't set the inode dirty flag since it's not * critical that it get flushed back to the disk. */ - EXT3_I(filp->f_dentry->d_inode)->i_flags &= ~EXT3_INDEX_FL; + EXT3_I(filp->f_path.dentry->d_inode)->i_flags &= ~EXT3_INDEX_FL; }#endif stored =0 ;
@@ -399,7 +399,7 @@ static int call_filldir(struct file * fi {struct dir_private_info *info = filp->private_data;loff_t curr_pos; -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;struct super_block * sb;int error;
@@ -429,7 +429,7 @@ static int ext3_dx_readdir(struct file * void * dirent, filldir_t filldir) {struct dir_private_info *info = filp->private_data; -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;struct fname *fname;int ret;
fs/ext3/file.c +1 -1
@@ -52,7 +52,7 @@ ext3_file_write(struct kiocb *iocb, cons unsigned long nr_segs, loff_t pos) {struct file *file = iocb->ki_filp; -struct inode *inode = file->f_dentry->d_inode; +struct inode *inode = file->f_path.dentry->d_inode;ssize_t ret;int err;
fs/ext3/ioctl.c +1 -1
@@ -257,7 +257,7 @@ flags_err:#ifdef CONFIG_COMPAT long ext3_compat_ioctl (struct file *file,unsigned int cmd,unsigned long arg) { -struct inode *inode = file->f_dentry->d_inode; +struct inode *inode = file->f_path.dentry->d_inode;int ret;/* These are just misnamed, they actually get/put from/to user an int */
fs/ext3/namei.c +2 -2
@@ -593,7 +593,7 @@ int ext3_htree_fill_tree(struct file *didxtrace (printk ("In htree_fill_tree, start hash: %x:%x\n" , start_hash, start_minor_hash)); - dir = dir_file->f_dentry->d_inode; + dir = dir_file->f_path.dentry->d_inode;if (!(EXT3_I (dir)->i_flags &EXT3_INDEX_FL )) { hinfo.hash_version =EXT3_SB (dir->i_sb)->s_def_hash_version; hinfo.seed =EXT3_SB (dir->i_sb)->s_hash_seed;
@@ -604,7 +604,7 @@ int ext3_htree_fill_tree(struct file *di } hinfo.hash = start_hash; hinfo.minor_hash =0 ; - frame =dx_probe (NULL , dir_file->f_dentry->d_inode, &hinfo, frames, &err); + frame =dx_probe (NULL , dir_file->f_path.dentry->d_inode, &hinfo, frames, &err);if (!frame)return err;
Re: [PATCH 05 of 23] ext3: change uses of f_{dentry, vfsmnt} to use f_path
Quoted 5 lines · Josef Jeff Sipek
From: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the ext3 filesystem.
Hey Jeff,
Don't forget about GFS2: fs/gfs2/ops_file.c.
Regards,
Bob Peterson
Red Hat Cluster Suite
Re: [PATCH 05 of 23] ext3: change uses of f_{dentry, vfsmnt} to use f_path
Quoted 9 lines · Robert Peterson
Quoted 5 lines · Josef Jeff Sipek
From: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the ext3 filesystem.
Hey Jeff,
Don't forget about GFS2:
fs/gfs2/ops_file.c.
I'm aware. There are still about 500 instances of f_{dentry,vfsmnt}, but I just wanted to see whether or not this would go anywhere. If it does, the remaining instances will get fixed up too.
Josef "Jeff" Sipek.
Signature · 3 lines
Evolution, n.: A hypothetical process whereby infinitely improbable events occur with alarming frequency, order arises from chaos, and no one is given credit.
PATCH 1/1 ext4: change uses of f_{dentry, vfsmnt} to use f_path
In reply to JosefJeff SipekFrom: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the ext4 filesystem.
---
4 files changed, 8 insertions(+), 8 deletions(-) fs/ext4/dir.c | 8 ++++---- fs/ext4/file.c | 2 +- fs/ext4/ioctl.c | 2 +- fs/ext4/namei.c | 4 ++--
fs/ext4/dir.c +4 -4
@@ -103,7 +103,7 @@ static int ext4_readdir(struct file * fistruct ext4_dir_entry_2 *de;struct super_block *sb;int err; -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;int ret =0 ; sb = inode->i_sb;
@@ -122,7 +122,7 @@ static int ext4_readdir(struct file * fi* We don't set the inode dirty flag since it's not * critical that it get flushed back to the disk. */ - EXT4_I(filp->f_dentry->d_inode)->i_flags &= ~EXT4_INDEX_FL; + EXT4_I(filp->f_path.dentry->d_inode)->i_flags &= ~EXT4_INDEX_FL; }#endif stored =0 ;
@@ -399,7 +399,7 @@ static int call_filldir(struct file * fi {struct dir_private_info *info = filp->private_data;loff_t curr_pos; -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;struct super_block * sb;int error;
@@ -429,7 +429,7 @@ static int ext4_dx_readdir(struct file * void * dirent, filldir_t filldir) {struct dir_private_info *info = filp->private_data; -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;struct fname *fname;int ret;
fs/ext4/file.c +1 -1
@@ -52,7 +52,7 @@ ext4_file_write(struct kiocb *iocb, cons unsigned long nr_segs, loff_t pos) {struct file *file = iocb->ki_filp; -struct inode *inode = file->f_dentry->d_inode; +struct inode *inode = file->f_path.dentry->d_inode;ssize_t ret;int err;
fs/ext4/ioctl.c +1 -1
@@ -256,7 +256,7 @@ flags_err:#ifdef CONFIG_COMPAT long ext4_compat_ioctl (struct file *file,unsigned int cmd,unsigned long arg) { -struct inode *inode = file->f_dentry->d_inode; +struct inode *inode = file->f_path.dentry->d_inode;int ret;/* These are just misnamed, they actually get/put from/to user an int */
fs/ext4/namei.c +2 -2
@@ -593,7 +593,7 @@ int ext4_htree_fill_tree(struct file *didxtrace (printk ("In htree_fill_tree, start hash: %x:%x\n" , start_hash, start_minor_hash)); - dir = dir_file->f_dentry->d_inode; + dir = dir_file->f_path.dentry->d_inode;if (!(EXT4_I (dir)->i_flags &EXT4_INDEX_FL )) { hinfo.hash_version =EXT4_SB (dir->i_sb)->s_def_hash_version; hinfo.seed =EXT4_SB (dir->i_sb)->s_hash_seed;
@@ -604,7 +604,7 @@ int ext4_htree_fill_tree(struct file *di } hinfo.hash = start_hash; hinfo.minor_hash =0 ; - frame =dx_probe (NULL , dir_file->f_dentry->d_inode, &hinfo, frames, &err); + frame =dx_probe (NULL , dir_file->f_path.dentry->d_inode, &hinfo, frames, &err);if (!frame)return err;
PATCH 1/1 isofs: change uses of f_{dentry, vfsmnt} to use f_path
In reply to JosefJeff SipekFrom: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the isofs filesystem.
---
2 files changed, 3 insertions(+), 4 deletions(-) fs/isofs/compress.c | 2 +- fs/isofs/dir.c | 5 ++---
fs/isofs/compress.c +1 -1
@@ -42,7 +42,7 @@ static struct semaphore zisofs_zlib_sema*/ static int zisofs_readpage (struct file *file,struct page *page) { -struct inode *inode = file->f_dentry->d_inode; +struct inode *inode = file->f_path.dentry->d_inode;struct address_space *mapping = inode->i_mapping;unsigned int maxpage, xpage, fpage, blockindex;unsigned long offset;
fs/isofs/dir.c +2 -3
@@ -183,7 +183,7 @@ static int do_isofs_readdir(struct inode/* Handle the case of the '..' directory */ if (de->name_len[0 ] ==1 && de->name[0 ] ==1 ) { - inode_number =parent_ino (filp->f_dentry); + inode_number =parent_ino (filp->f_path.dentry);if (filldir (dirent,".." ,2 , filp->f_pos, inode_number,DT_DIR ) <0 )break ; filp->f_pos += de_len;
@@ -255,8 +255,7 @@ static int isofs_readdir(struct file *fiint result;char * tmpname;struct iso_directory_record * tmpde; -struct inode *inode = filp->f_dentry->d_inode; - +struct inode *inode = filp->f_path.dentry->d_inode; tmpname = (char *)__get_free_page (GFP_KERNEL );if (tmpname ==NULL )
Re: [PATCH 08 of 23] isofs: change uses of f_{dentry, vfsmnt} to use f_path
fs/isofs/compress.c static struct semaphore zisofs_zlib_sema · line 45
Quoted 1 line · Josef Jeff Sipek
fs/isofs/compress.c +1
-0+struct inode *inode = file->f_path.dentry->d_inode;
It seems clumsy to pepper the kernel code with the above.
What about something like:
static inline struct inode *fpath_ino(struct file *file)
{
return file->f_path.dentry->d_inode;
}Signature · 2 lines
James Morris <[email protected]>
Re: [PATCH 08 of 23] isofs: change uses of f_{dentry, vfsmnt} to use f_path
Quoted 7 lines · James Morris
What about something like:
static inline struct inode *fpath_ino(struct file *file)
{ return file->f_path.dentry->d_inode; }
Generally, unless it saves a _lot_ of typing, we've tried to avoid gratuitous hiding of details. And "ino" isn't a good name, it's something we've traditionally used for the inode _number_. So it would be "fpath_inode()" or "file_inode()" or something.
As it is, the difference between
file->f_dentry->d_inode fpath_inode(file)
is not really enough of a win to merit hiding that it's doing two pointer dereferences. Now, whether the extra five characters ("path.") merit it, I don't know. I suspect not. If the line turns long, it's often more readable to just add a local variable or two, and do
struct dentry *dentry = file->f_[path.]dentry; struct inode *inode = dentry->d_inode;
which in some situations allow for other readability improvements too (eg maybe "dentry" or "inode" is used multiple times).
If this was something where we'd expect things to change in the future, maybe it would be worth it for _that_ reason. That doesn't sound very likely, though - these things have been fairly stable, and even this patch is really about syntactic cleanup than any real change.
Adding these kinds of "abstraction layers" is something that people are taught is good, but I personally tend to think that it makes it less obvious at the code level what the "costs" are. Unless you know things intimately, you really have no way of judging whether "fpath_inode()" is something expensive or not.
I dunno.
Linus
PATCH 1/1 nfsd: change uses of f_{dentry, vfsmnt} to use f_path
In reply to JosefJeff SipekFrom: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the nfs server code.
---
3 files changed, 14 insertions(+), 14 deletions(-) fs/nfsd/nfs4state.c | 10 +++++----- fs/nfsd/nfsctl.c | 2 +- fs/nfsd/vfs.c | 16 ++++++++--------
fs/nfsd/nfs4state.c +5 -5
@@ -1310,7 +1310,7 @@ nfs4_file_downgrade(struct file *filp, u nfs4_file_downgrade(struct file *filp, unsigned int share_access) {if (share_access &NFS4_SHARE_ACCESS_WRITE ) { -put_write_access (filp->f_dentry->d_inode); +put_write_access (filp->f_path.dentry->d_inode); filp->f_mode = (filp->f_mode |FMODE_READ ) & ~FMODE_WRITE ; } }
@@ -1623,7 +1623,7 @@ nfs4_upgrade_open(struct svc_rqst *rqstp nfs4_upgrade_open(struct svc_rqst *rqstp, struct svc_fh *cur_fh, struct nfs4_stateid *stp, struct nfsd4_open *open) { struct file *filp = stp->st_vfs_file; -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;unsigned int share_access, new_writer;__be32 status;
@@ -1966,7 +1966,7 @@ static inline intstatic inline int nfs4_check_fh (struct svc_fh *fhp,struct nfs4_stateid *stp) { -return fhp->fh_dentry->d_inode != stp->st_vfs_file->f_dentry->d_inode; +return fhp->fh_dentry->d_inode != stp->st_vfs_file->f_path.dentry->d_inode; } static int
@@ -2863,7 +2863,7 @@ nfsd4_lockt(struct svc_rqst *rqstp, stru* only the dentry:inode set. */ memset (&file,0 ,sizeof (struct file )); - file.f_dentry = current_fh->fh_dentry; + file.f_path.dentry = current_fh->fh_dentry; status = nfs_ok;if (posix_test_lock (&file, &file_lock, &conflock)) {
@@ -2953,7 +2953,7 @@ check_for_locks(struct file *filp, struc check_for_locks(struct file *filp, struct nfs4_stateowner *lowner) { struct file_lock **flpp; -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;int status =0 ;lock_kernel ();
fs/nfsd/nfsctl.c +1 -1
@@ -111,7 +111,7 @@ static ssize_t (*write_op[])(struct filestatic ssize_t nfsctl_transaction_write (struct file *file,const char __user *buf,size_t size,loff_t *pos) { -ino_t ino = file->f_dentry->d_inode->i_ino; +ino_t ino = file->f_path.dentry->d_inode->i_ino;char *data;ssize_t rv;
fs/nfsd/vfs.c +8 -8
@@ -736,10 +736,10 @@ nfsd_sync(struct file *filp) nfsd_sync(struct file *filp) {int err; -struct inode *inode = filp->f_dentry->d_inode; -dprintk ("nfsd: sync file %s\n" , filp->f_dentry->d_name.name); +struct inode *inode = filp->f_path.dentry->d_inode; +dprintk ("nfsd: sync file %s\n" , filp->f_path.dentry->d_name.name);mutex_lock (&inode->i_mutex); - err=nfsd_dosync (filp, filp->f_dentry, filp->f_op); + err=nfsd_dosync (filp, filp->f_path.dentry, filp->f_op);mutex_unlock (&inode->i_mutex);return err;
@@ -845,7 +845,7 @@ nfsd_vfs_read(struct svc_rqst *rqstp, stint host_err; err = nfserr_perm; - inode = file->f_dentry->d_inode; + inode = file->f_path.dentry->d_inode;#ifdef MSNFS if ((fhp->fh_export->ex_flags &NFSEXP_MSNFS ) && (!lock_may_read (inode, offset, *count)))
@@ -883,7 +883,7 @@ nfsd_vfs_read(struct svc_rqst *rqstp, st nfsdstats.io_read += host_err; *count = host_err; err =0 ; -fsnotify_access (file->f_dentry); +fsnotify_access (file->f_path.dentry); }else err =nfserrno (host_err); out:
@@ -917,11 +917,11 @@ nfsd_vfs_write(struct svc_rqst *rqstp, s err = nfserr_perm;if ((fhp->fh_export->ex_flags &NFSEXP_MSNFS ) && - (!lock_may_write (file->f_dentry->d_inode, offset, cnt))) + (!lock_may_write (file->f_path.dentry->d_inode, offset, cnt))) goto out;#endif - dentry = file->f_dentry; + dentry = file->f_path.dentry; inode = dentry->d_inode; exp = fhp->fh_export;
@@ -950,7 +950,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, sset_fs (oldfs);if (host_err >=0 ) { nfsdstats.io_write += cnt; -fsnotify_modify (file->f_dentry); +fsnotify_modify (file->f_path.dentry); }/* clear setuid/setgid flag after write */
PATCH 1/1 i386: change uses of f_{dentry, vfsmnt} to use f_path
In reply to JosefJeff SipekFrom: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the i386 arch code.
---
2 files changed, 5 insertions(+), 5 deletions(-) arch/i386/kernel/cpuid.c | 4 ++-- arch/i386/kernel/msr.c | 6 +++---
arch/i386/kernel/cpuid.c +2 -2
@@ -117,7 +117,7 @@ static ssize_t cpuid_read(struct file *fchar __user *tmp = buf;u32 data[4 ];u32 reg = *ppos; -int cpu =iminor (file->f_dentry->d_inode); +int cpu =iminor (file->f_path.dentry->d_inode);if (count %16 )return -EINVAL ;/* Invalid chunk size */
@@ -135,7 +135,7 @@ static ssize_t cpuid_read(struct file *fstatic int cpuid_open (struct inode *inode,struct file *file) { -unsigned int cpu =iminor (file->f_dentry->d_inode); +unsigned int cpu =iminor (file->f_path.dentry->d_inode);struct cpuinfo_x86 *c = &(cpu_data)[cpu];if (cpu >=NR_CPUS || !cpu_online (cpu))
arch/i386/kernel/msr.c +3 -3
@@ -172,7 +172,7 @@ static ssize_t msr_read(struct file *filu32 __user *tmp = (u32 __user *) buf;u32 data[2 ];u32 reg = *ppos; -int cpu =iminor (file->f_dentry->d_inode); +int cpu =iminor (file->f_path.dentry->d_inode);int err;if (count %8 )
@@ -197,7 +197,7 @@ static ssize_t msr_write(struct file *fiu32 data[2 ];size_t rv;u32 reg = *ppos; -int cpu =iminor (file->f_dentry->d_inode); +int cpu =iminor (file->f_path.dentry->d_inode);int err;if (count %8 )
@@ -217,7 +217,7 @@ static ssize_t msr_write(struct file *fistatic int msr_open (struct inode *inode,struct file *file) { -unsigned int cpu =iminor (file->f_dentry->d_inode); +unsigned int cpu =iminor (file->f_path.dentry->d_inode);struct cpuinfo_x86 *c = &(cpu_data)[cpu];if (cpu >=NR_CPUS || !cpu_online (cpu))
PATCH 1/1 x86_64: change uses of f_{dentry, vfsmnt} to use f_path
In reply to JosefJeff SipekFrom: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the x86_64 arch code.
---
1 file changed, 4 insertions(+), 4 deletions(-)
arch/x86_64/ia32/ia32_aout.c | 8 ++++----
arch/x86_64/ia32/ia32_aout.c +4 -4
@@ -272,7 +272,7 @@ static int load_aout_binary(struct linuxif ((N_MAGIC (ex) !=ZMAGIC &&N_MAGIC (ex) !=OMAGIC &&N_MAGIC (ex) !=QMAGIC &&N_MAGIC (ex) !=NMAGIC ) ||N_TRSIZE (ex) ||N_DRSIZE (ex) || -i_size_read (bprm->file->f_dentry->d_inode) < ex.a_text+ex.a_data+N_SYMSIZE (ex)+N_TXTOFF (ex)) { +i_size_read (bprm->file->f_path.dentry->d_inode) < ex.a_text+ex.a_data+N_SYMSIZE (ex)+N_TXTOFF (ex)) {return -ENOEXEC ; }
@@ -357,7 +357,7 @@ static int load_aout_binary(struct linux {printk (KERN_WARNING "fd_offset is not page aligned. Please convert program: %s\n" , - bprm->file->f_dentry->d_name.name); + bprm->file->f_path.dentry->d_name.name); error_time = jiffies; }#endif
@@ -440,7 +440,7 @@ static int load_aout_library(struct fileint retval;struct exec ex; - inode = file->f_dentry->d_inode; + inode = file->f_path.dentry->d_inode; retval = -ENOEXEC ; error =kernel_read (file,0 , (char *) &ex,sizeof (ex));
@@ -471,7 +471,7 @@ static int load_aout_library(struct file {printk (KERN_WARNING "N_TXTOFF is not page aligned. Please convert library: %s\n" , - file->f_dentry->d_name.name); + file->f_path.dentry->d_name.name); error_time = jiffies; }#endif
PATCH 1/1 kernel: change uses of f_{dentry, vfsmnt} to use f_path
In reply to JosefJeff SipekFrom: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in linux/kernel/.
---
5 files changed, 16 insertions(+), 16 deletions(-) kernel/acct.c | 14 +++++++------- kernel/fork.c | 2 +- kernel/futex.c | 10 +++++----- kernel/relay.c | 4 ++-- kernel/sysctl.c | 2 +-
kernel/acct.c +7 -7
@@ -117,7 +117,7 @@ static int check_free_space(struct filespin_unlock (&acct_globals.lock);/* May block */ -if (vfs_statfs (file->f_dentry, &sbuf)) +if (vfs_statfs (file->f_path.dentry, &sbuf))return res; suspend = sbuf.f_blocks *SUSPEND ; resume = sbuf.f_blocks *RESUME ;
@@ -193,7 +193,7 @@ static void acct_file_reopen(struct fileadd_timer (&acct_globals.timer); }if (old_acct) { -mnt_unpin (old_acct->f_vfsmnt); +mnt_unpin (old_acct->f_path.mnt);spin_unlock (&acct_globals.lock);do_acct_process (old_acct);filp_close (old_acct,NULL );
@@ -211,7 +211,7 @@ static int acct_on(char *name)if (IS_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 );return -EACCES ; }
@@ -228,11 +228,11 @@ static int acct_on(char *name) }spin_lock (&acct_globals.lock); -mnt_pin (file->f_vfsmnt); +mnt_pin (file->f_path.mnt);acct_file_reopen (file);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 ; }
@@ -282,7 +282,7 @@ void acct_auto_close_mnt(struct vfsmountvoid acct_auto_close_mnt (struct vfsmount *m) {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 );spin_unlock (&acct_globals.lock); }
@@ -298,7 +298,7 @@ void acct_auto_close(struct super_block {spin_lock (&acct_globals.lock);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 ); }spin_unlock (&acct_globals.lock);
kernel/fork.c +1 -1
@@ -252,7 +252,7 @@ static inline int dup_mmap(struct mm_stranon_vma_link (tmp); file = tmp->vm_file;if (file) { -struct inode *inode = file->f_dentry->d_inode; +struct inode *inode = file->f_path.dentry->d_inode;get_file (file);if (tmp->vm_flags &VM_DENYWRITE )atomic_dec (&inode->i_writecount);
kernel/futex.c +5 -5
@@ -166,7 +166,7 @@ static inline int match_futex(union fute/* * 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). * We can usually work out the index without swapping in the page. *
@@ -223,7 +223,7 @@ static int get_futex_key(u32 __user *uad/* * 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. */ if (likely (!(vma->vm_flags &VM_NONLINEAR ))) { key->shared.pgoff = (((address - vma->vm_start) >> PAGE_SHIFT)
@@ -1522,9 +1522,9 @@ static int futex_fd(u32 __user *uaddr, i goto out; } filp->f_op = &futex_fops; - filp->f_vfsmnt =mntget (futex_mnt); - filp->f_dentry =dget (futex_mnt->mnt_root); - filp->f_mapping = filp->f_dentry->d_inode->i_mapping; + filp->f_path.mnt =mntget (futex_mnt); + filp->f_path.dentry =dget (futex_mnt->mnt_root); + filp->f_mapping = filp->f_path.dentry->d_inode->i_mapping;if (signal) { err =__f_setown (filp,task_pid (current),PIDTYPE_PID ,1 );
kernel/relay.c +2 -2
@@ -957,7 +957,7 @@ static inline ssize_t relay_file_read_suif (!desc->count)return 0 ; -mutex_lock (&filp->f_dentry->d_inode->i_mutex); +mutex_lock (&filp->f_path.dentry->d_inode->i_mutex); do { if (!relay_file_read_avail(buf, *ppos)) break;
@@ -977,7 +977,7 @@ static inline ssize_t relay_file_read_su *ppos =relay_file_read_end_pos (buf, read_start, 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; }
kernel/sysctl.c +1 -1
@@ -1614,7 +1614,7 @@ static ssize_t do_rw_proc(int write, str size_t count, loff_t *ppos) { 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;size_t res;ssize_t error = -ENOTDIR ;
PATCH 1/1 autofs: change uses of f_{dentry, vfsmnt} to use f_path
In reply to JosefJeff SipekFrom: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the autofs filesystem.
---
1 file changed, 2 insertions(+), 2 deletions(-)
fs/autofs/root.c | 4 ++--
fs/autofs/root.c +2 -2
@@ -45,7 +45,7 @@ static int autofs_root_readdir(struct fistruct autofs_dir_ent *ent =NULL ;struct autofs_dirhash *dirhash;struct autofs_sb_info *sbi; -struct inode * inode = filp->f_dentry->d_inode; +struct inode * inode = filp->f_path.dentry->d_inode;off_t onr, nr;lock_kernel ();
@@ -557,7 +557,7 @@ static int autofs_root_ioctl(struct inodcase AUTOFS_IOC_SETTIMEOUT :return autofs_get_set_timeout (sbi, argp);case AUTOFS_IOC_EXPIRE : -return autofs_expire_run (inode->i_sb, sbi, filp->f_vfsmnt, +return autofs_expire_run (inode->i_sb, sbi, filp->f_path.mnt, argp);default :return -ENOSYS ;
PATCH 1/1 autofs4: change uses of f_{dentry, vfsmnt} to use f_path
In reply to JosefJeff SipekFrom: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the autofs4 filesystem.
---
2 files changed, 10 insertions(+), 9 deletions(-)
fs/autofs4/autofs_i.h | 3 ++-fs/autofs4/root.c | 16 ++++++++--------
fs/autofs4/autofs_i.h +2 -1
@@ -150,7 +150,8 @@ static inline int autofs4_ispending(strustatic inline void autofs4_copy_atime (struct file *src,struct file *dst) { - dst->f_dentry->d_inode->i_atime = src->f_dentry->d_inode->i_atime; + dst->f_path.dentry->d_inode->i_atime = + src->f_path.dentry->d_inode->i_atime;return ; }
fs/autofs4/root.c +8 -8
@@ -74,7 +74,7 @@ static int autofs4_root_readdir(struct fstatic int autofs4_root_readdir (struct file *file,void *dirent,filldir_t filldir) { -struct autofs_sb_info *sbi =autofs4_sbi (file->f_dentry->d_sb); +struct autofs_sb_info *sbi =autofs4_sbi (file->f_path.dentry->d_sb);int oz_mode =autofs4_oz_mode (sbi);DPRINTK ("called, filp->f_pos = %lld" , file->f_pos);
@@ -95,8 +95,8 @@ static int autofs4_root_readdir(struct fstatic int autofs4_dir_open (struct inode *inode,struct file *file) { -struct dentry *dentry = file->f_dentry; -struct vfsmount *mnt = file->f_vfsmnt; +struct dentry *dentry = file->f_path.dentry; +struct vfsmount *mnt = file->f_path.mnt;struct autofs_sb_info *sbi =autofs4_sbi (dentry->d_sb);struct dentry *cursor;int status;
@@ -172,7 +172,7 @@ out:static int autofs4_dir_close (struct inode *inode,struct file *file) { -struct dentry *dentry = file->f_dentry; +struct dentry *dentry = file->f_path.dentry;struct autofs_sb_info *sbi =autofs4_sbi (dentry->d_sb);struct dentry *cursor = file->private_data;int status =0 ;
@@ -204,7 +204,7 @@ out:static int autofs4_dir_readdir (struct file *file,void *dirent,filldir_t filldir) { -struct dentry *dentry = file->f_dentry; +struct dentry *dentry = file->f_path.dentry;struct autofs_sb_info *sbi =autofs4_sbi (dentry->d_sb);struct dentry *cursor = file->private_data;int status;
@@ -858,14 +858,14 @@ static int autofs4_root_ioctl(struct inoreturn autofs4_ask_reghost (sbi, p);case AUTOFS_IOC_ASKUMOUNT : -return autofs4_ask_umount (filp->f_vfsmnt, p); +return autofs4_ask_umount (filp->f_path.mnt, p);/* return a single thing to expire */ case AUTOFS_IOC_EXPIRE : -return autofs4_expire_run (inode->i_sb,filp->f_vfsmnt,sbi, p); +return autofs4_expire_run (inode->i_sb,filp->f_path.mnt,sbi, p);/* same as above, but can send multiple expires through pipe */ case AUTOFS_IOC_EXPIRE_MULTI : -return autofs4_expire_multi (inode->i_sb,filp->f_vfsmnt,sbi, p); +return autofs4_expire_multi (inode->i_sb,filp->f_path.mnt,sbi, p);default :return -ENOSYS ;
PATCH 1/1 ecryptfs: change uses of f_{dentry, vfsmnt} to use f_path
In reply to JosefJeff SipekFrom: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the ecryptfs filesystem.
---
3 files changed, 20 insertions(+), 20 deletions(-) fs/ecryptfs/file.c | 14 +++++++------- fs/ecryptfs/inode.c | 8 ++++---- fs/ecryptfs/mmap.c | 18 +++++++++---------
fs/ecryptfs/file.c +7 -7
@@ -76,7 +76,7 @@ static loff_t ecryptfs_llseek(struct fil }ecryptfs_printk (KERN_DEBUG ,"new_end_pos = [0x%.16x]\n" , new_end_pos);if (expanding_file) { - rc =ecryptfs_truncate (file->f_dentry, new_end_pos); + rc =ecryptfs_truncate (file->f_path.dentry, new_end_pos);if (rc) { rv = rc; ecryptfs_printk(KERN_ERR, "Error on attempt to "
@@ -117,8 +117,8 @@ static ssize_t ecryptfs_read_update_atimif (-EIOCBQUEUED == rc) rc =wait_on_sync_kiocb (iocb);if (rc >=0 ) { - lower_dentry =ecryptfs_dentry_to_lower (file->f_dentry); - lower_vfsmount =ecryptfs_dentry_to_lower_mnt (file->f_dentry); + lower_dentry =ecryptfs_dentry_to_lower (file->f_path.dentry); + lower_vfsmount =ecryptfs_dentry_to_lower_mnt (file->f_path.dentry);touch_atime (lower_vfsmount, lower_dentry); }return rc;
@@ -177,10 +177,10 @@ static int ecryptfs_readdir(struct file lower_file =ecryptfs_file_to_lower (file); lower_file->f_pos = file->f_pos; - inode = file->f_dentry->d_inode; + inode = file->f_path.dentry->d_inode;memset (&buf,0 ,sizeof (buf)); buf.dirent = dirent; - buf.dentry = file->f_dentry; + buf.dentry = file->f_path.dentry; buf.filldir = filldir; retry: buf.filldir_called =0 ;
@@ -193,7 +193,7 @@ retry: goto retry; file->f_pos = lower_file->f_pos;if (rc >=0 ) -fsstack_copy_attr_atime (inode, lower_file->f_dentry->d_inode); +fsstack_copy_attr_atime (inode, lower_file->f_path.dentry->d_inode);return rc; }
@@ -213,7 +213,7 @@ static int ecryptfs_open(struct inode *iint rc =0 ;struct ecryptfs_crypt_stat *crypt_stat =NULL ;struct ecryptfs_mount_crypt_stat *mount_crypt_stat; -struct dentry *ecryptfs_dentry = file->f_dentry; +struct dentry *ecryptfs_dentry = file->f_path.dentry;/* Private value of ecryptfs_dentry allocated in * ecryptfs_lookup() */ struct dentry *lower_dentry =ecryptfs_dentry_to_lower (ecryptfs_dentry);
fs/ecryptfs/inode.c +4 -4
@@ -155,7 +155,7 @@ static int grow_file(struct dentry *ecrystruct ecryptfs_file_info tmp_file_info;memset (&fake_file,0 ,sizeof (fake_file)); - fake_file.f_dentry = ecryptfs_dentry; + fake_file.f_path.dentry = ecryptfs_dentry;memset (&tmp_file_info,0 ,sizeof (tmp_file_info));ecryptfs_set_file_private (&fake_file, &tmp_file_info);ecryptfs_set_file_lower (&fake_file, lower_file);
@@ -221,8 +221,8 @@ static int ecryptfs_initialize_file(stru goto out; }/* fput(lower_file) should handle the puts if we do this */ - lower_file->f_dentry = tlower_dentry; - lower_file->f_vfsmnt = lower_mnt; + lower_file->f_path.dentry = tlower_dentry; + lower_file->f_path.mnt = lower_mnt; lower_inode = tlower_dentry->d_inode;if (S_ISDIR (ecryptfs_dentry->d_inode->i_mode)) {ecryptfs_printk (KERN_DEBUG ,"This is a directory\n" );
@@ -784,7 +784,7 @@ int ecryptfs_truncate(struct dentry *den* the file in the underlying filesystem so that the * truncation has an effect there as well. */ memset (&fake_ecryptfs_file,0 ,sizeof (fake_ecryptfs_file)); - fake_ecryptfs_file.f_dentry = dentry; + fake_ecryptfs_file.f_path.dentry = dentry;/* Released at out_free: label */ ecryptfs_set_file_private(&fake_ecryptfs_file, kmem_cache_alloc(ecryptfs_file_info_cache,
fs/ecryptfs/mmap.c +9 -9
@@ -51,7 +51,7 @@ static struct page *ecryptfs_get1page(ststruct inode *inode;struct address_space *mapping; - dentry = file->f_dentry; + dentry = file->f_path.dentry; inode = dentry->d_inode; mapping = inode->i_mapping; page = read_cache_page(mapping, index,
@@ -84,7 +84,7 @@ int ecryptfs_fill_zeros(struct file *filint ecryptfs_fill_zeros (struct file *file,loff_t new_length) {int rc =0 ; -struct dentry *dentry = file->f_dentry; +struct dentry *dentry = file->f_path.dentry;struct inode *inode = dentry->d_inode;pgoff_t old_end_page_index =0 ;pgoff_t index = old_end_page_index;
@@ -218,7 +218,7 @@ int ecryptfs_do_readpage(struct file *fichar *lower_page_data;const struct address_space_operations *lower_a_ops; - dentry = file->f_dentry; + dentry = file->f_path.dentry; lower_file =ecryptfs_file_to_lower (file); lower_dentry =ecryptfs_dentry_to_lower (dentry); inode = dentry->d_inode;
@@ -275,9 +275,9 @@ static int ecryptfs_readpage(struct fileint rc =0 ;struct ecryptfs_crypt_stat *crypt_stat; -BUG_ON (!(file && file->f_dentry && file->f_dentry->d_inode)); - crypt_stat = - &ecryptfs_inode_to_private (file->f_dentry->d_inode)->crypt_stat; +BUG_ON (!(file && file->f_path.dentry && file->f_path.dentry->d_inode)); + crypt_stat = &ecryptfs_inode_to_private (file->f_path.dentry->d_inode) + ->crypt_stat;if (!crypt_stat || !ECRYPTFS_CHECK_FLAG (crypt_stat->flags,ECRYPTFS_ENCRYPTED ) ||ECRYPTFS_CHECK_FLAG (crypt_stat->flags,ECRYPTFS_NEW_FILE )) {
@@ -571,7 +571,7 @@ process_new_file(struct ecryptfs_crypt_sif (more_header_data_to_be_written) { rc =ecryptfs_write_headers_virt (header_virt, crypt_stat, - file->f_dentry); + file->f_path.dentry);if (rc) {ecryptfs_printk (KERN_WARNING ,"Error " "generating header; rc = "
@@ -638,8 +638,8 @@ static int ecryptfs_commit_write(struct lower_inode =ecryptfs_inode_to_lower (inode); lower_file =ecryptfs_file_to_lower (file);mutex_lock (&lower_inode->i_mutex); - crypt_stat = - &ecryptfs_inode_to_private (file->f_dentry->d_inode)->crypt_stat; + crypt_stat = &ecryptfs_inode_to_private (file->f_path.dentry->d_inode) + ->crypt_stat;if (ECRYPTFS_CHECK_FLAG (crypt_stat->flags,ECRYPTFS_NEW_FILE )) {ecryptfs_printk (KERN_DEBUG ,"ECRYPTFS_NEW_FILE flag set in " "crypt_stat at memory location [%p]\n" , crypt_stat);
PATCH 1/1 9p: change uses of f_{dentry,vfsmnt} to use f_path
In reply to JosefJeff SipekFrom: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the 9p filesystem.
---
3 files changed, 7 insertions(+), 7 deletions(-) fs/9p/vfs_addr.c | 2 +- fs/9p/vfs_dir.c | 4 ++-- fs/9p/vfs_file.c | 8 ++++----
fs/9p/vfs_addr.c +1 -1
@@ -54,7 +54,7 @@ static int v9fs_vfs_readpage(struct fileint retval = -EIO ;loff_t offset =page_offset (page);int count =PAGE_CACHE_SIZE ; -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;struct v9fs_session_info *v9ses =v9fs_inode2v9ses (inode);int rsize = v9ses->maxdata -V9FS_IOHDRSZ ;struct v9fs_fid *v9f = filp->private_data;
fs/9p/vfs_dir.c +2 -2
@@ -70,7 +70,7 @@ static int v9fs_dir_readdir(struct filestatic int v9fs_dir_readdir (struct file *filp,void *dirent,filldir_t filldir) {struct v9fs_fcall *fcall =NULL ; -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;struct v9fs_session_info *v9ses =v9fs_inode2v9ses (inode);struct v9fs_fid *file = filp->private_data;unsigned int i, n, s;
@@ -79,7 +79,7 @@ static int v9fs_dir_readdir(struct filestruct v9fs_stat stat;int over =0 ; -dprintk (DEBUG_VFS ,"name %s\n" , filp->f_dentry->d_name.name); +dprintk (DEBUG_VFS ,"name %s\n" , filp->f_path.dentry->d_name.name); fid = file->fid;
fs/9p/vfs_file.c +4 -4
@@ -59,7 +59,7 @@ int v9fs_file_open(struct inode *inode,dprintk (DEBUG_VFS ,"inode: %p file: %p \n" , inode, file); - vfid =v9fs_fid_lookup (file->f_dentry); + vfid =v9fs_fid_lookup (file->f_path.dentry);if (!vfid) {dprintk (DEBUG_ERROR ,"Couldn't resolve fid from dentry\n" );return -EBADF ;
@@ -132,7 +132,7 @@ static int v9fs_file_lock(struct file *fstatic int v9fs_file_lock (struct file *filp,int cmd,struct file_lock *fl) {int res =0 ; -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;dprintk (DEBUG_VFS ,"filp: %p lock: %p\n" , filp, fl);
@@ -160,7 +160,7 @@ v9fs_file_read(struct file *filp, char _ v9fs_file_read(struct file *filp, char __user * data, size_t count, loff_t * offset) { - struct inode *inode = filp->f_dentry->d_inode; + struct inode *inode = filp->f_path.dentry->d_inode;struct v9fs_session_info *v9ses =v9fs_inode2v9ses (inode);struct v9fs_fid *v9f = filp->private_data;struct v9fs_fcall *fcall =NULL ;
@@ -224,7 +224,7 @@ v9fs_file_write(struct file *filp, const v9fs_file_write(struct file *filp, const char __user * data, size_t count, loff_t * offset) { - struct inode *inode = filp->f_dentry->d_inode; + struct inode *inode = filp->f_path.dentry->d_inode;struct v9fs_session_info *v9ses =v9fs_inode2v9ses (inode);struct v9fs_fid *v9fid = filp->private_data;struct v9fs_fcall *fcall;
PATCH 1/1 xfs: change uses of f_{dentry,vfsmnt} to use f_path
In reply to JosefJeff SipekFrom: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the xfs filesystem.
---
5 files changed, 23 insertions(+), 23 deletions(-) fs/xfs/linux-2.6/xfs_file.c | 28 ++++++++++++++-------------- fs/xfs/linux-2.6/xfs_ioctl.c | 10 +++++----- fs/xfs/linux-2.6/xfs_ioctl32.c | 2 +- fs/xfs/linux-2.6/xfs_lrw.c | 2 +- fs/xfs/xfs_dfrag.c | 4 ++--
fs/xfs/linux-2.6/xfs_file.c +14 -14
@@ -55,7 +55,7 @@ __xfs_file_read( loff_t pos) {struct file *file = iocb->ki_filp; -bhv_vnode_t *vp =vn_from_inode (file->f_dentry->d_inode); +bhv_vnode_t *vp =vn_from_inode (file->f_path.dentry->d_inode);BUG_ON (iocb->ki_pos != pos);if (unlikely (file->f_flags &O_DIRECT ))
@@ -131,7 +131,7 @@ xfs_file_sendfile(read_actor_t actor, void *target) { - return bhv_vop_sendfile(vn_from_inode(filp->f_dentry->d_inode), + return bhv_vop_sendfile(vn_from_inode(filp->f_path.dentry->d_inode), filp, pos, 0, count, actor, target, NULL); }
@@ -143,7 +143,7 @@ xfs_file_sendfile_invis(read_actor_t actor, void *target) { - return bhv_vop_sendfile(vn_from_inode(filp->f_dentry->d_inode), + return bhv_vop_sendfile(vn_from_inode(filp->f_path.dentry->d_inode),filp ,pos ,IO_INVIS ,count ,actor ,target ,NULL ); }
@@ -155,7 +155,7 @@ xfs_file_splice_read( size_t len, unsigned int flags) { -return bhv_vop_splice_read (vn_from_inode (infilp->f_dentry->d_inode), +return bhv_vop_splice_read (vn_from_inode (infilp->f_path.dentry->d_inode), infilp, ppos, pipe, len, flags,0 ,NULL ); }
@@ -167,7 +167,7 @@ xfs_file_splice_read_invis( size_t len, unsigned int flags) { -return bhv_vop_splice_read (vn_from_inode (infilp->f_dentry->d_inode), +return bhv_vop_splice_read (vn_from_inode (infilp->f_path.dentry->d_inode), infilp, ppos, pipe, len, flags,IO_INVIS ,NULL ); }
@@ -180,7 +180,7 @@ xfs_file_splice_write( size_t len, unsigned int flags) { -return bhv_vop_splice_write (vn_from_inode (outfilp->f_dentry->d_inode), +return bhv_vop_splice_write (vn_from_inode (outfilp->f_path.dentry->d_inode), pipe, outfilp, ppos, len, flags,0 ,NULL ); }
@@ -192,7 +192,7 @@ xfs_file_splice_write_invis( size_t len, unsigned int flags) { -return bhv_vop_splice_write (vn_from_inode (outfilp->f_dentry->d_inode), +return bhv_vop_splice_write (vn_from_inode (outfilp->f_path.dentry->d_inode), pipe, outfilp, ppos, len, flags,IO_INVIS ,NULL ); }
@@ -212,7 +212,7 @@ xfs_file_close( struct file *filp, fl_owner_t id) { -return -bhv_vop_close (vn_from_inode (filp->f_dentry->d_inode),0 , +return -bhv_vop_close (vn_from_inode (filp->f_path.dentry->d_inode),0 ,file_count (filp) >1 ?L_FALSE :L_TRUE ,NULL ); }
@@ -251,7 +251,7 @@ xfs_vm_nopage(unsigned long address, int *type) { - struct inode *inode = area->vm_file->f_dentry->d_inode; + struct inode *inode = area->vm_file->f_path.dentry->d_inode;bhv_vnode_t *vp =vn_from_inode (inode);ASSERT_ALWAYS (vp->v_vfsp->vfs_flag &VFS_DMI );
@@ -268,7 +268,7 @@ xfs_file_readdir( filldir_t filldir) {int error =0 ; -bhv_vnode_t *vp =vn_from_inode (filp->f_dentry->d_inode); +bhv_vnode_t *vp =vn_from_inode (filp->f_path.dentry->d_inode);uio_t uio;iovec_t iov;int eof =0 ;
@@ -345,7 +345,7 @@ xfs_file_mmap( vma->vm_ops = &xfs_file_vm_ops;#ifdef CONFIG_XFS_DMAPI -if (vn_from_inode (filp->f_dentry->d_inode)->v_vfsp->vfs_flag &VFS_DMI ) +if (vn_from_inode (filp->f_path.dentry->d_inode)->v_vfsp->vfs_flag &VFS_DMI ) vma->vm_ops = &xfs_dmapi_file_vm_ops;#endif /* CONFIG_XFS_DMAPI */
@@ -360,7 +360,7 @@ xfs_file_ioctl( unsigned long p) {int error; -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;bhv_vnode_t *vp =vn_from_inode (inode); error =bhv_vop_ioctl (vp, inode, filp,0 , cmd, (void __user *)p);
@@ -382,7 +382,7 @@ xfs_file_ioctl_invis( unsigned long p) {int error; -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;bhv_vnode_t *vp =vn_from_inode (inode); error =bhv_vop_ioctl (vp, inode, filp,IO_INVIS , cmd, (void __user *)p);
@@ -404,7 +404,7 @@ xfs_vm_mprotect( struct vm_area_struct *vma, unsigned int newflags) { -bhv_vnode_t *vp =vn_from_inode (vma->vm_file->f_dentry->d_inode); +bhv_vnode_t *vp =vn_from_inode (vma->vm_file->f_path.dentry->d_inode);int error =0 ;if (vp->v_vfsp->vfs_flag &VFS_DMI ) {
fs/xfs/linux-2.6/xfs_ioctl.c +5 -5
@@ -107,9 +107,9 @@ xfs_find_handle(if (!file)return -EBADF ; -ASSERT (file->f_dentry); -ASSERT (file->f_dentry->d_inode); - inode =igrab (file->f_dentry->d_inode); +ASSERT (file->f_path.dentry); +ASSERT (file->f_path.dentry->d_inode); + inode =igrab (file->f_path.dentry->d_inode);fput (file);break ; }
@@ -333,10 +333,10 @@ xfs_open_by_handle( }/* Ensure umount returns EBUSY on umounts while this file is open. */ -mntget (parfilp->f_vfsmnt); +mntget (parfilp->f_path.mnt);/* Create file pointer. */ - filp =dentry_open (dentry, parfilp->f_vfsmnt, hreq.oflags); + filp =dentry_open (dentry, parfilp->f_path.mnt, hreq.oflags);if (IS_ERR (filp)) {put_unused_fd (new_fd);return -XFS_ERROR (-PTR_ERR (filp));
fs/xfs/linux-2.6/xfs_ioctl32.c +1 -1
@@ -112,7 +112,7 @@ xfs_compat_ioctl( unsigned cmd, unsigned long arg) { -struct inode *inode = file->f_dentry->d_inode; +struct inode *inode = file->f_path.dentry->d_inode;bhv_vnode_t *vp =vn_from_inode (inode);int error;
fs/xfs/linux-2.6/xfs_lrw.c +1 -1
@@ -805,7 +805,7 @@ start: !capable(CAP_FSETID)) { error =xfs_write_clear_setuid (xip);if (likely (!error)) - error = -remove_suid (file->f_dentry); + error = -remove_suid (file->f_path.dentry);if (unlikely (error)) {xfs_iunlock (xip, iolock); goto out_unlock_mutex;
fs/xfs/xfs_dfrag.c +2 -2
@@ -71,7 +71,7 @@ xfs_swapext(/* Pull information for the target fd */ if (((fp =fget ((int )sxp->sx_fdtarget)) ==NULL ) || - ((vp =vn_from_inode (fp->f_dentry->d_inode)) ==NULL )) { + ((vp =vn_from_inode (fp->f_path.dentry->d_inode)) ==NULL )) { error =XFS_ERROR (EINVAL ); goto error0; }
@@ -83,7 +83,7 @@ xfs_swapext( }if (((tfp =fget ((int )sxp->sx_fdtmp)) ==NULL ) || - ((tvp =vn_from_inode (tfp->f_dentry->d_inode)) ==NULL )) { + ((tvp =vn_from_inode (tfp->f_path.dentry->d_inode)) ==NULL )) { error =XFS_ERROR (EINVAL ); goto error0; }
PATCH 1/1 nfs: change uses of f_{dentry,vfsmnt} to use f_path
In reply to JosefJeff SipekFrom: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the nfs client code.
---
8 files changed, 29 insertions(+), 29 deletions(-) fs/nfs/dir.c | 18 +++++++++--------- fs/nfs/direct.c | 10 +++++----- fs/nfs/file.c | 14 +++++++------- fs/nfs/idmap.c | 2 +- fs/nfs/inode.c | 6 +++--- fs/nfs/nfs3proc.c | 2 +- fs/nfs/proc.c | 2 +- fs/nfs/write.c | 4 ++--
fs/nfs/dir.c +9 -9
@@ -172,7 +172,7 @@ int nfs_readdir_filler(nfs_readdir_descrint nfs_readdir_filler (nfs_readdir_descriptor_t *desc,struct page *page) {struct file *file = desc->file; -struct inode *inode = file->f_dentry->d_inode; +struct inode *inode = file->f_path.dentry->d_inode;struct rpc_cred *cred =nfs_file_cred (file);unsigned long timestamp;int error;
@@ -183,7 +183,7 @@ int nfs_readdir_filler(nfs_readdir_descr again: timestamp = jiffies; - error =NFS_PROTO (inode)->readdir (file->f_dentry, cred, desc->entry->cookie, page, + error =NFS_PROTO (inode)->readdir (file->f_path.dentry, cred, desc->entry->cookie, page,NFS_SERVER (inode)->dtsize, desc->plus);if (error <0 ) {/* We requested READDIRPLUS, but the server doesn't grok it */
@@ -308,7 +308,7 @@ static inlinestatic inline int find_dirent_page (nfs_readdir_descriptor_t *desc) { -struct inode *inode = desc->file->f_dentry->d_inode; +struct inode *inode = desc->file->f_path.dentry->d_inode;struct page *page;int status;
@@ -464,7 +464,7 @@ int uncached_readdir(nfs_readdir_descrip filldir_t filldir) {struct file *file = desc->file; -struct inode *inode = file->f_dentry->d_inode; +struct inode *inode = file->f_path.dentry->d_inode;struct rpc_cred *cred =nfs_file_cred (file);struct page *page =NULL ;int status;
@@ -477,7 +477,7 @@ int uncached_readdir(nfs_readdir_descrip status = -ENOMEM ; goto out; } - desc->error =NFS_PROTO (inode)->readdir (file->f_dentry, cred, *desc->dir_cookie, + desc->error =NFS_PROTO (inode)->readdir (file->f_path.dentry, cred, *desc->dir_cookie, page,NFS_SERVER (inode)->dtsize, desc->plus);
@@ -516,7 +516,7 @@ int uncached_readdir(nfs_readdir_descrip*/ static int nfs_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;nfs_readdir_descriptor_t my_desc, *desc = &my_desc;
@@ -599,7 +599,7 @@ static int nfs_readdir(struct file *filploff_t nfs_llseek_dir (struct file *filp,loff_t offset,int origin) { -mutex_lock (&filp->f_dentry->d_inode->i_mutex); +mutex_lock (&filp->f_path.dentry->d_inode->i_mutex);switch (origin) {case 1 : offset += filp->f_pos;
@@ -615,7 +615,7 @@ loff_t nfs_llseek_dir(struct file *filp, ((struct nfs_open_context *)filp->private_data)->dir_cookie =0 ; } out: -mutex_unlock (&filp->f_dentry->d_inode->i_mutex); +mutex_unlock (&filp->f_path.dentry->d_inode->i_mutex);return offset; }
@@ -1093,7 +1093,7 @@ no_open:static struct dentry *nfs_readdir_lookup (nfs_readdir_descriptor_t *desc) { -struct dentry *parent = desc->file->f_dentry; +struct dentry *parent = desc->file->f_path.dentry;struct inode *dir = parent->d_inode;struct nfs_entry *entry = desc->entry;struct dentry *dentry, *alias;
fs/nfs/direct.c +5 -5
@@ -116,7 +116,7 @@ ssize_t nfs_direct_IO(int rw, struct kiossize_t nfs_direct_IO (int rw,struct kiocb *iocb,const struct iovec *iov,loff_t pos,unsigned long nr_segs) {dprintk ("NFS: nfs_direct_IO (%s) off/no(%Ld/%lu) EINVAL\n" , - iocb->ki_filp->f_dentry->d_name.name, + iocb->ki_filp->f_path.dentry->d_name.name, (long long ) pos, nr_segs);return -EINVAL ;
@@ -740,8 +740,8 @@ ssize_t nfs_file_direct_read(struct kiocsize_t count = iov[0 ].iov_len;dprintk ("nfs: direct read(%s/%s, %lu@%Ld)\n" , - file->f_dentry->d_parent->d_name.name, - file->f_dentry->d_name.name, + file->f_path.dentry->d_parent->d_name.name, + file->f_path.dentry->d_name.name, (unsigned long ) count, (long long ) pos);if (nr_segs !=1 )
@@ -804,8 +804,8 @@ ssize_t nfs_file_direct_write(struct kiosize_t count = iov[0 ].iov_len;dfprintk (VFS ,"nfs: direct write(%s/%s, %lu@%Ld)\n" , - file->f_dentry->d_parent->d_name.name, - file->f_dentry->d_name.name, + file->f_path.dentry->d_parent->d_name.name, + file->f_path.dentry->d_name.name, (unsigned long ) count, (long long ) pos);if (nr_segs !=1 )
fs/nfs/file.c +7 -7
@@ -176,7 +176,7 @@ nfs_file_flush(struct file *file, fl_own nfs_file_flush(struct file *file, fl_owner_t id) {struct nfs_open_context *ctx = (struct nfs_open_context *)file->private_data; -struct inode *inode = file->f_dentry->d_inode; +struct inode *inode = file->f_path.dentry->d_inode;int status;dfprintk (VFS ,"nfs: flush(%s/%ld)\n" , inode->i_sb->s_id, inode->i_ino);
@@ -201,7 +201,7 @@ nfs_file_read(struct kiocb *iocb, const nfs_file_read(struct kiocb *iocb, const struct iovec *iov, unsigned long nr_segs, loff_t pos) { - struct dentry * dentry = iocb->ki_filp->f_dentry; + struct dentry * dentry = iocb->ki_filp->f_path.dentry;struct inode * inode = dentry->d_inode;ssize_t result;size_t count =iov_length (iov, nr_segs);
@@ -226,7 +226,7 @@ nfs_file_sendfile(struct file *filp, lof nfs_file_sendfile(struct file *filp, loff_t *ppos, size_t count, read_actor_t actor, void *target) { - struct dentry *dentry = filp->f_dentry; + struct dentry *dentry = filp->f_path.dentry;struct inode *inode = dentry->d_inode;ssize_t res;
@@ -243,7 +243,7 @@ static intstatic int nfs_file_mmap (struct file * file,struct vm_area_struct * vma) { -struct dentry *dentry = file->f_dentry; +struct dentry *dentry = file->f_path.dentry;struct inode *inode = dentry->d_inode;int status;
@@ -343,7 +343,7 @@ static ssize_t nfs_file_write(struct kiostatic ssize_t nfs_file_write (struct kiocb *iocb,const struct iovec *iov,unsigned long nr_segs,loff_t pos) { -struct dentry * dentry = iocb->ki_filp->f_dentry; +struct dentry * dentry = iocb->ki_filp->f_path.dentry;struct inode * inode = dentry->d_inode;ssize_t result;size_t count =iov_length (iov, nr_segs);
@@ -529,8 +529,8 @@ static int nfs_flock(struct file *filp,static int nfs_flock (struct file *filp,int cmd,struct file_lock *fl) {dprintk ("NFS: nfs_flock(f=%s/%ld, t=%x, fl=%x)\n" , - filp->f_dentry->d_inode->i_sb->s_id, - filp->f_dentry->d_inode->i_ino, + filp->f_path.dentry->d_inode->i_sb->s_id, + filp->f_path.dentry->d_inode->i_ino, fl->fl_type, fl->fl_flags);/*
fs/nfs/idmap.c +1 -1
@@ -377,7 +377,7 @@ static ssize_tstatic ssize_t idmap_pipe_downcall (struct file *filp,const char __user *src,size_t mlen) { -struct rpc_inode *rpci =RPC_I (filp->f_dentry->d_inode); +struct rpc_inode *rpci =RPC_I (filp->f_path.dentry->d_inode);struct idmap *idmap = (struct idmap *)rpci->private;struct idmap_msg im_in, *im = &idmap->idmap_im;struct idmap_hashtable *h;
fs/nfs/inode.c +3 -3
@@ -496,7 +496,7 @@ void put_nfs_open_context(struct nfs_ope*/ static void nfs_file_set_open_context (struct file *filp,struct nfs_open_context *ctx) { -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;struct nfs_inode *nfsi =NFS_I (inode); filp->private_data =get_nfs_open_context (ctx);
@@ -528,7 +528,7 @@ struct nfs_open_context *nfs_find_open_cstatic void nfs_file_clear_open_context (struct file *filp) { -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;struct nfs_open_context *ctx = (struct nfs_open_context *)filp->private_data;if (ctx) {
@@ -551,7 +551,7 @@ int nfs_open(struct inode *inode, struct cred =rpcauth_lookupcred (NFS_CLIENT (inode)->cl_auth,0 );if (IS_ERR (cred))return PTR_ERR (cred); - ctx =alloc_nfs_open_context (filp->f_vfsmnt, filp->f_dentry, cred); + ctx =alloc_nfs_open_context (filp->f_path.mnt, filp->f_path.dentry, cred);put_rpccred (cred);if (ctx ==NULL )return -ENOMEM ;
fs/nfs/nfs3proc.c +1 -1
@@ -889,7 +889,7 @@ static intstatic int nfs3_proc_lock (struct file *filp,int cmd,struct file_lock *fl) { -return nlmclnt_proc (filp->f_dentry->d_inode, cmd, fl); +return nlmclnt_proc (filp->f_path.dentry->d_inode, cmd, fl); }const struct nfs_rpc_ops nfs_v3_clientops = {
fs/nfs/proc.c +1 -1
@@ -680,7 +680,7 @@ static intstatic int nfs_proc_lock (struct file *filp,int cmd,struct file_lock *fl) { -return nlmclnt_proc (filp->f_dentry->d_inode, cmd, fl); +return nlmclnt_proc (filp->f_path.dentry->d_inode, cmd, fl); }
fs/nfs/write.c +2 -2
@@ -823,8 +823,8 @@ int nfs_updatepage(struct file *file, stnfs_inc_stats (inode,NFSIOS_VFSUPDATEPAGE );dprintk ("NFS: nfs_updatepage(%s/%s %d@%Ld)\n" , - file->f_dentry->d_parent->d_name.name, - file->f_dentry->d_name.name, count, + file->f_path.dentry->d_parent->d_name.name, + file->f_path.dentry->d_name.name, count, (long long )(page_offset (page) +offset));if (IS_SYNC (inode)) {
PATCH 1/1 configfs: change uses of f_{dentry, vfsmnt} to use f_path
In reply to JosefJeff SipekFrom: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the configfs filesystem.
---
2 files changed, 11 insertions(+), 11 deletions(-) fs/configfs/dir.c | 10 +++++----- fs/configfs/file.c | 12 ++++++------
fs/configfs/dir.c +5 -5
@@ -980,7 +980,7 @@ int configfs_rename_dir(struct config_itstatic int configfs_dir_open (struct inode *inode,struct file *file) { -struct dentry * dentry = file->f_dentry; +struct dentry * dentry = file->f_path.dentry;struct configfs_dirent * parent_sd = dentry->d_fsdata;mutex_lock (&dentry->d_inode->i_mutex);
@@ -993,7 +993,7 @@ static int configfs_dir_open(struct inodstatic int configfs_dir_close (struct inode *inode,struct file *file) { -struct dentry * dentry = file->f_dentry; +struct dentry * dentry = file->f_path.dentry;struct configfs_dirent * cursor = file->private_data;mutex_lock (&dentry->d_inode->i_mutex);
@@ -1013,7 +1013,7 @@ static inline unsigned char dt_type(strustatic int configfs_readdir (struct file * filp,void * dirent,filldir_t filldir) { -struct dentry *dentry = filp->f_dentry; +struct dentry *dentry = filp->f_path.dentry;struct configfs_dirent * parent_sd = dentry->d_fsdata;struct configfs_dirent *cursor = filp->private_data;struct list_head *p, *q = &cursor->s_sibling;
@@ -1070,7 +1070,7 @@ static int configfs_readdir(struct filestatic loff_t configfs_dir_lseek (struct file * file,loff_t offset,int origin) { -struct dentry * dentry = file->f_dentry; +struct dentry * dentry = file->f_path.dentry;mutex_lock (&dentry->d_inode->i_mutex);switch (origin) {
@@ -1080,7 +1080,7 @@ static loff_t configfs_dir_lseek(structif (offset >=0 )break ;default : -mutex_unlock (&file->f_dentry->d_inode->i_mutex); +mutex_unlock (&file->f_path.dentry->d_inode->i_mutex);return -EINVAL ; }if (offset != file->f_pos) {
fs/configfs/file.c +6 -6
@@ -134,7 +134,7 @@ configfs_read_file(struct file *file, chdown (&buffer->sem);if (buffer->needs_read_fill) { -if ((retval =fill_read_buffer (file->f_dentry,buffer))) +if ((retval =fill_read_buffer (file->f_path.dentry,buffer))) goto out; } pr_debug("%s: count = %zd, ppos = %lld, buf = %s\n",
@@ -222,7 +222,7 @@ configfs_write_file(struct file *file, cdown (&buffer->sem); len =fill_write_buffer (buffer, buf, count);if (len >0 ) - len =flush_write_buffer (file->f_dentry, buffer, count); + len =flush_write_buffer (file->f_path.dentry, buffer, count);if (len >0 ) *ppos += len;up (&buffer->sem);
@@ -231,8 +231,8 @@ configfs_write_file(struct file *file, cstatic int check_perm (struct inode * inode,struct file * file) { -struct config_item *item =configfs_get_config_item (file->f_dentry->d_parent); -struct configfs_attribute * attr =to_attr (file->f_dentry); +struct config_item *item =configfs_get_config_item (file->f_path.dentry->d_parent); +struct configfs_attribute * attr =to_attr (file->f_path.dentry);struct configfs_buffer * buffer;struct configfs_item_operations * ops =NULL ;int error =0 ;
@@ -305,8 +305,8 @@ static int configfs_open_file(struct inostatic int configfs_release (struct inode * inode,struct file * filp) { -struct config_item * item =to_item (filp->f_dentry->d_parent); -struct configfs_attribute * attr =to_attr (filp->f_dentry); +struct config_item * item =to_item (filp->f_path.dentry->d_parent); +struct configfs_attribute * attr =to_attr (filp->f_path.dentry);struct module * owner = attr->ca_owner;struct configfs_buffer * buffer = filp->private_data;
PATCH 1/1 affs: change uses of f_{dentry, vfsmnt} to use f_path
In reply to JosefJeff SipekFrom: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the affs filesystem.
---
1 file changed, 2 insertions(+), 2 deletions(-)
fs/affs/dir.c | 4 ++--
fs/affs/dir.c +2 -2
@@ -41,7 +41,7 @@ static intstatic int affs_readdir (struct file *filp,void *dirent,filldir_t filldir) { -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;struct super_block *sb = inode->i_sb;struct buffer_head *dir_bh;struct buffer_head *fh_bh;
@@ -71,7 +71,7 @@ affs_readdir(struct file *filp, void *di stored++; }if (f_pos ==1 ) { -if (filldir (dirent,".." ,2 , f_pos,parent_ino (filp->f_dentry),DT_DIR ) <0 ) +if (filldir (dirent,".." ,2 , f_pos,parent_ino (filp->f_path.dentry),DT_DIR ) <0 )return stored; filp->f_pos = f_pos =2 ; stored++;
PATCH 1/1 cifs: change uses of f_{dentry, vfsmnt} to use f_path
In reply to JosefJeff SipekFrom: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the cifs filesystem.
---
4 files changed, 77 insertions(+), 77 deletions(-) fs/cifs/cifsfs.c | 4 - fs/cifs/fcntl.c | 4 - fs/cifs/file.c | 114 ++++++++++++++++++++++++++--------------------------- fs/cifs/readdir.c | 32 +++++++-------
fs/cifs/cifsfs.c +2 -2
@@ -497,7 +497,7 @@ static ssize_t cifs_file_aio_write(strucstatic ssize_t cifs_file_aio_write (struct kiocb *iocb,const struct iovec *iov,unsigned long nr_segs,loff_t pos) { -struct inode *inode = iocb->ki_filp->f_dentry->d_inode; +struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode;ssize_t written; written =generic_file_aio_write (iocb, iov, nr_segs, pos);
@@ -510,7 +510,7 @@ static loff_t cifs_llseek(struct file *f {/* origin == SEEK_END => we must revalidate the cached file length */ if (origin ==SEEK_END ) { -int retval =cifs_revalidate (file->f_dentry); +int retval =cifs_revalidate (file->f_path.dentry);if (retval <0 )return (loff_t )retval; }
fs/cifs/fcntl.c +2 -2
@@ -83,10 +83,10 @@ int cifs_dir_notify(struct file * file,return 0 ; xid =GetXid (); - cifs_sb =CIFS_SB (file->f_dentry->d_sb); + cifs_sb =CIFS_SB (file->f_path.dentry->d_sb); pTcon = cifs_sb->tcon; - full_path =build_path_from_dentry (file->f_dentry); + full_path =build_path_from_dentry (file->f_path.dentry);if (full_path ==NULL ) { rc = -ENOMEM ;
fs/cifs/file.c +57 -57
346 lines not on this page · raw message
fs/cifs/readdir.c +16 -16
@@ -68,30 +68,30 @@ static int construct_dentry(struct qstrint rc =0 ;cFYI (1 , ("For %s" , qstring->name)); - cifs_sb =CIFS_SB (file->f_dentry->d_sb); + cifs_sb =CIFS_SB (file->f_path.dentry->d_sb); pTcon = cifs_sb->tcon; qstring->hash =full_name_hash (qstring->name, qstring->len); - tmp_dentry =d_lookup (file->f_dentry, qstring); + tmp_dentry =d_lookup (file->f_path.dentry, qstring);if (tmp_dentry) {cFYI (0 , ("existing dentry with inode 0x%p" , tmp_dentry->d_inode)); *ptmp_inode = tmp_dentry->d_inode;/* BB overwrite old name? i.e. tmp_dentry->d_name and tmp_dentry->d_name.len??*/ if (*ptmp_inode ==NULL ) { - *ptmp_inode =new_inode (file->f_dentry->d_sb); + *ptmp_inode =new_inode (file->f_path.dentry->d_sb);if (*ptmp_inode ==NULL )return rc; rc =1 ; } }else { - tmp_dentry =d_alloc (file->f_dentry, qstring); + tmp_dentry =d_alloc (file->f_path.dentry, qstring);if (tmp_dentry ==NULL ) {cERROR (1 ,("Failed allocating dentry" )); *ptmp_inode =NULL ;return rc; } - *ptmp_inode =new_inode (file->f_dentry->d_sb); + *ptmp_inode =new_inode (file->f_path.dentry->d_sb);if (pTcon->nocase) tmp_dentry->d_op = &cifs_ci_dentry_ops;else
@@ -432,10 +432,10 @@ static int initiate_cifs_search(const in cifsFile->invalidHandle = TRUE; cifsFile->srch_inf.endOfSearch = FALSE; -if (file->f_dentry ==NULL ) +if (file->f_path.dentry ==NULL )return -ENOENT ; - cifs_sb =CIFS_SB (file->f_dentry->d_sb); + cifs_sb =CIFS_SB (file->f_path.dentry->d_sb);if (cifs_sb ==NULL )return -EINVAL ;
@@ -443,7 +443,7 @@ static int initiate_cifs_search(const inif (pTcon ==NULL )return -EINVAL ; - full_path =build_path_from_dentry (file->f_dentry); + full_path =build_path_from_dentry (file->f_path.dentry);if (full_path ==NULL ) {return -ENOMEM ;
@@ -609,10 +609,10 @@ static int is_dir_changed(struct file *struct inode * inode;struct cifsInodeInfo *cifsInfo; -if (file->f_dentry ==NULL ) +if (file->f_path.dentry ==NULL )return 0 ; - inode = file->f_dentry->d_inode; + inode = file->f_path.dentry->d_inode;if (inode ==NULL )return 0 ;
@@ -839,7 +839,7 @@ static int cifs_filldir(char *pfindEntryif ((scratch_buf ==NULL ) || (pfindEntry ==NULL ) || (pCifsF ==NULL ))return -ENOENT ; -if (file->f_dentry ==NULL ) +if (file->f_path.dentry ==NULL )return -ENOENT ; rc =cifs_entry_is_dot (pfindEntry,pCifsF);
@@ -847,7 +847,7 @@ static int cifs_filldir(char *pfindEntryif (rc !=0 )return 0 ; - cifs_sb =CIFS_SB (file->f_dentry->d_sb); + cifs_sb =CIFS_SB (file->f_path.dentry->d_sb); qstring.name = scratch_buf; rc = cifs_get_name_from_search_buf(&qstring,pfindEntry,
@@ -981,12 +981,12 @@ int cifs_readdir(struct file *file, void xid =GetXid (); -if (file->f_dentry ==NULL ) { +if (file->f_path.dentry ==NULL ) {FreeXid (xid);return -EIO ; } - cifs_sb =CIFS_SB (file->f_dentry->d_sb); + cifs_sb =CIFS_SB (file->f_path.dentry->d_sb); pTcon = cifs_sb->tcon;if (pTcon ==NULL )return -EINVAL ;
@@ -994,7 +994,7 @@ int cifs_readdir(struct file *file, voidswitch ((int ) file->f_pos) {case 0 :if (filldir (direntry,"." ,1 , file->f_pos, - file->f_dentry->d_inode->i_ino,DT_DIR ) <0 ) { + file->f_path.dentry->d_inode->i_ino,DT_DIR ) <0 ) {cERROR (1 , ("Filldir for current dir failed" )); rc = -ENOMEM ;break ;
@@ -1002,7 +1002,7 @@ int cifs_readdir(struct file *file, void file->f_pos++;case 1 :if (filldir (direntry,".." ,2 , file->f_pos, - file->f_dentry->d_parent->d_inode->i_ino,DT_DIR ) <0 ) { + file->f_path.dentry->d_parent->d_inode->i_ino,DT_DIR ) <0 ) {cERROR (1 , ("Filldir for parent dir failed" )); rc = -ENOMEM ;break ;
PATCH 1/1 ext2: change uses of f_{dentry, vfsmnt} to use f_path
In reply to JosefJeff SipekFrom: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the ext2 filesystem.
---
2 files changed, 2 insertions(+), 2 deletions(-) fs/ext2/dir.c | 2 +- fs/ext2/ioctl.c | 2 +-
fs/ext2/dir.c +1 -1
@@ -248,7 +248,7 @@ ext2_readdir (struct file * filp, void * ext2_readdir (struct file * filp, void * dirent, filldir_t filldir) { loff_t pos = filp->f_pos; -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;struct super_block *sb = inode->i_sb;unsigned int offset = pos & ~PAGE_CACHE_MASK ;unsigned long n = pos >>PAGE_CACHE_SHIFT ;
fs/ext2/ioctl.c +1 -1
@@ -86,7 +86,7 @@ int ext2_ioctl (struct inode * inode, st#ifdef CONFIG_COMPAT long ext2_compat_ioctl (struct file *file,unsigned int cmd,unsigned long arg) { -struct inode *inode = file->f_dentry->d_inode; +struct inode *inode = file->f_path.dentry->d_inode;int ret;/* These are just misnamed, they actually get/put from/to user an int */
PATCH 1/1 ntfs: change uses of f_{dentry, vfsmnt} to use f_path
In reply to JosefJeff SipekFrom: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the ntfs filesystem code.
---
2 files changed, 4 insertions(+), 4 deletions(-) fs/ntfs/dir.c | 6 +++--- fs/ntfs/file.c | 2 +-
fs/ntfs/dir.c +3 -3
@@ -1101,7 +1101,7 @@ static int ntfs_readdir(struct file *fil {s64 ia_pos, ia_start, prev_ia_pos, bmp_pos;loff_t fpos, i_size; -struct inode *bmp_vi, *vdir = filp->f_dentry->d_inode; +struct inode *bmp_vi, *vdir = filp->f_path.dentry->d_inode;struct super_block *sb = vdir->i_sb;ntfs_inode *ndir =NTFS_I (vdir);ntfs_volume *vol =NTFS_SB (sb);
@@ -1136,9 +1136,9 @@ static int ntfs_readdir(struct file *filif (fpos ==1 ) {ntfs_debug ("Calling filldir for .. with len 2, fpos 0x1, " "inode 0x%lx, DT_DIR." , - (unsigned long )parent_ino (filp->f_dentry)); + (unsigned long )parent_ino (filp->f_path.dentry)); rc =filldir (dirent,".." ,2 , fpos, -parent_ino (filp->f_dentry),DT_DIR ); +parent_ino (filp->f_path.dentry),DT_DIR );if (rc) goto done; fpos++;
fs/ntfs/file.c +1 -1
@@ -2162,7 +2162,7 @@ static ssize_t ntfs_file_aio_write_noloc goto out;if (!count) goto out; - err =remove_suid (file->f_dentry); + err =remove_suid (file->f_path.dentry);if (err) goto out;file_update_time (file);
PATCH 1/1 fat: change uses of f_{dentry,vfsmnt} to use f_path
In reply to JosefJeff SipekFrom: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the fat filesystem.
---
2 files changed, 4 insertions(+), 4 deletions(-) fs/fat/dir.c | 6 +++--- fs/fat/file.c | 2 +-
fs/fat/dir.c +3 -3
@@ -579,7 +579,7 @@ parse_record:if (!memcmp (de->name,MSDOS_DOT ,MSDOS_NAME )) inum = inode->i_ino;else if (!memcmp (de->name,MSDOS_DOTDOT ,MSDOS_NAME )) { - inum =parent_ino (filp->f_dentry); + inum =parent_ino (filp->f_path.dentry); }else {loff_t i_pos =fat_make_i_pos (sb, bh, de);struct inode *tmp =fat_iget (sb, i_pos);
@@ -643,7 +643,7 @@ out:static int fat_readdir (struct file *filp,void *dirent,filldir_t filldir) { -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;return __fat_readdir (inode, filp, dirent, filldir,0 ,0 ); }
@@ -782,7 +782,7 @@ static long fat_compat_dir_ioctl(structset_fs (KERNEL_DS );lock_kernel (); - ret =fat_dir_ioctl (file->f_dentry->d_inode, file, + ret =fat_dir_ioctl (file->f_path.dentry->d_inode, file, cmd, (unsigned long ) &d);unlock_kernel ();set_fs (oldfs);
fs/fat/file.c +1 -1
@@ -92,7 +92,7 @@ int fat_generic_ioctl(struct inode *inod }/* This MUST be done before doing anything irreversible... */ - err =notify_change (filp->f_dentry, &ia); + err =notify_change (filp->f_path.dentry, &ia);if (err) goto up;
PATCH 1/1 mm: change uses of f_{dentry,vfsmnt} to use f_path
In reply to JosefJeff SipekFrom: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in linux/mm/.
---
6 files changed, 21 insertions(+), 21 deletions(-) mm/fadvise.c | 2 +- mm/filemap.c | 2 +- mm/filemap_xip.c | 2 +- mm/mmap.c | 10 +++++----- mm/shmem.c | 20 ++++++++++---------- mm/swapfile.c | 6 +++---
mm/fadvise.c +1 -1
@@ -38,7 +38,7 @@ asmlinkage long sys_fadvise64_64(int fd,if (!file)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 ; goto out; }
mm/filemap.c +1 -1
@@ -2267,7 +2267,7 @@ __generic_file_aio_write_nolock(struct kif (count ==0 ) goto out; - err =remove_suid (file->f_dentry); + err =remove_suid (file->f_path.dentry);if (err) goto out;
mm/filemap_xip.c +1 -1
@@ -379,7 +379,7 @@ xip_file_write(struct file *filp, constif (count ==0 ) goto out_backing; - ret =remove_suid (filp->f_dentry); + ret =remove_suid (filp->f_path.dentry);if (ret) goto out_backing;
mm/mmap.c +5 -5
@@ -188,7 +188,7 @@ static void __remove_shared_vm_struct(st struct file *file, struct address_space *mapping) {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 ) mapping->i_mmap_writable--;
@@ -399,7 +399,7 @@ static inline void __vma_link_file(strucstruct address_space *mapping = file->f_mapping;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 ) mapping->i_mmap_writable++;
@@ -907,7 +907,7 @@ unsigned long do_mmap_pgoff(struct file* mounted, in which case we dont add PROT_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 ;if (!len)
@@ -960,7 +960,7 @@ unsigned long do_mmap_pgoff(struct filereturn -EAGAIN ; } - inode = file ? file->f_dentry->d_inode :NULL ; + inode = file ? file->f_path.dentry->d_inode :NULL ;if (file) {switch (flags &MAP_TYPE ) {
@@ -989,7 +989,7 @@ unsigned long do_mmap_pgoff(struct filecase MAP_PRIVATE :if (!(file->f_mode &FMODE_READ ))return -EACCES ; -if (file->f_vfsmnt->mnt_flags &MNT_NOEXEC ) { +if (file->f_path.mnt->mnt_flags &MNT_NOEXEC ) {if (vm_flags &VM_EXEC )return -EPERM ; vm_flags &= ~VM_MAYEXEC ;
mm/shmem.c +10 -10
@@ -1225,7 +1225,7 @@ failed: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 ;unsigned long idx;int error;
@@ -1248,7 +1248,7 @@ static int shmem_populate(struct vm_area unsigned long addr, unsigned long len, 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;enum sgp_type sgp = nonblock?SGP_QUICK :SGP_CACHE ;unsigned long size;
@@ -1293,14 +1293,14 @@ static int shmem_populate(struct vm_area#ifdef CONFIG_NUMA 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); }struct mempolicy *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; idx = ((addr - vma->vm_start) >>PAGE_SHIFT ) + vma->vm_pgoff;
@@ -1310,7 +1310,7 @@ shmem_get_policy(struct vm_area_struct *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);int retval = -ENOMEM ;
@@ -1422,7 +1422,7 @@ static ssize_tstatic ssize_t 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;unsigned long written;ssize_t err;
@@ -1442,7 +1442,7 @@ shmem_file_write(struct file *file, consif (err || !count) goto out; - err =remove_suid (file->f_dentry); + err =remove_suid (file->f_path.dentry);if (err) 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) { -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;struct address_space *mapping = inode->i_mapping;unsigned long index, offset;
@@ -2493,8 +2493,8 @@ struct file *shmem_file_setup(char *named_instantiate (dentry, inode); inode->i_size = size; inode->i_nlink =0 ;/* It is unlinked */ - file->f_vfsmnt =mntget (shm_mnt); - file->f_dentry = dentry; + file->f_path.mnt =mntget (shm_mnt); + file->f_path.dentry = dentry; file->f_mapping = inode->i_mapping; file->f_op = &shmem_file_operations; file->f_mode =FMODE_WRITE |FMODE_READ ;
mm/swapfile.c +3 -3
@@ -447,7 +447,7 @@ int swap_type_of(dev_t device)spin_unlock (&swap_lock);return i; } - inode = swap_info[i].swap_file->f_dentry->d_inode; + inode = swap_info[i].swap_file->f_path.dentry->d_inode;if (S_ISBLK (inode->i_mode) && device ==MKDEV (imajor (inode),iminor (inode))) {spin_unlock (&swap_lock);
@@ -1314,10 +1314,10 @@ static int swap_show(struct seq_file *swseq_puts (swap,"Filename\t\t\t\tType\t\tSize\tUsed\tPriority\n" ); 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", 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", ptr->pages << (PAGE_SHIFT - 10), ptr->inuse_pages << (PAGE_SHIFT - 10),
PATCH 1/1 proc: change uses of f_{dentry, vfsmnt} to use f_path
In reply to JosefJeff SipekFrom: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the proc filesystem code.
---
5 files changed, 33 insertions(+), 33 deletions(-) fs/proc/base.c | 40 ++++++++++++++++++++-------------------- fs/proc/generic.c | 10 +++++----- fs/proc/nommu.c | 4 ++-- fs/proc/task_mmu.c | 8 ++++---- fs/proc/task_nommu.c | 4 ++--
fs/proc/base.c +20 -20
@@ -471,7 +471,7 @@ static ssize_t proc_info_read(struct filstatic ssize_t proc_info_read (struct file * file,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;unsigned long page;ssize_t length;struct task_struct *task =get_proc_task (inode);
@@ -511,7 +511,7 @@ static ssize_t mem_read(struct file * fistatic ssize_t mem_read (struct file * file,char __user * buf,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;unsigned long src = *ppos;int ret = -ESRCH ;
@@ -583,7 +583,7 @@ static ssize_t mem_write(struct file * f {int copied;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; copied = -ESRCH ;
@@ -653,7 +653,7 @@ static ssize_t oom_adjust_read(struct fistatic ssize_t oom_adjust_read (struct file *file,char __user *buf,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 ];size_t len;int oom_adjust;
@@ -695,7 +695,7 @@ static ssize_t oom_adjust_write(struct freturn -EINVAL ;if (*end =='\n' ) end++; - task =get_proc_task (file->f_dentry->d_inode); + task =get_proc_task (file->f_path.dentry->d_inode);if (!task)return -ESRCH ; task->oomkilladj = oom_adjust;
@@ -715,7 +715,7 @@ static ssize_t proc_loginuid_read(structstatic ssize_t proc_loginuid_read (struct file * file,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;struct task_struct *task =get_proc_task (inode);ssize_t length;char tmpbuf[TMPBUFLEN ];
@@ -731,7 +731,7 @@ static ssize_t proc_loginuid_write(strucstatic ssize_t proc_loginuid_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;char *page, *tmp;ssize_t length;uid_t loginuid;
@@ -782,7 +782,7 @@ static ssize_t seccomp_read(struct filestatic ssize_t seccomp_read (struct file *file,char __user *buf,size_t count,loff_t *ppos) { -struct task_struct *tsk =get_proc_task (file->f_dentry->d_inode); +struct task_struct *tsk =get_proc_task (file->f_path.dentry->d_inode);char __buf[20 ];loff_t __ppos = *ppos;size_t len;
@@ -805,7 +805,7 @@ static ssize_t seccomp_write(struct filestatic ssize_t seccomp_write (struct file *file,const char __user *buf,size_t count,loff_t *ppos) { -struct task_struct *tsk =get_proc_task (file->f_dentry->d_inode); +struct task_struct *tsk =get_proc_task (file->f_path.dentry->d_inode);char __buf[20 ], *end;unsigned int seccomp_mode;ssize_t result;
@@ -1075,7 +1075,7 @@ static int proc_fill_cache(struct file * char *name, int len, 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 qstr qname;ino_t ino =0 ;
@@ -1154,8 +1154,8 @@ static int proc_fd_link(struct inode *inspin_lock (&files->file_lock); file =fcheck_files (files, fd);if (file) { - *mnt =mntget (file->f_vfsmnt); - *dentry =dget (file->f_dentry); + *mnt =mntget (file->f_path.mnt); + *dentry =dget (file->f_path.dentry);spin_unlock (&files->file_lock);put_files_struct (files);return 0 ;
@@ -1290,7 +1290,7 @@ static int proc_fd_fill_cache(struct filstatic 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 task_struct *p =get_proc_task (inode);unsigned int fd, tid, ino;
@@ -1437,7 +1437,7 @@ static int proc_pident_readdir(struct fi {int i;int pid; -struct dentry *dentry = filp->f_dentry; +struct dentry *dentry = filp->f_path.dentry;struct inode *inode = dentry->d_inode;struct task_struct *task =get_proc_task (inode);struct pid_entry *p, *last;
@@ -1493,7 +1493,7 @@ static ssize_t proc_pid_attr_read(structstatic ssize_t proc_pid_attr_read (struct file * file,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;unsigned long page;ssize_t length;struct task_struct *task =get_proc_task (inode);
@@ -1509,7 +1509,7 @@ static ssize_t proc_pid_attr_read(struct goto out; length =security_getprocattr (task, - (char *)file->f_dentry->d_name.name, + (char *)file->f_path.dentry->d_name.name, (void *)page, count);if (length >=0 ) length =simple_read_from_buffer (buf, count, ppos, (char *)page, length);
@@ -1523,7 +1523,7 @@ static ssize_t proc_pid_attr_write(strucstatic ssize_t proc_pid_attr_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;char *page;ssize_t length;struct task_struct *task =get_proc_task (inode);
@@ -1549,7 +1549,7 @@ static ssize_t proc_pid_attr_write(struc goto out_free; length =security_setprocattr (task, - (char *)file->f_dentry->d_name.name, + (char *)file->f_path.dentry->d_name.name, (void *)page, count); out_free:free_page ((unsigned long ) page);
@@ -1990,7 +1990,7 @@ int proc_pid_readdir(struct file * filp,int proc_pid_readdir (struct file * filp,void * dirent,filldir_t filldir) {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;int tgid;
@@ -2231,7 +2231,7 @@ static int proc_task_fill_cache(struct f/* for the /proc/TGID/task/ directories */ 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 task_struct *leader =get_proc_task (inode);struct task_struct *task;
fs/proc/generic.c +5 -5
@@ -52,7 +52,7 @@ proc_file_read(struct file *file, char _ proc_file_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) { - struct inode * inode = file->f_dentry->d_inode; + struct inode * inode = file->f_path.dentry->d_inode;char *page;ssize_t retval=0 ;int eof=0 ;
@@ -203,7 +203,7 @@ proc_file_write(struct file *file, const proc_file_write(struct file *file, const char __user *buffer, 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; dp =PDE (inode);
@@ -432,7 +432,7 @@ int proc_readdir(struct file * filp,struct proc_dir_entry * de;unsigned int ino;int i; -struct inode *inode = filp->f_dentry->d_inode; +struct inode *inode = filp->f_path.dentry->d_inode;int ret =0 ;lock_kernel ();
@@ -453,7 +453,7 @@ int proc_readdir(struct file * filp,/* fall through */ case 1 :if (filldir (dirent,".." ,2 , i, -parent_ino (filp->f_dentry), +parent_ino (filp->f_path.dentry),DT_DIR ) <0 ) goto out; i++;
@@ -558,7 +558,7 @@ static void proc_kill_inodes(struct procfile_list_lock ();list_for_each (p, &sb->s_files) { 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;const struct file_operations *fops;
fs/proc/nommu.c +2 -2
@@ -46,7 +46,7 @@ int nommu_vma_show(struct seq_file *m, s file = vma->vm_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; ino = inode->i_ino; }
@@ -67,7 +67,7 @@ int nommu_vma_show(struct seq_file *m, sif (len <1 ) len =1 ;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' );
fs/proc/task_mmu.c +4 -4
@@ -94,8 +94,8 @@ int proc_exe_link(struct inode *inode, s }if (vma) { - *mnt =mntget (vma->vm_file->f_vfsmnt); - *dentry =dget (vma->vm_file->f_dentry); + *mnt =mntget (vma->vm_file->f_path.mnt); + *dentry =dget (vma->vm_file->f_path.dentry); result =0 ; }
@@ -135,7 +135,7 @@ static int show_map_internal(struct seq_int len;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; ino = inode->i_ino; }
@@ -156,7 +156,7 @@ static int show_map_internal(struct seq_*/ if (file) {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 {const char *name =arch_vma_name (vma);if (!name) {
fs/proc/task_nommu.c +2 -2
@@ -126,8 +126,8 @@ int proc_exe_link(struct inode *inode, s }if (vma) { - *mnt =mntget (vma->vm_file->f_vfsmnt); - *dentry =dget (vma->vm_file->f_dentry); + *mnt =mntget (vma->vm_file->f_path.mnt); + *dentry =dget (vma->vm_file->f_path.dentry); result =0 ; }
PATCH 1/1 sysfs: change uses of f_{dentry, vfsmnt} to use f_path
In reply to JosefJeff SipekFrom: Josef "Jeff" Sipek <[email protected]>
This patch changes all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the sysfs filesystem code.
---
3 files changed, 20 insertions(+), 20 deletions(-) fs/sysfs/bin.c | 14 +++++++------- fs/sysfs/dir.c | 10 +++++----- fs/sysfs/file.c | 16 ++++++++--------
fs/sysfs/bin.c +7 -7
@@ -35,7 +35,7 @@ read(struct file * file, char __user * u read(struct file * file, char __user * userbuf, size_t count, loff_t * off) { char *buffer = file->private_data; -struct dentry *dentry = file->f_dentry; +struct dentry *dentry = file->f_path.dentry;int size = dentry->d_inode->i_size;loff_t offs = *off;int ret;
@@ -81,7 +81,7 @@ static ssize_t write(struct file * file, size_t count, loff_t * off) { char *buffer = file->private_data; -struct dentry *dentry = file->f_dentry; +struct dentry *dentry = file->f_path.dentry;int size = dentry->d_inode->i_size;loff_t offs = *off;
@@ -105,7 +105,7 @@ static ssize_t write(struct file * file,static int mmap (struct file *file,struct vm_area_struct *vma) { -struct dentry *dentry = file->f_dentry; +struct dentry *dentry = file->f_path.dentry;struct bin_attribute *attr =to_bin_attr (dentry);struct kobject *kobj =to_kobj (dentry->d_parent);
@@ -117,8 +117,8 @@ static int mmap(struct file *file, strucstatic int open (struct inode * inode,struct file * file) { -struct kobject *kobj =sysfs_get_kobject (file->f_dentry->d_parent); -struct bin_attribute * attr =to_bin_attr (file->f_dentry); +struct kobject *kobj =sysfs_get_kobject (file->f_path.dentry->d_parent); +struct bin_attribute * attr =to_bin_attr (file->f_path.dentry);int error = -EINVAL ;if (!kobj || !attr)
@@ -153,8 +153,8 @@ static int open(struct inode * inode, ststatic int release (struct inode * inode,struct file * file) { -struct kobject * kobj =to_kobj (file->f_dentry->d_parent); -struct bin_attribute * attr =to_bin_attr (file->f_dentry); +struct kobject * kobj =to_kobj (file->f_path.dentry->d_parent); +struct bin_attribute * attr =to_bin_attr (file->f_path.dentry);u8 * buffer = file->private_data;if (kobj)
fs/sysfs/dir.c +5 -5
@@ -374,7 +374,7 @@ int sysfs_rename_dir(struct kobject * kostatic int sysfs_dir_open (struct inode *inode,struct file *file) { -struct dentry * dentry = file->f_dentry; +struct dentry * dentry = file->f_path.dentry;struct sysfs_dirent * parent_sd = dentry->d_fsdata;mutex_lock (&dentry->d_inode->i_mutex);
@@ -387,7 +387,7 @@ static int sysfs_dir_open(struct inode *static int sysfs_dir_close (struct inode *inode,struct file *file) { -struct dentry * dentry = file->f_dentry; +struct dentry * dentry = file->f_path.dentry;struct sysfs_dirent * cursor = file->private_data;mutex_lock (&dentry->d_inode->i_mutex);
@@ -407,7 +407,7 @@ static inline unsigned char dt_type(strustatic int sysfs_readdir (struct file * filp,void * dirent,filldir_t filldir) { -struct dentry *dentry = filp->f_dentry; +struct dentry *dentry = filp->f_path.dentry;struct sysfs_dirent * parent_sd = dentry->d_fsdata;struct sysfs_dirent *cursor = filp->private_data;struct list_head *p, *q = &cursor->s_sibling;
@@ -464,7 +464,7 @@ static int sysfs_readdir(struct file * fstatic loff_t sysfs_dir_lseek (struct file * file,loff_t offset,int origin) { -struct dentry * dentry = file->f_dentry; +struct dentry * dentry = file->f_path.dentry;mutex_lock (&dentry->d_inode->i_mutex);switch (origin) {
@@ -474,7 +474,7 @@ static loff_t sysfs_dir_lseek(struct filif (offset >=0 )break ;default : -mutex_unlock (&file->f_dentry->d_inode->i_mutex); +mutex_unlock (&file->f_path.dentry->d_inode->i_mutex);return -EINVAL ; }if (offset != file->f_pos) {
fs/sysfs/file.c +8 -8
@@ -154,7 +154,7 @@ sysfs_read_file(struct file *file, chardown (&buffer->sem);if (buffer->needs_read_fill) { -if ((retval =fill_read_buffer (file->f_dentry,buffer))) +if ((retval =fill_read_buffer (file->f_path.dentry,buffer))) goto out; } pr_debug("%s: count = %zd, ppos = %lld, buf = %s\n",
@@ -242,7 +242,7 @@ sysfs_write_file(struct file *file, consdown (&buffer->sem); len =fill_write_buffer (buffer, buf, count);if (len >0 ) - len =flush_write_buffer (file->f_dentry, buffer, len); + len =flush_write_buffer (file->f_path.dentry, buffer, len);if (len >0 ) *ppos += len;up (&buffer->sem);
@@ -251,8 +251,8 @@ sysfs_write_file(struct file *file, consstatic int check_perm (struct inode * inode,struct file * file) { -struct kobject *kobj =sysfs_get_kobject (file->f_dentry->d_parent); -struct attribute * attr =to_attr (file->f_dentry); +struct kobject *kobj =sysfs_get_kobject (file->f_path.dentry->d_parent); +struct attribute * attr =to_attr (file->f_path.dentry);struct sysfs_buffer * buffer;struct sysfs_ops * ops =NULL ;int error =0 ;
@@ -334,8 +334,8 @@ static int sysfs_open_file(struct inodestatic int sysfs_release (struct inode * inode,struct file * filp) { -struct kobject * kobj =to_kobj (filp->f_dentry->d_parent); -struct attribute * attr =to_attr (filp->f_dentry); +struct kobject * kobj =to_kobj (filp->f_path.dentry->d_parent); +struct attribute * attr =to_attr (filp->f_path.dentry);struct module * owner = attr->owner;struct sysfs_buffer * buffer = filp->private_data;
@@ -369,8 +369,8 @@ static unsigned int sysfs_poll(struct fistatic unsigned int sysfs_poll (struct file *filp,poll_table *wait) {struct sysfs_buffer * buffer = filp->private_data; -struct kobject * kobj =to_kobj (filp->f_dentry->d_parent); -struct sysfs_dirent * sd = filp->f_dentry->d_fsdata; +struct kobject * kobj =to_kobj (filp->f_path.dentry->d_parent); +struct sysfs_dirent * sd = filp->f_path.dentry->d_fsdata;int res =0 ;poll_wait (filp, &kobj->poll, wait);