summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/fs/path.inc6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/fs/path.inc b/modules/fs/path.inc
index f3a041b..c067049 100644
--- a/modules/fs/path.inc
+++ b/modules/fs/path.inc
@@ -32,6 +32,12 @@ fs_path_gettype() {
awk '$2 == "'"$_mp"'" {print $3}' '/proc/mounts'
}
+# Returns true if the given path is the root of a mount point
+# Does not normalize!
+fs_path_ismountpoint() {
+ grep -Fq " $1 " /proc/mounts
+}
+
# Helper to check whether given directory resides in RAM, either
# by being mounted as tmpfs or not mounted at all in which case
# we assume the same. Returns 0 if so, 1 if otherwise backed,