diff options
author | Prasanth K S R <prasanth.ksr@dell.com> | 2016-12-10 19:17:43 +0530 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-12-14 15:06:36 +0100 |
commit | a2f7af94abe4a3491ca1280a2ae1d63edc0d62ab (patch) | |
tree | 6c02a81da1684a84dea61f64169ebb0d2e19c06f /cmds-receive.c | |
parent | adc1e90fb4d28f4873a3786db457ca9769c935a5 (diff) |
btrfs-progs: subvol_uuid_search: return error encoded pointer
This commit changes subvol_uuid_search() to return an error encoded
pointer on failure.
Signed-off-by: Prasanth K S R <prasanth.ksr@dell.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-receive.c')
-rw-r--r-- | cmds-receive.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cmds-receive.c b/cmds-receive.c index 6f54c2ed..cb42aa27 100644 --- a/cmds-receive.c +++ b/cmds-receive.c @@ -287,13 +287,13 @@ static int process_snapshot(const char *path, const u8 *uuid, u64 ctransid, parent_subvol = subvol_uuid_search(&rctx->sus, 0, parent_uuid, parent_ctransid, NULL, subvol_search_by_received_uuid); - if (!parent_subvol) { + if (IS_ERR(parent_subvol)) { parent_subvol = subvol_uuid_search(&rctx->sus, 0, parent_uuid, parent_ctransid, NULL, subvol_search_by_uuid); } - if (!parent_subvol) { - ret = -ENOENT; + if (IS_ERR(parent_subvol)) { + ret = PTR_ERR(parent_subvol); error("cannot find parent subvolume"); goto out; } @@ -750,13 +750,13 @@ static int process_clone(const char *path, u64 offset, u64 len, si = subvol_uuid_search(&rctx->sus, 0, clone_uuid, clone_ctransid, NULL, subvol_search_by_received_uuid); - if (!si) { + if (IS_ERR(si)) { if (memcmp(clone_uuid, rctx->cur_subvol.received_uuid, BTRFS_UUID_SIZE) == 0) { /* TODO check generation of extent */ subvol_path = strdup(rctx->cur_subvol_path); } else { - ret = -ENOENT; + ret = PTR_ERR(si); error("clone: did not find source subvol"); goto out; } |