summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorTörök Edwin <edwintorok@gmail.com>2008-11-22 13:28:48 +0200
committerIngo Molnar <mingo@elte.hu>2008-11-23 09:45:39 +0100
commit74e2f334f4440cbcb63e9ebbcdcea430d41bdfa3 (patch)
tree99a0aa61963601d998563e45b3ea40c5f2e4357c /fs
parent02b67518e2b1c490787dac7f35e1204e74fe21ba (diff)
downloadlinux-3.10-74e2f334f4440cbcb63e9ebbcdcea430d41bdfa3.tar.gz
linux-3.10-74e2f334f4440cbcb63e9ebbcdcea430d41bdfa3.tar.bz2
linux-3.10-74e2f334f4440cbcb63e9ebbcdcea430d41bdfa3.zip
vfs, seqfile: make mangle_path() global
Impact: expose new VFS API make mangle_path() available, as per the suggestions of Christoph Hellwig and Al Viro: http://lkml.org/lkml/2008/11/4/338 Signed-off-by: Török Edwin <edwintorok@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs')
-rw-r--r--fs/seq_file.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/seq_file.c b/fs/seq_file.c
index eba2eabcd2b..f5b61cc1cc1 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -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'.