diff mbox

[4/6] btrfs-progs: move get_subvol_name() to utils.c

Message ID 1458544865-16467-5-git-send-email-anand.jain@oracle.com (mailing list archive)
State Accepted
Headers show

Commit Message

Anand Jain March 21, 2016, 7:21 a.m. UTC
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 cmds-send.c | 11 -----------
 utils.c     | 12 ++++++++++++
 utils.h     |  1 +
 3 files changed, 13 insertions(+), 11 deletions(-)
diff mbox

Patch

diff --git a/cmds-send.c b/cmds-send.c
index 3e34d75bb834..7605ed94cd64 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 110a4badb764..9aae7df04902 100644
--- a/utils.c
+++ b/utils.c
@@ -3156,3 +3156,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 32bb02005719..08543ff278ee 100644
--- a/utils.h
+++ b/utils.h
@@ -195,6 +195,7 @@  const char* group_profile_str(u64 flags);
 int test_minimum_size(const char *file, u32 leafsize);
 int test_issubvolname(const char *name);
 int test_issubvolume(const char *path);
+char *get_subvol_name(char *mnt, char *full_path);
 int test_isdir(const char *path);
 
 /*