diff options
| -rw-r--r-- | drivers/md/dm-cache-target.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index 64e96a2bed58..1fe93cfea7d3 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c | |||
| @@ -1967,6 +1967,7 @@ static void process_deferred_bios(struct cache *cache) | |||
| 1967 | * this bio might require one, we pause until there are some | 1967 | * this bio might require one, we pause until there are some |
| 1968 | * prepared mappings to process. | 1968 | * prepared mappings to process. |
| 1969 | */ | 1969 | */ |
| 1970 | prealloc_used = true; | ||
| 1970 | if (prealloc_data_structs(cache, &structs)) { | 1971 | if (prealloc_data_structs(cache, &structs)) { |
| 1971 | spin_lock_irqsave(&cache->lock, flags); | 1972 | spin_lock_irqsave(&cache->lock, flags); |
| 1972 | bio_list_merge(&cache->deferred_bios, &bios); | 1973 | bio_list_merge(&cache->deferred_bios, &bios); |
| @@ -1982,7 +1983,6 @@ static void process_deferred_bios(struct cache *cache) | |||
| 1982 | process_discard_bio(cache, &structs, bio); | 1983 | process_discard_bio(cache, &structs, bio); |
| 1983 | else | 1984 | else |
| 1984 | process_bio(cache, &structs, bio); | 1985 | process_bio(cache, &structs, bio); |
| 1985 | prealloc_used = true; | ||
| 1986 | } | 1986 | } |
| 1987 | 1987 | ||
| 1988 | if (prealloc_used) | 1988 | if (prealloc_used) |
| @@ -2011,6 +2011,7 @@ static void process_deferred_cells(struct cache *cache) | |||
| 2011 | * this bio might require one, we pause until there are some | 2011 | * this bio might require one, we pause until there are some |
| 2012 | * prepared mappings to process. | 2012 | * prepared mappings to process. |
| 2013 | */ | 2013 | */ |
| 2014 | prealloc_used = true; | ||
| 2014 | if (prealloc_data_structs(cache, &structs)) { | 2015 | if (prealloc_data_structs(cache, &structs)) { |
| 2015 | spin_lock_irqsave(&cache->lock, flags); | 2016 | spin_lock_irqsave(&cache->lock, flags); |
| 2016 | list_splice(&cells, &cache->deferred_cells); | 2017 | list_splice(&cells, &cache->deferred_cells); |
| @@ -2019,7 +2020,6 @@ static void process_deferred_cells(struct cache *cache) | |||
| 2019 | } | 2020 | } |
| 2020 | 2021 | ||
| 2021 | process_cell(cache, &structs, cell); | 2022 | process_cell(cache, &structs, cell); |
| 2022 | prealloc_used = true; | ||
| 2023 | } | 2023 | } |
| 2024 | 2024 | ||
| 2025 | if (prealloc_used) | 2025 | if (prealloc_used) |
| @@ -2081,6 +2081,7 @@ static void writeback_some_dirty_blocks(struct cache *cache) | |||
| 2081 | if (policy_writeback_work(cache->policy, &oblock, &cblock, busy)) | 2081 | if (policy_writeback_work(cache->policy, &oblock, &cblock, busy)) |
| 2082 | break; /* no work to do */ | 2082 | break; /* no work to do */ |
| 2083 | 2083 | ||
| 2084 | prealloc_used = true; | ||
| 2084 | if (prealloc_data_structs(cache, &structs) || | 2085 | if (prealloc_data_structs(cache, &structs) || |
| 2085 | get_cell(cache, oblock, &structs, &old_ocell)) { | 2086 | get_cell(cache, oblock, &structs, &old_ocell)) { |
| 2086 | policy_set_dirty(cache->policy, oblock); | 2087 | policy_set_dirty(cache->policy, oblock); |
| @@ -2088,7 +2089,6 @@ static void writeback_some_dirty_blocks(struct cache *cache) | |||
| 2088 | } | 2089 | } |
| 2089 | 2090 | ||
| 2090 | writeback(cache, &structs, oblock, cblock, old_ocell); | 2091 | writeback(cache, &structs, oblock, cblock, old_ocell); |
| 2091 | prealloc_used = true; | ||
| 2092 | } | 2092 | } |
| 2093 | 2093 | ||
| 2094 | if (prealloc_used) | 2094 | if (prealloc_used) |
