Skip to content

Commit 71fd5ae

Browse files
jthornberkergon
authored andcommitted
dm persistent data: remove space map ref_count entries if redundant
Save space by removing entries from the space map ref_count tree if they're no longer needed. Ref counts are stored in two places: a bitmap if the ref_count is below 3, or a btree of uint32_t if 3 or above. When a ref_count that was above 3 drops below we can remove it from the tree and save some metadata space. This removal was commented out before because I was unsure why this was causing under-populated btree nodes. Earlier patches have fixed this issue. Signed-off-by: Joe Thornber <[email protected]> Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
1 parent 905e51b commit 71fd5ae

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

drivers/md/persistent-data/dm-space-map-common.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,16 +405,13 @@ int sm_ll_insert(struct ll_disk *ll, dm_block_t b,
405405
if (r < 0)
406406
return r;
407407

408-
#if 0
409-
/* FIXME: dm_btree_remove doesn't handle this yet */
410408
if (old > 2) {
411409
r = dm_btree_remove(&ll->ref_count_info,
412410
ll->ref_count_root,
413411
&b, &ll->ref_count_root);
414412
if (r)
415413
return r;
416414
}
417-
#endif
418415

419416
} else {
420417
__le32 le_rc = cpu_to_le32(ref_count);

0 commit comments

Comments
 (0)