aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmds-send.c11
-rw-r--r--utils.c12
-rw-r--r--utils.h2
3 files changed, 14 insertions, 11 deletions
diff --git a/cmds-send.c b/cmds-send.c
index 3e34d75..7605ed9 100644
--- a/cmds-send.c
+++ b/cmds-send.c
@@ -335,17 +335,6 @@ out:
return ret;
}
-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;
-}
-
static int init_root_path(struct btrfs_send *s, const char *subvol)
{
int ret = 0;
diff --git a/utils.c b/utils.c
index 1018a7c..cd3234e 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;
+}
diff --git a/utils.h b/utils.h
index 32bb020..c6395b0 100644
--- a/utils.h
+++ b/utils.h
@@ -197,6 +197,8 @@ int test_issubvolname(const char *name);
int test_issubvolume(const char *path);
int test_isdir(const char *path);
+char *get_subvol_name(char *mnt, char *full_path);
+
/*
* Btrfs minimum size calculation is complicated, it should include at least:
* 1. system group size