aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/persistent-data/dm-space-map-disk.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/persistent-data/dm-space-map-disk.c')
-rw-r--r--drivers/md/persistent-data/dm-space-map-disk.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/drivers/md/persistent-data/dm-space-map-disk.c b/drivers/md/persistent-data/dm-space-map-disk.c
index e735a6d5a793..cfbf9617e465 100644
--- a/drivers/md/persistent-data/dm-space-map-disk.c
+++ b/drivers/md/persistent-data/dm-space-map-disk.c
@@ -140,26 +140,10 @@ static int sm_disk_inc_block(struct dm_space_map *sm, dm_block_t b)
140 140
141static int sm_disk_dec_block(struct dm_space_map *sm, dm_block_t b) 141static int sm_disk_dec_block(struct dm_space_map *sm, dm_block_t b)
142{ 142{
143 int r;
144 uint32_t old_count;
145 enum allocation_event ev; 143 enum allocation_event ev;
146 struct sm_disk *smd = container_of(sm, struct sm_disk, sm); 144 struct sm_disk *smd = container_of(sm, struct sm_disk, sm);
147 145
148 r = sm_ll_dec(&smd->ll, b, &ev); 146 return sm_ll_dec(&smd->ll, b, &ev);
149 if (!r && (ev == SM_FREE)) {
150 /*
151 * It's only free if it's also free in the last
152 * transaction.
153 */
154 r = sm_ll_lookup(&smd->old_ll, b, &old_count);
155 if (r)
156 return r;
157
158 if (!old_count)
159 smd->nr_allocated_this_transaction--;
160 }
161
162 return r;
163} 147}
164 148
165static int sm_disk_new_block(struct dm_space_map *sm, dm_block_t *b) 149static int sm_disk_new_block(struct dm_space_map *sm, dm_block_t *b)