summaryrefslogtreecommitdiff
path: root/tools/lib/api
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/api')
-rw-r--r--tools/lib/api/fs/debugfs.c28
-rw-r--r--tools/lib/api/fs/debugfs.h1
2 files changed, 14 insertions, 15 deletions
diff --git a/tools/lib/api/fs/debugfs.c b/tools/lib/api/fs/debugfs.c
index d2b18e887071..d21d4d6b4fd2 100644
--- a/tools/lib/api/fs/debugfs.c
+++ b/tools/lib/api/fs/debugfs.c
@@ -20,6 +20,20 @@ static const char * const debugfs_known_mountpoints[] = {
static bool debugfs_found;
+/* verify that a mountpoint is actually a debugfs instance */
+
+static int debugfs_valid_mountpoint(const char *debugfs)
+{
+ struct statfs st_fs;
+
+ if (statfs(debugfs, &st_fs) < 0)
+ return -ENOENT;
+ else if ((long)st_fs.f_type != (long)DEBUGFS_MAGIC)
+ return -ENOENT;
+
+ return 0;
+}
+
/* find the path to the mounted debugfs */
const char *debugfs_find_mountpoint(void)
{
@@ -60,20 +74,6 @@ const char *debugfs_find_mountpoint(void)
return debugfs_mountpoint;
}
-/* verify that a mountpoint is actually a debugfs instance */
-
-int debugfs_valid_mountpoint(const char *debugfs)
-{
- struct statfs st_fs;
-
- if (statfs(debugfs, &st_fs) < 0)
- return -ENOENT;
- else if ((long)st_fs.f_type != (long)DEBUGFS_MAGIC)
- return -ENOENT;
-
- return 0;
-}
-
/* mount the debugfs somewhere if it's not mounted */
char *debugfs_mount(const char *mountpoint)
{
diff --git a/tools/lib/api/fs/debugfs.h b/tools/lib/api/fs/debugfs.h
index 0739881a9897..77bb36a95b07 100644
--- a/tools/lib/api/fs/debugfs.h
+++ b/tools/lib/api/fs/debugfs.h
@@ -21,7 +21,6 @@
#endif
const char *debugfs_find_mountpoint(void);
-int debugfs_valid_mountpoint(const char *debugfs);
char *debugfs_mount(const char *mountpoint);
extern char debugfs_mountpoint[];