From: Jan Blunck <jblunck@suse.de>
To: Linux-Kernel Mailinglist <linux-kernel@vger.kernel.org>,
Christoph Hellwig <hch@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Andreas Gruenbacher <agruen@suse.de>
Subject: [PATCH 1/9] One less parameter to __d_path
Date: Mon, 05 Nov 2007 17:32:33 +0100 [thread overview]
Message-ID: <20071105163232.815259081@hasse.suse.de> (raw)
In-Reply-To: 20071105163232.550298985@hasse.suse.de
[-- Attachment #1: vfs/one-less-parameter-to-__d_path.patch --]
[-- Type: text/plain, Size: 1877 bytes --]
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: Jan Blunck <jblunck@suse.de>
Acked-by: Christoph Hellwig <hch@infradead.org>
---
fs/dcache.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
Index: b/fs/dcache.c
===================================================================
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1778,9 +1778,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;
@@ -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(¤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-11-05 16:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-05 16:32 [PATCH 0/9] struct path related cleanups of d_path() code (V2) Jan Blunck
2007-11-05 16:32 ` Jan Blunck [this message]
2007-11-05 16:32 ` [PATCH 2/9] d_path: kerneldoc cleanup Jan Blunck
2007-11-05 16:32 ` [PATCH 3/9] d_path: Use struct path in struct avc_audit_data Jan Blunck
2007-11-05 16:32 ` [PATCH 4/9] d_path: Make proc_get_link() use a struct path argument Jan Blunck
2007-11-05 16:32 ` [PATCH 5/9] d_path: Make get_dcookie() " Jan Blunck
2007-11-05 16:32 ` [PATCH 6/9] Use struct path in struct svc_export Jan Blunck
2007-11-05 16:32 ` [PATCH 7/9] Use struct path in struct svc_expkey Jan Blunck
2007-11-05 16:43 ` J. Bruce Fields
2007-11-05 16:32 ` [PATCH 8/9] d_path: Make seq_path() use a struct path argument Jan Blunck
2007-11-05 16:32 ` [PATCH 9/9] d_path: Make d_path() use a struct path 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=20071105163232.815259081@hasse.suse.de \
--to=jblunck@suse.de \
--cc=agruen@suse.de \
--cc=akpm@linux-foundation.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
/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