]> git.karo-electronics.de Git - karo-tx-linux.git/commit
dm space map: optimise sm_ll_dec and sm_ll_inc
authorJoe Thornber <ejt@redhat.com>
Fri, 9 Aug 2013 12:04:56 +0000 (13:04 +0100)
committerMike Snitzer <snitzer@redhat.com>
Tue, 20 Aug 2013 19:05:17 +0000 (15:05 -0400)
commit429074fedc3a89ef16f2a79e45a7fcbfbaa99d2c
treeaffc57a30e5db203fac2133344e29c0dad4865e5
parent4d94599db0eaa6c08f67faff5ce21da308d1acc7
dm space map: optimise sm_ll_dec and sm_ll_inc

Prior to this patch these methods did a lookup followed by an insert.
Instead they now call a common mutate function that adjusts the value
according to a callback function.  This avoids traversing the data
structures twice and hence improves performance.

Also factor out sm_ll_lookup_big_ref_count() for use by both
sm_ll_lookup() and sm_ll_mutate().

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair Kergon <agk@redhat.com>
drivers/md/persistent-data/dm-space-map-common.c