summaryrefslogtreecommitdiffstats
path: root/lib/activate
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2011-10-11 08:54:01 +0000
committerZdenek Kabelac <zkabelac@redhat.com>2011-10-11 08:54:01 +0000
commit409bf6e6d8b6cb87a858a80cb6dac82544e16e6c (patch)
tree814f53755fe6ea49fd2fffd1bf20d35d057fa9a8 /lib/activate
parent5940327f3adda4c5f970740f63388171d48b3c02 (diff)
downloadlvm2-409bf6e6d8b6cb87a858a80cb6dac82544e16e6c.tar.gz
lvm2-409bf6e6d8b6cb87a858a80cb6dac82544e16e6c.tar.xz
lvm2-409bf6e6d8b6cb87a858a80cb6dac82544e16e6c.zip
Skip r assignment
Cosmetic, since r is already 0 for the error path, no need to assign it there, and r is assigned to 1 after switch command. Also makes the code more readable.
Diffstat (limited to 'lib/activate')
-rw-r--r--lib/activate/dev_manager.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index b01dfc5f..9aa53b6c 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -1882,9 +1882,8 @@ static int _tree_action(struct dev_manager *dm, struct logical_volume *lv,
case DEACTIVATE:
if (retry_deactivation())
dm_tree_retry_remove(root);
- /* Deactivate LV and all devices it references that nothing else has open. */
- r = dm_tree_deactivate_children(root, dlid, ID_LEN + sizeof(UUID_PREFIX) - 1);
- if (!r)
+ /* Deactivate LV and all devices it references that nothing else has open. */
+ if (!dm_tree_deactivate_children(root, dlid, ID_LEN + sizeof(UUID_PREFIX) - 1))
goto_out;
if (!_remove_lv_symlinks(dm, root))
log_error("Failed to remove all device symlinks associated with %s.", lv->name);
@@ -1905,16 +1904,14 @@ static int _tree_action(struct dev_manager *dm, struct logical_volume *lv,
goto_out;
/* Preload any devices required before any suspensions */
- r = dm_tree_preload_children(root, dlid, ID_LEN + sizeof(UUID_PREFIX) - 1);
- if (!r)
+ if (!dm_tree_preload_children(root, dlid, ID_LEN + sizeof(UUID_PREFIX) - 1))
goto_out;
if (dm_tree_node_size_changed(root))
dm->flush_required = 1;
if (action == ACTIVATE) {
- r = dm_tree_activate_children(root, dlid, ID_LEN + sizeof(UUID_PREFIX) - 1);
- if (!r)
+ if (!dm_tree_activate_children(root, dlid, ID_LEN + sizeof(UUID_PREFIX) - 1))
goto_out;
if (!_create_lv_symlinks(dm, root)) {
log_error("Failed to create symlinks for %s.", lv->name);