btrfs-progs: rename get_subvol_name() to subvol_strip_mountpoint()
authorAnand Jain <anand.jain@oracle.com>
Mon, 21 Mar 2016 07:21:05 +0000 (15:21 +0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 30 Mar 2016 14:25:33 +0000 (16:25 +0200)
Signed-off-by: Anand Jain <anand.jain@oracle.com>
[ renamed from subvol_minus_mnt to subvol_strip_mountpoint ]
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-send.c
utils.c
utils.h

index 7605ed94cd64653895b1c4c34fe26b78d6bb0562..bbe16d8474de1e5b246da99d7487cd879fa91c0c 100644 (file)
@@ -455,8 +455,9 @@ int cmd_send(int argc, char **argv)
                        if (ret < 0)
                                goto out;
 
-                       ret = get_root_id(&send, get_subvol_name(send.root_path, subvol),
-                                       &root_id);
+                       ret = get_root_id(&send,
+                               subvol_strip_mountpoint(send.root_path, subvol),
+                               &root_id);
                        if (ret < 0) {
                                error("cannot resolve rootid for %s", subvol);
                                goto out;
@@ -569,8 +570,8 @@ int cmd_send(int argc, char **argv)
 
        if (snapshot_parent != NULL) {
                ret = get_root_id(&send,
-                               get_subvol_name(send.root_path, snapshot_parent),
-                               &parent_root_id);
+                       subvol_strip_mountpoint(send.root_path, snapshot_parent),
+                       &parent_root_id);
                if (ret < 0) {
                        error("could not resolve rootid for %s", snapshot_parent);
                        goto out;
diff --git a/utils.c b/utils.c
index dd2ff9c2e89c97cbd0c41841b43002969a94ad7f..06efcabef95afaf323396936d3998aa4504fb7fe 100644 (file)
--- a/utils.c
+++ b/utils.c
@@ -3160,7 +3160,7 @@ int test_issubvolume(const char *path)
        return (int)stfs.f_type == BTRFS_SUPER_MAGIC;
 }
 
-char *get_subvol_name(char *mnt, char *full_path)
+char *subvol_strip_mountpoint(char *mnt, char *full_path)
 {
        int len = strlen(mnt);
        if (!len)
@@ -3206,7 +3206,7 @@ int get_subvol_info(char *fullpath, struct root_info *get_ri)
                return 1;
        }
        ret = 1;
-       svpath = get_subvol_name(mnt, fullpath);
+       svpath = subvol_strip_mountpoint(mnt, fullpath);
 
        fd = btrfs_open_dir(fullpath, &dirstream1, 1);
        if (fd < 0)
diff --git a/utils.h b/utils.h
index 09bd3b37c99ff820fcd2888b269edf58f80916d7..ae498a42b7abeac0972dff817a54321e88ed2177 100644 (file)
--- a/utils.h
+++ b/utils.h
@@ -198,7 +198,7 @@ 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);
+char *subvol_strip_mountpoint(char *mnt, char *full_path);
 int get_subvol_info(char *fullpath, struct root_info *get_ri);
 
 /*