···136136 struct file *file = vma->vm_file;137137138138 if (file) {139139- char *d_name = d_path(&file->f_path, _tmpbuf,139139+ char *d_name = file_path(file, _tmpbuf,140140 sizeof(_tmpbuf));141141 if (!IS_ERR(d_name))142142 name = d_name;
+1-1
arch/tile/kernel/stack.c
···334334 }335335336336 if (vma->vm_file) {337337- p = d_path(&vma->vm_file->f_path, buf, bufsize);337337+ p = file_path(vma->vm_file, buf, bufsize);338338 if (IS_ERR(p))339339 p = "?";340340 name = kbasename(p);
···568568569569 spin_lock_irq(&lo->lo_lock);570570 if (lo->lo_backing_file)571571- p = d_path(&lo->lo_backing_file->f_path, buf, PAGE_SIZE - 1);571571+ p = file_path(lo->lo_backing_file, buf, PAGE_SIZE - 1);572572 spin_unlock_irq(&lo->lo_lock);573573574574 if (IS_ERR_OR_NULL(p))
+1-1
drivers/md/bitmap.c
···834834 if (bitmap->storage.file) {835835 path = kmalloc(PAGE_SIZE, GFP_KERNEL);836836 if (path)837837- ptr = d_path(&bitmap->storage.file->f_path,837837+ ptr = file_path(bitmap->storage.file,838838 path, PAGE_SIZE);839839840840 printk(KERN_ALERT
+1-1
drivers/md/md.c
···57415741 /* bitmap disabled, zero the first byte and copy out */57425742 if (!mddev->bitmap_info.file)57435743 file->pathname[0] = '\0';57445744- else if ((ptr = d_path(&mddev->bitmap_info.file->f_path,57445744+ else if ((ptr = file_path(mddev->bitmap_info.file,57455745 file->pathname, sizeof(file->pathname))),57465746 IS_ERR(ptr))57475747 err = PTR_ERR(ptr);
+1-1
drivers/usb/gadget/function/f_mass_storage.c
···29362936 if (fsg_lun_is_open(lun)) {29372937 p = "(error)";29382938 if (pathbuf) {29392939- p = d_path(&lun->filp->f_path, pathbuf, PATH_MAX);29392939+ p = file_path(lun->filp, pathbuf, PATH_MAX);29402940 if (IS_ERR(p))29412941 p = "(error)";29422942 }
+1-1
drivers/usb/gadget/function/storage_common.c
···341341342342 down_read(filesem);343343 if (fsg_lun_is_open(curlun)) { /* Get the complete pathname */344344- p = d_path(&curlun->filp->f_path, buf, PAGE_SIZE - 1);344344+ p = file_path(curlun->filp, buf, PAGE_SIZE - 1);345345 if (IS_ERR(p))346346 rc = PTR_ERR(p);347347 else {
+2-2
fs/binfmt_elf.c
···15301530 file = vma->vm_file;15311531 if (!file)15321532 continue;15331533- filename = d_path(&file->f_path, name_curpos, remaining);15331533+ filename = file_path(file, name_curpos, remaining);15341534 if (IS_ERR(filename)) {15351535 if (PTR_ERR(filename) == -ENAMETOOLONG) {15361536 vfree(data);···15401540 continue;15411541 }1542154215431543- /* d_path() fills at the end, move name down */15431543+ /* file_path() fills at the end, move name down */15441544 /* n = strlen(filename) + 1: */15451545 n = (name_curpos + remaining) - filename;15461546 remaining = filename - name_curpos;
···449449 es = EXT4_SB(inode->i_sb)->s_es;450450 es->s_last_error_ino = cpu_to_le32(inode->i_ino);451451 if (ext4_error_ratelimit(inode->i_sb)) {452452- path = d_path(&(file->f_path), pathname, sizeof(pathname));452452+ path = file_path(file, pathname, sizeof(pathname));453453 if (IS_ERR(path))454454 path = "(unknown)";455455 va_start(args, fmt);
+6
fs/open.c
···823823}824824EXPORT_SYMBOL(finish_no_open);825825826826+char *file_path(struct file *filp, char *buf, int buflen)827827+{828828+ return d_path(&filp->f_path, buf, buflen);829829+}830830+EXPORT_SYMBOL(file_path);831831+826832/**827833 * vfs_open - open the file at the given path828834 * @path: path to open
+2
include/linux/fs.h
···25002500extern int is_subdir(struct dentry *, struct dentry *);25012501extern int path_is_under(struct path *, struct path *);2502250225032503+extern char *file_path(struct file *, char *, int);25042504+25032505#include <linux/err.h>2504250625052507/* needed for stackable file system support */
+1-1
kernel/events/core.c
···57915791 * need to add enough zero bytes after the string to handle57925792 * the 64bit alignment we do later.57935793 */57945794- name = d_path(&file->f_path, buf, PATH_MAX - sizeof(u64));57945794+ name = file_path(file, buf, PATH_MAX - sizeof(u64));57955795 if (IS_ERR(name)) {57965796 name = "//toolong";57975797 goto cpy_name;
+1-1
mm/memory.c
···37243724 if (buf) {37253725 char *p;3726372637273727- p = d_path(&f->f_path, buf, PAGE_SIZE);37273727+ p = file_path(f, buf, PAGE_SIZE);37283728 if (IS_ERR(p))37293729 p = "?";37303730 printk("%s%s[%lx+%lx]", prefix, kbasename(p),