summaryrefslogtreecommitdiff
path: root/cmds-send.c
diff options
context:
space:
mode:
authorDimitri John Ledkov <xnox@ubuntu.com>2016-05-10 10:13:23 +0100
committerDimitri John Ledkov <xnox@ubuntu.com>2016-05-10 10:13:23 +0100
commit58e631d01823afd60e52f3a09887f270a91889a0 (patch)
tree6afbca5492c1ad1040608e01fe0c9d909482adeb /cmds-send.c
parentcec572daccafa1e912cbed363df6f84687778c6f (diff)
New upstream release 4.5.2.
* Thanks for NMU of package rename. * New upstream release 4.5.2. * Upload using dgit. * Source-only upload. * btrfs-convert should not be included in the initramfs, but should be compiled. Using btrfs-convert is not a trivial operation, and especially not from a minimal shell. Also it is known to fail, and for a sophisticated user it is trivial to include it in the initramfs. Thus won't fix Closes: #801192 * No sponsorship required Closes: #823474 * Add Provides btrfs-tools-udeb to the -progs-udeb package.
Diffstat (limited to 'cmds-send.c')
-rw-r--r--cmds-send.c37
1 files changed, 14 insertions, 23 deletions
diff --git a/cmds-send.c b/cmds-send.c
index 3e34d75b..4063475a 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;
@@ -466,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;
@@ -484,7 +474,7 @@ int cmd_send(int argc, char **argv)
ret = add_clone_source(&send, root_id);
if (ret < 0) {
- error("not enough memory");
+ error("cannot add clone source: %s", strerror(-ret));
goto out;
}
subvol_uuid_search_finit(&send.sus);
@@ -580,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;
@@ -589,7 +579,7 @@ int cmd_send(int argc, char **argv)
ret = add_clone_source(&send, parent_root_id);
if (ret < 0) {
- error("not enough memory");
+ error("cannot add clone source: %s", strerror(-ret));
goto out;
}
}
@@ -683,15 +673,16 @@ int cmd_send(int argc, char **argv)
if (ret < 0)
goto out;
- /* done with this subvol, so add it to the clone sources */
- ret = add_clone_source(&send, root_id);
- if (ret < 0) {
- error("not enough memory");
- goto out;
+ if (!full_send) {
+ /* done with this subvol, so add it to the clone sources */
+ ret = add_clone_source(&send, root_id);
+ if (ret < 0) {
+ error("cannot add clone source: %s", strerror(-ret));
+ goto out;
+ }
}
parent_root_id = 0;
- full_send = 0;
}
ret = 0;