]> git.baikalelectronics.ru Git - kernel.git/commit
dm persistent data: fix btree rebalancing after remove
authorJoe Thornber <ejt@redhat.com>
Wed, 28 Mar 2012 17:41:23 +0000 (18:41 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Wed, 28 Mar 2012 17:41:23 +0000 (18:41 +0100)
commitd1fdf7877e4e9c371d666d2bb637f45e99f581b0
tree9dd34ec6f4563b78ac454f3691757dece46c1926
parent6ed4382707820f5078cf55801f25710879ef35ce
dm persistent data: fix btree rebalancing after remove

When we remove an entry from a node we sometimes rebalance with it's
two neighbours.  This wasn't being done correctly; in some cases
entries have to move all the way from the right neighbour to the left
neighbour, or vice versa.  This patch pretty much re-writes the
balancing code to fix it.

This code is barely used currently; only when you delete a thin
device, and then only if you have hundreds of them in the same pool.
Once we have discard support, which removes mappings, this will be used
much more heavily.

Signed-off-by: Joe Thornber <ejt@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/persistent-data/dm-btree-remove.c