From: Andreas Gruenbacher <agruen@suse.de>
To: Christoph Hellwig <hch@lst.de>
Cc: jblunck@suse.de, linux-kernel@vger.kernel.org,
viro@zeniv.linux.org.uk, tiwai@suse.de
Subject: Re: [patch 09/10] Use struct path in fs_struct
Date: Fri, 28 Sep 2007 22:39:48 +0200 [thread overview]
Message-ID: <200709282239.49088.agruen@suse.de> (raw)
In-Reply-To: <20070928184214.GI14269@lst.de>
On Friday 28 September 2007 20:42, Christoph Hellwig wrote:
> __d_path should probably switch to taking a struct path * aswell.
Indeed, it now easily can. Here we go...
One less parameter 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>
Index: linux-2.6/fs/dcache.c
===================================================================
--- linux-2.6.orig/fs/dcache.c
+++ linux-2.6/fs/dcache.c
@@ -1781,9 +1781,8 @@ 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)
+static char * __d_path(struct dentry *dentry, struct vfsmount *vfsmnt,
+ struct path *root, char *buffer, int buflen)
{
char * end = buffer+buflen;
char * retval;
@@ -1808,7 +1807,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? */
@@ -1870,7 +1869,7 @@ char * d_path(struct dentry *dentry, str
root = *path_get(¤t->fs->root);
read_unlock(¤t->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);
next prev parent reply other threads:[~2007-09-28 20:38 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-27 14:12 [patch 00/10] Use struct path in struct nameidata jblunck
2007-09-27 14:12 ` [patch 01/10] Dont touch fs_struct in drivers jblunck
2007-09-28 18:33 ` Christoph Hellwig
2007-09-27 14:12 ` [patch 02/10] Dont touch fs_struct in usermodehelper jblunck
2007-09-27 17:46 ` Greg KH
2007-09-27 20:39 ` Christoph Hellwig
2007-09-27 21:36 ` Greg KH
2007-09-28 18:33 ` Christoph Hellwig
2007-09-27 14:12 ` [patch 03/10] Remove path_release_on_umount() jblunck
2007-09-28 18:34 ` Christoph Hellwig
2007-09-27 14:12 ` [patch 04/10] Move struct path into its own header jblunck
2007-09-28 18:35 ` Christoph Hellwig
2007-09-27 14:12 ` [patch 05/10] Embed a struct path into struct nameidata instead of nd->{dentry,mnt} jblunck
2007-09-28 18:36 ` Christoph Hellwig
2007-09-27 14:12 ` [patch 06/10] Introduce path_put() jblunck
2007-09-28 18:37 ` Christoph Hellwig
2007-09-27 14:12 ` [patch 07/10] Use path_put() in a few places instead of {mnt,d}put() jblunck
2007-09-28 18:37 ` Christoph Hellwig
2007-09-27 14:12 ` [patch 08/10] Introduce path_get() jblunck
2007-09-28 18:40 ` Christoph Hellwig
2007-09-27 14:12 ` [patch 09/10] Use struct path in fs_struct jblunck
2007-09-28 18:42 ` Christoph Hellwig
2007-09-28 20:39 ` Andreas Gruenbacher [this message]
2007-09-29 9:24 ` Christoph Hellwig
2007-09-29 9:31 ` Christoph Hellwig
2007-09-27 14:12 ` [patch 10/10] Make set_fs_{root,pwd} take a struct path jblunck
2007-09-28 18:42 ` Christoph Hellwig
2007-09-28 20:43 ` [patch] Combine path_put and path_put_conditional Andreas Gruenbacher
2007-09-29 9:25 ` Christoph Hellwig
2007-09-29 12:36 ` Jan Blunck
2007-09-29 22:21 ` Ingo Oeser
2007-10-09 9:16 ` [patch 00/10] Use struct path in struct nameidata Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2007-10-09 18:05 Jan Blunck
2007-10-09 18:05 ` [patch 09/10] Use struct path in fs_struct Jan Blunck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200709282239.49088.agruen@suse.de \
--to=agruen@suse.de \
--cc=hch@lst.de \
--cc=jblunck@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=tiwai@suse.de \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox