aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
authorJan Blunck <jblunck@suse.de>2008-02-14 22:38:44 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-15 00:17:09 -0500
commitcf28b4863f9ee8f122e8ff3ac0d403e07ba9c6d9 (patch)
tree65c91f6911b34c32e517938289621ce0e7baeaf3 /fs/dcache.c
parentc32c2f63a9d6c953aaf168c0b2551da9734f76d2 (diff)
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>
Diffstat (limited to 'fs/dcache.c')
-rw-r--r--fs/dcache.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 170efbcb1a9b..7b4b080219f8 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1845,8 +1845,7 @@ Elong:
1845 1845
1846/** 1846/**
1847 * d_path - return the path of a dentry 1847 * d_path - return the path of a dentry
1848 * @dentry: dentry to report 1848 * @path: path to report
1849 * @vfsmnt: vfsmnt to which the dentry belongs
1850 * @buf: buffer to return value in 1849 * @buf: buffer to return value in
1851 * @buflen: buffer length 1850 * @buflen: buffer length
1852 * 1851 *
@@ -1857,8 +1856,7 @@ Elong:
1857 * 1856 *
1858 * "buflen" should be positive. Caller holds the dcache_lock. 1857 * "buflen" should be positive. Caller holds the dcache_lock.
1859 */ 1858 */
1860char *d_path(struct dentry *dentry, struct vfsmount *vfsmnt, 1859char *d_path(struct path *path, char *buf, int buflen)
1861 char *buf, int buflen)
1862{ 1860{
1863 char *res; 1861 char *res;
1864 struct path root; 1862 struct path root;
@@ -1870,15 +1868,15 @@ char *d_path(struct dentry *dentry, struct vfsmount *vfsmnt,
1870 * user wants to identify the object in /proc/pid/fd/. The little hack 1868 * user wants to identify the object in /proc/pid/fd/. The little hack
1871 * below allows us to generate a name for these objects on demand: 1869 * below allows us to generate a name for these objects on demand:
1872 */ 1870 */
1873 if (dentry->d_op && dentry->d_op->d_dname) 1871 if (path->dentry->d_op && path->dentry->d_op->d_dname)
1874 return dentry->d_op->d_dname(dentry, buf, buflen); 1872 return path->dentry->d_op->d_dname(path->dentry, buf, buflen);
1875 1873
1876 read_lock(&current->fs->lock); 1874 read_lock(&current->fs->lock);
1877 root = current->fs->root; 1875 root = current->fs->root;
1878 path_get(&current->fs->root); 1876 path_get(&current->fs->root);
1879 read_unlock(&current->fs->lock); 1877 read_unlock(&current->fs->lock);
1880 spin_lock(&dcache_lock); 1878 spin_lock(&dcache_lock);
1881 res = __d_path(dentry, vfsmnt, &root, buf, buflen); 1879 res = __d_path(path->dentry, path->mnt, &root, buf, buflen);
1882 spin_unlock(&dcache_lock); 1880 spin_unlock(&dcache_lock);
1883 path_put(&root); 1881 path_put(&root);
1884 return res; 1882 return res;