aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/blackfin/kernel/traps.c12
-rw-r--r--drivers/md/bitmap.c8
-rw-r--r--drivers/usb/gadget/file_storage.c8
-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
-rw-r--r--include/linux/dcache.h5
-rw-r--r--kernel/audit.c2
-rw-r--r--mm/memory.c2
12 files changed, 24 insertions, 36 deletions
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index 58717cb1970..56a67ab698c 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -126,15 +126,13 @@ static void decode_address(char *buf, unsigned long address)
126 struct vm_area_struct *vma = vml->vma; 126 struct vm_area_struct *vma = vml->vma;
127 127
128 if (address >= vma->vm_start && address < vma->vm_end) { 128 if (address >= vma->vm_start && address < vma->vm_end) {
129 char _tmpbuf[256];
129 char *name = p->comm; 130 char *name = p->comm;
130 struct file *file = vma->vm_file; 131 struct file *file = vma->vm_file;
131 if (file) { 132
132 char _tmpbuf[256]; 133 if (file)
133 name = d_path(file->f_dentry, 134 name = d_path(&file->f_path, _tmpbuf,
134 file->f_vfsmnt, 135 sizeof(_tmpbuf));
135 _tmpbuf,
136 sizeof(_tmpbuf));
137 }
138 136
139 /* FLAT does not have its text aligned to the start of 137 /* FLAT does not have its text aligned to the start of
140 * the map while FDPIC ELF does ... 138 * the map while FDPIC ELF does ...
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index a0585fb6da9..7aeceedcf7d 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -206,16 +206,10 @@ static void bitmap_checkfree(struct bitmap *bitmap, unsigned long page)
206/* copy the pathname of a file to a buffer */ 206/* copy the pathname of a file to a buffer */
207char *file_path(struct file *file, char *buf, int count) 207char *file_path(struct file *file, char *buf, int count)
208{ 208{
209 struct dentry *d;
210 struct vfsmount *v;
211
212 if (!buf) 209 if (!buf)
213 return NULL; 210 return NULL;
214 211
215 d = file->f_path.dentry; 212 buf = d_path(&file->f_path, buf, count);
216 v = file->f_path.mnt;
217
218 buf = d_path(d, v, buf, count);
219 213
220 return IS_ERR(buf) ? NULL : buf; 214 return IS_ERR(buf) ? NULL : buf;
221} 215}
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
index 3301167d4f2..017a196d041 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -3563,8 +3563,7 @@ static ssize_t show_file(struct device *dev, struct device_attribute *attr,
3563 3563
3564 down_read(&fsg->filesem); 3564 down_read(&fsg->filesem);
3565 if (backing_file_is_open(curlun)) { // Get the complete pathname 3565 if (backing_file_is_open(curlun)) { // Get the complete pathname
3566 p = d_path(curlun->filp->f_path.dentry, 3566 p = d_path(&curlun->filp->f_path, buf, PAGE_SIZE - 1);
3567 curlun->filp->f_path.mnt, buf, PAGE_SIZE - 1);
3568 if (IS_ERR(p)) 3567 if (IS_ERR(p))
3569 rc = PTR_ERR(p); 3568 rc = PTR_ERR(p);
3570 else { 3569 else {
@@ -3981,9 +3980,8 @@ static int __init fsg_bind(struct usb_gadget *gadget)
3981 if (backing_file_is_open(curlun)) { 3980 if (backing_file_is_open(curlun)) {
3982 p = NULL; 3981 p = NULL;
3983 if (pathbuf) { 3982 if (pathbuf) {
3984 p = d_path(curlun->filp->f_path.dentry, 3983 p = d_path(&curlun->filp->f_path,
3985 curlun->filp->f_path.mnt, 3984 pathbuf, PATH_MAX);
3986 pathbuf, PATH_MAX);
3987 if (IS_ERR(p)) 3985 if (IS_ERR(p))
3988 p = NULL; 3986 p = NULL;
3989 } 3987 }
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index ee32c0eac7c..c6e72aebd16 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 170efbcb1a9..7b4b080219f 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 13c29f1f711..855d4b1d619 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 4a85b40eef4..8a6f7c924c7 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 47338d92db5..88f8edf1825 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 8d862907f06..853770274f2 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++;
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index c2c153f97e8..6bd646096fa 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -10,6 +10,7 @@
10#include <linux/rcupdate.h> 10#include <linux/rcupdate.h>
11 11
12struct nameidata; 12struct nameidata;
13struct path;
13struct vfsmount; 14struct vfsmount;
14 15
15/* 16/*
@@ -300,8 +301,8 @@ extern int d_validate(struct dentry *, struct dentry *);
300 */ 301 */
301extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...); 302extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...);
302 303
303extern char * d_path(struct dentry *, struct vfsmount *, char *, int); 304extern char *d_path(struct path *, char *, int);
304 305
305/* Allocation counts.. */ 306/* Allocation counts.. */
306 307
307/** 308/**
diff --git a/kernel/audit.c b/kernel/audit.c
index 783e6570124..2eeea9a1424 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -1325,7 +1325,7 @@ void audit_log_d_path(struct audit_buffer *ab, const char *prefix,
1325 audit_log_format(ab, "<no memory>"); 1325 audit_log_format(ab, "<no memory>");
1326 return; 1326 return;
1327 } 1327 }
1328 p = d_path(path->dentry, path->mnt, pathname, PATH_MAX+11); 1328 p = d_path(path, pathname, PATH_MAX+11);
1329 if (IS_ERR(p)) { /* Should never happen since we send PATH_MAX */ 1329 if (IS_ERR(p)) { /* Should never happen since we send PATH_MAX */
1330 /* FIXME: can we save some information here? */ 1330 /* FIXME: can we save some information here? */
1331 audit_log_format(ab, "<too long>"); 1331 audit_log_format(ab, "<too long>");
diff --git a/mm/memory.c b/mm/memory.c
index 717aa0e3be2..e7a6dcacefc 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2719,7 +2719,7 @@ void print_vma_addr(char *prefix, unsigned long ip)
2719 if (buf) { 2719 if (buf) {
2720 char *p, *s; 2720 char *p, *s;
2721 2721
2722 p = d_path(f->f_dentry, f->f_vfsmnt, buf, PAGE_SIZE); 2722 p = d_path(&f->f_path, buf, PAGE_SIZE);
2723 if (IS_ERR(p)) 2723 if (IS_ERR(p))
2724 p = "?"; 2724 p = "?";
2725 s = strrchr(p, '/'); 2725 s = strrchr(p, '/');