vfs: add seq_file_path() helper
authorMiklos Szeredi <mszeredi@suse.cz>
Fri, 19 Jun 2015 08:30:28 +0000 (10:30 +0200)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 23 Jun 2015 22:01:07 +0000 (18:01 -0400)
Turn
seq_path(..., &file->f_path, ...);
into
seq_file_path(..., file, ...);

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/md/bitmap.c
fs/proc/nommu.c
fs/proc/task_mmu.c
fs/proc/task_nommu.c
fs/seq_file.c
include/linux/seq_file.h
mm/swapfile.c

index dda33d64835445885e3af474e27dcbae55a72b27..3813fdfee4beed18466b96732f6e9a5f2489c7dc 100644 (file)
@@ -1922,7 +1922,7 @@ void bitmap_status(struct seq_file *seq, struct bitmap *bitmap)
                   chunk_kb ? "KB" : "B");
        if (bitmap->storage.file) {
                seq_printf(seq, ", file: ");
-               seq_path(seq, &bitmap->storage.file->f_path, " \t\n");
+               seq_file_path(seq, bitmap->storage.file, " \t\n");
        }
 
        seq_printf(seq, "\n");
index d4a35746cab91f8967dc83b7466fd572a77ae8d4..f8595e8b5cd067e474d1ca2c9a20d60fd0ec903d 100644 (file)
@@ -64,7 +64,7 @@ static int nommu_region_show(struct seq_file *m, struct vm_region *region)
 
        if (file) {
                seq_pad(m, ' ');
-               seq_path(m, &file->f_path, "");
+               seq_file_path(m, file, "");
        }
 
        seq_putc(m, '\n');
index 6dee68d013ffa69f1f6c9d49873f17f19eb3874d..ca1e091881d44fe5797924d5a34daca41f8166e9 100644 (file)
@@ -310,7 +310,7 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
         */
        if (file) {
                seq_pad(m, ' ');
-               seq_path(m, &file->f_path, "\n");
+               seq_file_path(m, file, "\n");
                goto done;
        }
 
@@ -1509,7 +1509,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
 
        if (file) {
                seq_puts(m, " file=");
-               seq_path(m, &file->f_path, "\n\t= ");
+               seq_file_path(m, file, "\n\t= ");
        } else if (vma->vm_start <= mm->brk && vma->vm_end >= mm->start_brk) {
                seq_puts(m, " heap");
        } else {
index 599ec2e201043ea8f210a7c15a13c4e7eab22440..e0d64c92e4f6576c38a8a4a7cc9b8d13a2b3362e 100644 (file)
@@ -180,7 +180,7 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma,
 
        if (file) {
                seq_pad(m, ' ');
-               seq_path(m, &file->f_path, "");
+               seq_file_path(m, file, "");
        } else if (mm) {
                pid_t tid = pid_of_stack(priv, vma, is_pid);
 
index 555f82155be80d4e27eb62785af0926093de6b04..d8a0545ad7ea43c08eefa531ab58b59073e6c422 100644 (file)
@@ -487,6 +487,20 @@ int seq_path(struct seq_file *m, const struct path *path, const char *esc)
 }
 EXPORT_SYMBOL(seq_path);
 
+/**
+ * seq_file_path - seq_file interface to print a pathname of a file
+ * @m: the seq_file handle
+ * @file: the struct file to print
+ * @esc: set of characters to escape in the output
+ *
+ * return the absolute path to the file.
+ */
+int seq_file_path(struct seq_file *m, struct file *file, const char *esc)
+{
+       return seq_path(m, &file->f_path, esc);
+}
+EXPORT_SYMBOL(seq_file_path);
+
 /*
  * Same as seq_path, but relative to supplied root.
  */
index afbb1fd77c7722a0f71ed6701582ac58065ece6a..912a7c482649e63bc3232ddd5a88461c20e01e49 100644 (file)
@@ -123,6 +123,7 @@ __printf(2, 3) int seq_printf(struct seq_file *, const char *, ...);
 __printf(2, 0) int seq_vprintf(struct seq_file *, const char *, va_list args);
 
 int seq_path(struct seq_file *, const struct path *, const char *);
+int seq_file_path(struct seq_file *, struct file *, const char *);
 int seq_dentry(struct seq_file *, struct dentry *, const char *);
 int seq_path_root(struct seq_file *m, const struct path *path,
                  const struct path *root, const char *esc);
index a7e72103f23bfbf81aad771343dac77c4f4d1958..41e4581af7c512fe49ad8a1677a501f290e14807 100644 (file)
@@ -2032,7 +2032,7 @@ static int swap_show(struct seq_file *swap, void *v)
        }
 
        file = si->swap_file;
-       len = seq_path(swap, &file->f_path, " \t\n\\");
+       len = seq_file_path(swap, file, " \t\n\\");
        seq_printf(swap, "%*s%s\t%u\t%u\t%d\n",
                        len < 40 ? 40 - len : 1, " ",
                        S_ISBLK(file_inode(file)->i_mode) ?
This page took 0.029366 seconds and 5 git commands to generate.