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>
This commit is contained in:

committed by
Arnaldo Carvalho de Melo

parent
73ca85ad36
commit
709adcb339
@@ -244,15 +244,20 @@ static const char *fs__mount(int idx)
|
||||
return fs__check_mounts(fs) ? fs->path : NULL;
|
||||
}
|
||||
|
||||
#define FS(name, idx) \
|
||||
const char *name##__mountpoint(void) \
|
||||
{ \
|
||||
return fs__mountpoint(idx); \
|
||||
} \
|
||||
\
|
||||
const char *name##__mount(void) \
|
||||
{ \
|
||||
return fs__mount(idx); \
|
||||
#define FS(name, idx) \
|
||||
const char *name##__mountpoint(void) \
|
||||
{ \
|
||||
return fs__mountpoint(idx); \
|
||||
} \
|
||||
\
|
||||
const char *name##__mount(void) \
|
||||
{ \
|
||||
return fs__mount(idx); \
|
||||
} \
|
||||
\
|
||||
bool name##__configured(void) \
|
||||
{ \
|
||||
return name##__mountpoint() != NULL; \
|
||||
}
|
||||
|
||||
FS(sysfs, FS__SYSFS);
|
||||
|
Reference in New Issue
Block a user