Explorar o código

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

Change all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the nfs
client code.

Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Josef "Jeff" Sipek %!s(int64=18) %!d(string=hai) anos
pai
achega
01cce933d8
Modificáronse 8 ficheiros con 29 adicións e 29 borrados
  1. 9 9
      fs/nfs/dir.c
  2. 5 5
      fs/nfs/direct.c
  3. 7 7
      fs/nfs/file.c
  4. 1 1
      fs/nfs/idmap.c
  5. 3 3
      fs/nfs/inode.c
  6. 1 1
      fs/nfs/nfs3proc.c
  7. 1 1
      fs/nfs/proc.c
  8. 2 2
      fs/nfs/write.c

+ 9 - 9
fs/nfs/dir.c

@@ -172,7 +172,7 @@ static
 int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page *page)
 int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page *page)
 {
 {
 	struct file	*file = desc->file;
 	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 rpc_cred	*cred = nfs_file_cred(file);
 	unsigned long	timestamp;
 	unsigned long	timestamp;
 	int		error;
 	int		error;
@@ -183,7 +183,7 @@ int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page *page)
 
 
  again:
  again:
 	timestamp = jiffies;
 	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);
 					  NFS_SERVER(inode)->dtsize, desc->plus);
 	if (error < 0) {
 	if (error < 0) {
 		/* We requested READDIRPLUS, but the server doesn't grok it */
 		/* We requested READDIRPLUS, but the server doesn't grok it */
@@ -308,7 +308,7 @@ int find_dirent_index(nfs_readdir_descriptor_t *desc)
 static inline
 static inline
 int find_dirent_page(nfs_readdir_descriptor_t *desc)
 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;
 	struct page	*page;
 	int		status;
 	int		status;
 
 
@@ -464,7 +464,7 @@ int uncached_readdir(nfs_readdir_descriptor_t *desc, void *dirent,
 		     filldir_t filldir)
 		     filldir_t filldir)
 {
 {
 	struct file	*file = desc->file;
 	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 rpc_cred	*cred = nfs_file_cred(file);
 	struct page	*page = NULL;
 	struct page	*page = NULL;
 	int		status;
 	int		status;
@@ -477,7 +477,7 @@ int uncached_readdir(nfs_readdir_descriptor_t *desc, void *dirent,
 		status = -ENOMEM;
 		status = -ENOMEM;
 		goto out;
 		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,
 						page,
 						NFS_SERVER(inode)->dtsize,
 						NFS_SERVER(inode)->dtsize,
 						desc->plus);
 						desc->plus);
@@ -516,7 +516,7 @@ int uncached_readdir(nfs_readdir_descriptor_t *desc, void *dirent,
  */
  */
 static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
 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;
 	struct inode	*inode = dentry->d_inode;
 	nfs_readdir_descriptor_t my_desc,
 	nfs_readdir_descriptor_t my_desc,
 			*desc = &my_desc;
 			*desc = &my_desc;
@@ -599,7 +599,7 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
 
 
 loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int origin)
 loff_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) {
 	switch (origin) {
 		case 1:
 		case 1:
 			offset += filp->f_pos;
 			offset += filp->f_pos;
@@ -615,7 +615,7 @@ loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int origin)
 		((struct nfs_open_context *)filp->private_data)->dir_cookie = 0;
 		((struct nfs_open_context *)filp->private_data)->dir_cookie = 0;
 	}
 	}
 out:
 out:
-	mutex_unlock(&filp->f_dentry->d_inode->i_mutex);
+	mutex_unlock(&filp->f_path.dentry->d_inode->i_mutex);
 	return offset;
 	return offset;
 }
 }
 
 
@@ -1102,7 +1102,7 @@ no_open:
 
 
 static struct dentry *nfs_readdir_lookup(nfs_readdir_descriptor_t *desc)
 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 inode *dir = parent->d_inode;
 	struct nfs_entry *entry = desc->entry;
 	struct nfs_entry *entry = desc->entry;
 	struct dentry *dentry, *alias;
 	struct dentry *dentry, *alias;

+ 5 - 5
fs/nfs/direct.c

@@ -116,7 +116,7 @@ static inline int put_dreq(struct nfs_direct_req *dreq)
 ssize_t nfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, loff_t pos, unsigned long nr_segs)
 ssize_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",
 	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);
 			(long long) pos, nr_segs);
 
 
 	return -EINVAL;
 	return -EINVAL;
@@ -734,8 +734,8 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, const struct iovec *iov,
 	size_t count = iov[0].iov_len;
 	size_t count = iov[0].iov_len;
 
 
 	dprintk("nfs: direct read(%s/%s, %lu@%Ld)\n",
 	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);
 		(unsigned long) count, (long long) pos);
 
 
 	if (nr_segs != 1)
 	if (nr_segs != 1)
@@ -798,8 +798,8 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, const struct iovec *iov,
 	size_t count = iov[0].iov_len;
 	size_t count = iov[0].iov_len;
 
 
 	dfprintk(VFS, "nfs: direct write(%s/%s, %lu@%Ld)\n",
 	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);
 		(unsigned long) count, (long long) pos);
 
 
 	if (nr_segs != 1)
 	if (nr_segs != 1)

+ 7 - 7
fs/nfs/file.c

@@ -176,7 +176,7 @@ static int
 nfs_file_flush(struct file *file, fl_owner_t id)
 nfs_file_flush(struct file *file, fl_owner_t id)
 {
 {
 	struct nfs_open_context *ctx = (struct nfs_open_context *)file->private_data;
 	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;
 	int		status;
 
 
 	dfprintk(VFS, "nfs: flush(%s/%ld)\n", inode->i_sb->s_id, inode->i_ino);
 	dfprintk(VFS, "nfs: flush(%s/%ld)\n", inode->i_sb->s_id, inode->i_ino);
@@ -201,7 +201,7 @@ static ssize_t
 nfs_file_read(struct kiocb *iocb, const struct iovec *iov,
 nfs_file_read(struct kiocb *iocb, const struct iovec *iov,
 		unsigned long nr_segs, loff_t pos)
 		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;
 	struct inode * inode = dentry->d_inode;
 	ssize_t result;
 	ssize_t result;
 	size_t count = iov_length(iov, nr_segs);
 	size_t count = iov_length(iov, nr_segs);
@@ -226,7 +226,7 @@ static ssize_t
 nfs_file_sendfile(struct file *filp, loff_t *ppos, size_t count,
 nfs_file_sendfile(struct file *filp, loff_t *ppos, size_t count,
 		read_actor_t actor, void *target)
 		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;
 	struct inode *inode = dentry->d_inode;
 	ssize_t res;
 	ssize_t res;
 
 
@@ -243,7 +243,7 @@ nfs_file_sendfile(struct file *filp, loff_t *ppos, size_t count,
 static int
 static int
 nfs_file_mmap(struct file * file, struct vm_area_struct * vma)
 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;
 	struct inode *inode = dentry->d_inode;
 	int	status;
 	int	status;
 
 
@@ -343,7 +343,7 @@ const struct address_space_operations nfs_file_aops = {
 static ssize_t nfs_file_write(struct kiocb *iocb, const struct iovec *iov,
 static ssize_t nfs_file_write(struct kiocb *iocb, const struct iovec *iov,
 				unsigned long nr_segs, loff_t pos)
 				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;
 	struct inode * inode = dentry->d_inode;
 	ssize_t result;
 	ssize_t result;
 	size_t count = iov_length(iov, nr_segs);
 	size_t count = iov_length(iov, nr_segs);
@@ -535,8 +535,8 @@ static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl)
 static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl)
 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",
 	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);
 			fl->fl_type, fl->fl_flags);
 
 
 	/*
 	/*

+ 1 - 1
fs/nfs/idmap.c

@@ -377,7 +377,7 @@ idmap_pipe_upcall(struct file *filp, struct rpc_pipe_msg *msg,
 static ssize_t
 static ssize_t
 idmap_pipe_downcall(struct file *filp, const char __user *src, size_t mlen)
 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 *idmap = (struct idmap *)rpci->private;
 	struct idmap_msg im_in, *im = &idmap->idmap_im;
 	struct idmap_msg im_in, *im = &idmap->idmap_im;
 	struct idmap_hashtable *h;
 	struct idmap_hashtable *h;

+ 3 - 3
fs/nfs/inode.c

@@ -496,7 +496,7 @@ void put_nfs_open_context(struct nfs_open_context *ctx)
  */
  */
 static void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx)
 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);
 	struct nfs_inode *nfsi = NFS_I(inode);
 
 
 	filp->private_data = get_nfs_open_context(ctx);
 	filp->private_data = get_nfs_open_context(ctx);
@@ -528,7 +528,7 @@ struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_c
 
 
 static void nfs_file_clear_open_context(struct file *filp)
 static 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;
 	struct nfs_open_context *ctx = (struct nfs_open_context *)filp->private_data;
 
 
 	if (ctx) {
 	if (ctx) {
@@ -551,7 +551,7 @@ int nfs_open(struct inode *inode, struct file *filp)
 	cred = rpcauth_lookupcred(NFS_CLIENT(inode)->cl_auth, 0);
 	cred = rpcauth_lookupcred(NFS_CLIENT(inode)->cl_auth, 0);
 	if (IS_ERR(cred))
 	if (IS_ERR(cred))
 		return PTR_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);
 	put_rpccred(cred);
 	if (ctx == NULL)
 	if (ctx == NULL)
 		return -ENOMEM;
 		return -ENOMEM;

+ 1 - 1
fs/nfs/nfs3proc.c

@@ -841,7 +841,7 @@ static void nfs3_proc_commit_setup(struct nfs_write_data *data, int how)
 static int
 static int
 nfs3_proc_lock(struct file *filp, int cmd, struct file_lock *fl)
 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 = {
 const struct nfs_rpc_ops nfs_v3_clientops = {

+ 1 - 1
fs/nfs/proc.c

@@ -651,7 +651,7 @@ nfs_proc_commit_setup(struct nfs_write_data *data, int how)
 static int
 static int
 nfs_proc_lock(struct file *filp, int cmd, struct file_lock *fl)
 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);
 }
 }
 
 
 
 

+ 2 - 2
fs/nfs/write.c

@@ -754,8 +754,8 @@ int nfs_updatepage(struct file *file, struct page *page,
 	nfs_inc_stats(inode, NFSIOS_VFSUPDATEPAGE);
 	nfs_inc_stats(inode, NFSIOS_VFSUPDATEPAGE);
 
 
 	dprintk("NFS:      nfs_updatepage(%s/%s %d@%Ld)\n",
 	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));
 		(long long)(page_offset(page) +offset));
 
 
 	/* If we're not using byte range locks, and we know the page
 	/* If we're not using byte range locks, and we know the page