summaryrefslogtreecommitdiffstats
path: root/drivers/clocksource/Makefile
diff options
context:
space:
mode:
authorAlex Elder <elder@dreamhost.com>2012-01-29 20:57:44 +0100
committerAlex Elder <elder@dreamhost.com>2012-03-22 16:47:47 +0100
commit1ddbe94eda58597cb6dd464b455cb62d3f68be7b (patch)
tree02a6b829191d218ed861f81b0dcedb8deef53ff4 /drivers/clocksource/Makefile
parentrbd: encapsulate new rbd id selection (diff)
downloadlinux-1ddbe94eda58597cb6dd464b455cb62d3f68be7b.tar.xz
linux-1ddbe94eda58597cb6dd464b455cb62d3f68be7b.zip
rbd: rework calculation of new rbd id's
In order to select a new unique identifier for an added rbd device, the list of all existing ones is searched and a value one greater than the highest id is used. The list search can be avoided by using an atomic variable that keeps track of the current highest id. Using a get/put model for id's we can limit the boundless growth of id numbers a bit by arranging to reuse the current highest id once it gets released. Add these calls to "put" the id when an rbd is getting removed. Note that this changes the pattern of device id's used--new values will never be below the highest one seen so far (even if there exists an unused lower one). I assert this is OK because the key property of an rbd id is its uniqueness, not its magnitude. Regardless, a follow-on patch will restore the old way of doing things, I just think this commit just makes the incremental change to atomics a little easier to understand. Signed-off-by: Alex Elder <elder@dreamhost.com> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'drivers/clocksource/Makefile')
0 files changed, 0 insertions, 0 deletions