aboutsummaryrefslogtreecommitdiffstats
path: root/fs
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
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')
-rw-r--r--fs/compat_ioctl.c2
-rw-r--r--fs/dcache.c12
-rw-r--r--fs/dcookies.c2
-rw-r--r--fs/nfsd/export.c2
-rw-r--r--fs/proc/base.c2
-rw-r--r--fs/seq_file.c3
6 files changed, 10 insertions, 13 deletions
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index ee32c0eac7c1..c6e72aebd16b 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -2853,7 +2853,7 @@ static void compat_ioctl_error(struct file *filp, unsigned int fd,
2853 /* find the name of the device. */ 2853 /* find the name of the device. */
2854 path = (char *)__get_free_page(GFP_KERNEL); 2854 path = (char *)__get_free_page(GFP_KERNEL);
2855 if (path) { 2855 if (path) {
2856 fn = d_path(filp->f_path.dentry, filp->f_path.mnt, path, PAGE_SIZE); 2856 fn = d_path(&filp->f_path, path, PAGE_SIZE);
2857 if (IS_ERR(fn)) 2857 if (IS_ERR(fn))
2858 fn = "?"; 2858 fn = "?";
2859 } 2859 }
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;
diff --git a/fs/dcookies.c b/fs/dcookies.c
index 13c29f1f711f..855d4b1d619a 100644
--- a/fs/dcookies.c
+++ b/fs/dcookies.c
@@ -171,7 +171,7 @@ asmlinkage long sys_lookup_dcookie(u64 cookie64, char __user * buf, size_t len)
171 goto out; 171 goto out;
172 172
173 /* FIXME: (deleted) ? */ 173 /* FIXME: (deleted) ? */
174 path = d_path(dcs->path.dentry, dcs->path.mnt, kbuf, PAGE_SIZE); 174 path = d_path(&dcs->path, kbuf, PAGE_SIZE);
175 175
176 if (IS_ERR(path)) { 176 if (IS_ERR(path)) {
177 err = PTR_ERR(path); 177 err = PTR_ERR(path);
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 4a85b40eef4f..8a6f7c924c75 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -345,7 +345,7 @@ static void svc_export_request(struct cache_detail *cd,
345 char *pth; 345 char *pth;
346 346
347 qword_add(bpp, blen, exp->ex_client->name); 347 qword_add(bpp, blen, exp->ex_client->name);
348 pth = d_path(exp->ex_path.dentry, exp->ex_path.mnt, *bpp, *blen); 348 pth = d_path(&exp->ex_path, *bpp, *blen);
349 if (IS_ERR(pth)) { 349 if (IS_ERR(pth)) {
350 /* is this correct? */ 350 /* is this correct? */
351 (*bpp)[0] = '\n'; 351 (*bpp)[0] = '\n';
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 47338d92db51..88f8edf18258 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1185,7 +1185,7 @@ static int do_proc_readlink(struct path *path, char __user *buffer, int buflen)
1185 if (!tmp) 1185 if (!tmp)
1186 return -ENOMEM; 1186 return -ENOMEM;
1187 1187
1188 pathname = d_path(path->dentry, path->mnt, tmp, PAGE_SIZE); 1188 pathname = d_path(path, tmp, PAGE_SIZE);
1189 len = PTR_ERR(pathname); 1189 len = PTR_ERR(pathname);
1190 if (IS_ERR(pathname)) 1190 if (IS_ERR(pathname))
1191 goto out; 1191 goto out;
diff --git a/fs/seq_file.c b/fs/seq_file.c
index 8d862907f060..853770274f20 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -346,8 +346,7 @@ int seq_path(struct seq_file *m, struct path *path, char *esc)
346{ 346{
347 if (m->count < m->size) { 347 if (m->count < m->size) {
348 char *s = m->buf + m->count; 348 char *s = m->buf + m->count;
349 char *p = d_path(path->dentry, path->mnt, s, 349 char *p = d_path(path, s, m->size - m->count);
350 m->size - m->count);
351 if (!IS_ERR(p)) { 350 if (!IS_ERR(p)) {
352 while (s <= p) { 351 while (s <= p) {
353 char c = *p++; 352 char c = *p++;