summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2012-09-19 10:52:11 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2012-10-29 09:00:56 +0000
commitdf326b8463cddbaca31962015358badd209e7501 (patch)
tree95b15100e619a217d672e94a7c180536a60c8b00 /src/core
parent92b36233047e07a619984e4aa0380a0b1a86e0ff (diff)
swap: introduce helper variable
Just for readability, no funcational change.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/swap.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/swap.c b/src/core/swap.c
index c708b7fefa..7e1d4371c6 100644
--- a/src/core/swap.c
+++ b/src/core/swap.c
@@ -55,6 +55,7 @@ static const UnitActiveState state_translation_table[_SWAP_STATE_MAX] = {
static void swap_unset_proc_swaps(Swap *s) {
Swap *first;
+ Hashmap *swaps;
assert(s);
@@ -63,14 +64,17 @@ static void swap_unset_proc_swaps(Swap *s) {
/* Remove this unit from the chain of swaps which share the
* same kernel swap device. */
-
- first = hashmap_get(UNIT(s)->manager->swaps_by_proc_swaps, s->parameters_proc_swaps.what);
+ swaps = UNIT(s)->manager->swaps_by_proc_swaps;
+ first = hashmap_get(swaps, s->parameters_proc_swaps.what);
LIST_REMOVE(Swap, same_proc_swaps, first, s);
if (first)
- hashmap_remove_and_replace(UNIT(s)->manager->swaps_by_proc_swaps, s->parameters_proc_swaps.what, first->parameters_proc_swaps.what, first);
+ hashmap_remove_and_replace(swaps,
+ s->parameters_proc_swaps.what,
+ first->parameters_proc_swaps.what,
+ first);
else
- hashmap_remove(UNIT(s)->manager->swaps_by_proc_swaps, s->parameters_proc_swaps.what);
+ hashmap_remove(swaps, s->parameters_proc_swaps.what);
free(s->parameters_proc_swaps.what);
s->parameters_proc_swaps.what = NULL;