diff options
author | Joe Thornber <ejt@redhat.com> | 2012-03-28 13:41:27 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2012-03-28 13:41:27 -0400 |
commit | 71fd5ae25d88841c08d5bbea90c0f0a12ca05509 (patch) | |
tree | 763ec9657bd25e4d42f1f6774faa65166364eede /drivers/md | |
parent | 905e51b39a5558706a6ed883fe104de3d417050b (diff) |
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 <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/persistent-data/dm-space-map-common.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/md/persistent-data/dm-space-map-common.c b/drivers/md/persistent-data/dm-space-map-common.c index df2494c06cdc..ff3beed6ad2d 100644 --- a/drivers/md/persistent-data/dm-space-map-common.c +++ b/drivers/md/persistent-data/dm-space-map-common.c | |||
@@ -405,8 +405,6 @@ int sm_ll_insert(struct ll_disk *ll, dm_block_t b, | |||
405 | if (r < 0) | 405 | if (r < 0) |
406 | return r; | 406 | return r; |
407 | 407 | ||
408 | #if 0 | ||
409 | /* FIXME: dm_btree_remove doesn't handle this yet */ | ||
410 | if (old > 2) { | 408 | if (old > 2) { |
411 | r = dm_btree_remove(&ll->ref_count_info, | 409 | r = dm_btree_remove(&ll->ref_count_info, |
412 | ll->ref_count_root, | 410 | ll->ref_count_root, |
@@ -414,7 +412,6 @@ int sm_ll_insert(struct ll_disk *ll, dm_block_t b, | |||
414 | if (r) | 412 | if (r) |
415 | return r; | 413 | return r; |
416 | } | 414 | } |
417 | #endif | ||
418 | 415 | ||
419 | } else { | 416 | } else { |
420 | __le32 le_rc = cpu_to_le32(ref_count); | 417 | __le32 le_rc = cpu_to_le32(ref_count); |