[PATCH 11/13] Make __d_path() to take a struct path argument

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: Jan Blunck <jblunck@...>, Andreas Gruenbacher <agruen@...>, Christoph Hellwig <hch@...>, <viro@...>, <linux-kernel@...>
Date: Monday, October 22, 2007 - 3:02 am

From: Andreas Gruenbacher <agruen@suse.de>

One less argument to __d_path.

All callers to __d_path pass the dentry and vfsmount of a struct
path to __d_path. Pass the struct path directly, instead.

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Acked-by: Christoph Hellwig <hch@lst.de>
---
 fs/dcache.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1779,8 +1779,7 @@ shouldnt_be_hashed:
  * "buflen" should be positive. Caller holds the dcache_lock.
  */
 static char * __d_path( struct dentry *dentry, struct vfsmount *vfsmnt,
-			struct dentry *root, struct vfsmount *rootmnt,
-			char *buffer, int buflen)
+			struct path *root, char *buffer, int buflen)
 {
 	char * end = buffer+buflen;
 	char * retval;
@@ -1805,7 +1804,7 @@ static char * __d_path( struct dentry *d
 	for (;;) {
 		struct dentry * parent;
 
-		if (dentry == root && vfsmnt == rootmnt)
+		if (dentry == root->dentry && vfsmnt == root->mnt)
 			break;
 		if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) {
 			/* Global root? */
@@ -1868,7 +1867,7 @@ char * d_path(struct dentry *dentry, str
 	path_get(&current->fs->root);
 	read_unlock(&current->fs->lock);
 	spin_lock(&dcache_lock);
-	res = __d_path(dentry, vfsmnt, root.dentry, root.mnt, buf, buflen);
+	res = __d_path(dentry, vfsmnt, &root, buf, buflen);
 	spin_unlock(&dcache_lock);
 	path_put(&root);
 	return res;
@@ -1936,8 +1935,7 @@ asmlinkage long sys_getcwd(char __user *
 		unsigned long len;
 		char * cwd;
 
-		cwd = __d_path(pwd.dentry, pwd.mnt, root.dentry, root.mnt,
-			       page, PAGE_SIZE);
+		cwd = __d_path(pwd.dentry, pwd.mnt, &root, page, PAGE_SIZE);
 		spin_unlock(&dcache_lock);
 
 		error = PTR_ERR(cwd);
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/13] Use struct path in struct nameidata, Bharata B Rao, (Mon Oct 22, 2:53 am)
Re: [PATCH 00/13] Use struct path in struct nameidata, Christoph Hellwig, (Mon Oct 22, 9:57 am)
Re: [PATCH 00/13] Use struct path in struct nameidata, Bharata B Rao, (Mon Oct 22, 10:33 pm)
Re: [PATCH 00/13] Use struct path in struct nameidata, Bharata B Rao, (Tue Oct 23, 11:31 pm)
Re: [PATCH 00/13] Use struct path in struct nameidata, Andrew Morton, (Mon Oct 22, 6:56 pm)
Re: [PATCH 13/13] Rename {__}d_path() to {__}print_path() an..., Christoph Hellwig, (Mon Oct 22, 6:14 am)
[PATCH 12/13] Use struct path argument in proc_get_link(), Bharata B Rao, (Mon Oct 22, 3:03 am)
[PATCH 11/13] Make __d_path() to take a struct path argument, Bharata B Rao, (Mon Oct 22, 3:02 am)
[PATCH 10/13] Make set_fs_{root,pwd} take a struct path, Bharata B Rao, (Mon Oct 22, 3:02 am)
[PATCH 09/13] Use struct path in fs_struct, Bharata B Rao, (Mon Oct 22, 3:01 am)
[PATCH 08/13] Introduce path_get(), Bharata B Rao, (Mon Oct 22, 3:00 am)
[PATCH 06/13] Introduce path_put(), Bharata B Rao, (Mon Oct 22, 2:59 am)
[PATCH 04/13] Move struct path into its own header, Bharata B Rao, (Mon Oct 22, 2:57 am)
[PATCH 03/13] Remove path_release_on_umount(), Bharata B Rao, (Mon Oct 22, 2:56 am)
[PATCH 02/13] Don't touch fs_struct in usermodehelper, Bharata B Rao, (Mon Oct 22, 2:55 am)
[PATCH 01/13] Don't touch fs_struct in drivers, Bharata B Rao, (Mon Oct 22, 2:54 am)