]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/seq_file.c
vfs, seqfile: make mangle_path() global
[net-next-2.6.git] / fs / seq_file.c
index eba2eabcd2b86a40495845053d9d647e228540f9..f5b61cc1cc1a4bb9a61d5302e8468af9c506b347 100644 (file)
@@ -357,7 +357,18 @@ int seq_printf(struct seq_file *m, const char *f, ...)
 }
 EXPORT_SYMBOL(seq_printf);
 
-static char *mangle_path(char *s, char *p, char *esc)
+/**
+ *     mangle_path - mangle and copy path to buffer beginning
+ *     @s - buffer start
+ *     @p - beginning of path in above buffer
+ *      @esc - set of characters that need escaping
+ *
+ *      Copy the path from @p to @s, replacing each occurrence of character from
+ *      @esc with usual octal escape.
+ *      Returns pointer past last written character in @s, or NULL in case of
+ *      failure.
+ */
+char *mangle_path(char *s, char *p, char *esc)
 {
        while (s <= p) {
                char c = *p++;
@@ -376,6 +387,7 @@ static char *mangle_path(char *s, char *p, char *esc)
        }
        return NULL;
 }
+EXPORT_SYMBOL_GPL(mangle_path);
 
 /*
  * return the absolute path of 'dentry' residing in mount 'mnt'.