]> git.neil.brown.name Git - LaFS.git/commit
Avoid quadratic searches in segment table.
authorNeilBrown <neilb@suse.de>
Fri, 4 Mar 2011 01:47:30 +0000 (12:47 +1100)
committerNeilBrown <neilb@suse.de>
Fri, 4 Mar 2011 01:47:30 +0000 (12:47 +1100)
commitbcbb54dd08a464ea4e8539e9505d14cd718d29cc
tree5696addc66aa4c8dbbf848fcb4fb986eea814870
parenta05d850679d747d0321a745299b626d87c943464
Avoid quadratic searches in segment table.

There are a couple of time that we need to iterate of the segment
table (stable) and need to drop the lock each time.
Rather than already restart after we find something of interest,
keep track of when we make a change to the table (thus possibly
breaking an iterator) and only restart when that change is seen.

Both the iterators are completely serialised so resetting
stable_changed when we retry cannot confuse a different iterator.

Signed-off-by: NeilBrown <neilb@suse.de>
segments.c
state.h