mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]> Cc: Raphael Beamonte <[email protected]> Cc: David Ahern <[email protected]> Cc: Matt Fleming <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Steven Rostedt <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
parent
73ca85ad36
commit
709adcb339
2 changed files with 18 additions and 10 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef __API_FS__
|
||||
#define __API_FS__
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
/*
|
||||
* On most systems <limits.h> would have given us this, but not on some systems
|
||||
* (e.g. GNU/Hurd).
|
||||
|
|
@ -11,7 +13,8 @@
|
|||
|
||||
#define FS(name) \
|
||||
const char *name##__mountpoint(void); \
|
||||
const char *name##__mount(void);
|
||||
const char *name##__mount(void); \
|
||||
bool name##__configured(void); \
|
||||
|
||||
FS(sysfs)
|
||||
FS(procfs)
|
||||
|
|
|
|||
Loading…
Reference in a new issue