summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/utils.c b/utils.c
index 1018a7c0..cd3234e1 100644
--- a/utils.c
+++ b/utils.c
@@ -3159,3 +3159,15 @@ int test_issubvolume(const char *path)
return (int)stfs.f_type == BTRFS_SUPER_MAGIC;
}
+
+char *get_subvol_name(char *mnt, char *full_path)
+{
+ int len = strlen(mnt);
+ if (!len)
+ return full_path;
+
+ if (mnt[len - 1] != '/')
+ len += 1;
+
+ return full_path + len;
+}