aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/api/fs/fs.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2015-09-02 03:56:42 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-09-04 11:01:01 -0400
commit709adcb33928b5bf965587b23ed6544e964584a3 (patch)
tree4c194e58157013953e55d21c38963873f454cfe0 /tools/lib/api/fs/fs.c
parent73ca85ad364769ffa312b1d892816d8fa23a02bf (diff)
tools lib api fs: Add FSTYPE__configured() method
Add FSTYPE__configured() (where FSTYPE is one of sysfs, procfs, debugfs, tracefs) interface that returns bool state of the filesystem mount: true - mounted, false - not mounted It will not try to mount the filesystem. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Raphael Beamonte <raphael.beamonte@gmail.com> Cc: David Ahern <dsahern@gmail.com> Cc: Matt Fleming <matt@codeblueprint.co.uk> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1441180605-24737-13-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib/api/fs/fs.c')
-rw-r--r--tools/lib/api/fs/fs.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/tools/lib/api/fs/fs.c b/tools/lib/api/fs/fs.c
index bc93baf33fff..8afe08a99bc6 100644
--- a/tools/lib/api/fs/fs.c
+++ b/tools/lib/api/fs/fs.c
@@ -244,15 +244,20 @@ static const char *fs__mount(int idx)
244 return fs__check_mounts(fs) ? fs->path : NULL; 244 return fs__check_mounts(fs) ? fs->path : NULL;
245} 245}
246 246
247#define FS(name, idx) \ 247#define FS(name, idx) \
248const char *name##__mountpoint(void) \ 248const char *name##__mountpoint(void) \
249{ \ 249{ \
250 return fs__mountpoint(idx); \ 250 return fs__mountpoint(idx); \
251} \ 251} \
252 \ 252 \
253const char *name##__mount(void) \ 253const char *name##__mount(void) \
254{ \ 254{ \
255 return fs__mount(idx); \ 255 return fs__mount(idx); \
256} \
257 \
258bool name##__configured(void) \
259{ \
260 return name##__mountpoint() != NULL; \
256} 261}
257 262
258FS(sysfs, FS__SYSFS); 263FS(sysfs, FS__SYSFS);