d_path: Make d_path() use a struct path

d_path() is used on a <dentry,vfsmount> pair.  Lets use a struct path to
reflect this.

[akpm@linux-foundation.org: fix build in mm/memory.c]
Signed-off-by: Jan Blunck <jblunck@suse.de>
Acked-by: Bryan Wu <bryan.wu@analog.com>
Acked-by: Christoph Hellwig <hch@infradead.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Neil Brown <neilb@suse.de>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Jan Blunck
2008-02-14 19:38:44 -08:00
committed by Linus Torvalds
parent c32c2f63a9
commit cf28b4863f
12 changed files with 24 additions and 36 deletions

View File

@@ -1845,8 +1845,7 @@ Elong:
/**
* d_path - return the path of a dentry
* @dentry: dentry to report
* @vfsmnt: vfsmnt to which the dentry belongs
* @path: path to report
* @buf: buffer to return value in
* @buflen: buffer length
*
@@ -1857,8 +1856,7 @@ Elong:
*
* "buflen" should be positive. Caller holds the dcache_lock.
*/
char *d_path(struct dentry *dentry, struct vfsmount *vfsmnt,
char *buf, int buflen)
char *d_path(struct path *path, char *buf, int buflen)
{
char *res;
struct path root;
@@ -1870,15 +1868,15 @@ char *d_path(struct dentry *dentry, struct vfsmount *vfsmnt,
* user wants to identify the object in /proc/pid/fd/. The little hack
* below allows us to generate a name for these objects on demand:
*/
if (dentry->d_op && dentry->d_op->d_dname)
return dentry->d_op->d_dname(dentry, buf, buflen);
if (path->dentry->d_op && path->dentry->d_op->d_dname)
return path->dentry->d_op->d_dname(path->dentry, buf, buflen);
read_lock(&current->fs->lock);
root = current->fs->root;
path_get(&current->fs->root);
read_unlock(&current->fs->lock);
spin_lock(&dcache_lock);
res = __d_path(dentry, vfsmnt, &root, buf, buflen);
res = __d_path(path->dentry, path->mnt, &root, buf, buflen);
spin_unlock(&dcache_lock);
path_put(&root);
return res;