diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2015-06-19 10:29:13 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-06-23 18:00:05 -0400 |
commit | 9bf39ab2adafd7cf8740859cb49e7b7952813a5d (patch) | |
tree | 2dc4ff57033635f0900328c99020af7bf71a31d2 /arch/arc | |
parent | 4bacc9c9234c7c8eec44f5ed4e960d9f96fa0f01 (diff) |
vfs: add file_path() helper
Turn
d_path(&file->f_path, ...);
into
file_path(file, ...);
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/arc')
-rw-r--r-- | arch/arc/kernel/troubleshoot.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/arch/arc/kernel/troubleshoot.c b/arch/arc/kernel/troubleshoot.c index e00a01879025..9f80c5adcb68 100644 --- a/arch/arc/kernel/troubleshoot.c +++ b/arch/arc/kernel/troubleshoot.c @@ -67,15 +67,12 @@ static void print_task_path_n_nm(struct task_struct *tsk, char *buf) mmput(mm); if (exe_file) { - path = exe_file->f_path; - path_get(&exe_file->f_path); + path_nm = file_path(exe_file, buf, 255); fput(exe_file); - path_nm = d_path(&path, buf, 255); - path_put(&path); } done: - pr_info("Path: %s\n", path_nm); + pr_info("Path: %s\n", !IS_ERR(path_nm) ? path_nm : "?"); } static void show_faulting_vma(unsigned long address, char *buf) @@ -99,8 +96,7 @@ static void show_faulting_vma(unsigned long address, char *buf) if (vma && (vma->vm_start <= address)) { struct file *file = vma->vm_file; if (file) { - struct path *path = &file->f_path; - nm = d_path(path, buf, PAGE_SIZE - 1); + nm = file_path(file, buf, PAGE_SIZE - 1); inode = file_inode(vma->vm_file); dev = inode->i_sb->s_dev; ino = inode->i_ino; |