summaryrefslogtreecommitdiff
path: root/tools/lib/api/fs/findfs.h
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2015-02-02 14:35:03 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-02-07 13:51:34 +0100
commitcde164aee9e0343831467035eb96dd5506742648 (patch)
tree8353fdc346aa319d7b88990ea007b22be9a372f3 /tools/lib/api/fs/findfs.h
parent5693c92660970851e95f769ff27397f5098a6296 (diff)
downloadlinux-cde164aee9e0343831467035eb96dd5506742648.tar.gz
linux-cde164aee9e0343831467035eb96dd5506742648.tar.bz2
linux-cde164aee9e0343831467035eb96dd5506742648.zip
tools lib fs: Add helper to find mounted file systems
In preparation for adding tracefs for perf to use, create a findfs helper utility that find_debugfs uses instead of hard coding the search in the code. This will allow for a find_tracefs to be used as well. Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/20150202193552.735023362@goodmis.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib/api/fs/findfs.h')
-rw-r--r--tools/lib/api/fs/findfs.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/lib/api/fs/findfs.h b/tools/lib/api/fs/findfs.h
new file mode 100644
index 000000000000..9e7d876791e1
--- /dev/null
+++ b/tools/lib/api/fs/findfs.h
@@ -0,0 +1,21 @@
+#ifndef __API_FINDFS_H__
+#define __API_FINDFS_H__
+
+#define _STR(x) #x
+#define STR(x) _STR(x)
+
+/*
+ * On most systems <limits.h> would have given us this, but not on some systems
+ * (e.g. GNU/Hurd).
+ */
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
+const char *find_mountpoint(const char *fstype, long magic,
+ char *mountpoint, int len,
+ const char * const *known_mountpoints);
+
+int valid_mountpoint(const char *mount, long magic);
+
+#endif /* __API_FINDFS_H__ */