diff options
author | Anand Jain <anand.jain@oracle.com> | 2016-03-21 15:21:03 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-03-30 16:25:23 +0200 |
commit | 8cec21a7ed91e0d4c49f1fbe188622af0586602c (patch) | |
tree | 32ea5c127a0e3c17f77a7fc5aa0e4e777d813722 /utils.c | |
parent | 0f9a5cf70cf6f6c3f02ef3dd999e13f334bc29bb (diff) |
btrfs-progs: move get_subvol_name() to utils.c
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'utils.c')
-rw-r--r-- | utils.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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; +} |