aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/alloc.c
diff options
context:
space:
mode:
authorNicholas Swenson <nks@daterainc.com>2013-11-07 17:53:19 -0800
committerKent Overstreet <kmo@daterainc.com>2013-12-16 14:22:58 -0800
commit981aa8c091e164ea51dd1e81b71a1f3852bbcceb (patch)
tree63b14b1df54db25daa2ce46c8f42b5cff0ab1b89 /drivers/md/bcache/alloc.c
parentbcache: fix for gc crashing when no sectors are used (diff)
downloadlinux-dev-981aa8c091e164ea51dd1e81b71a1f3852bbcceb.tar.xz
linux-dev-981aa8c091e164ea51dd1e81b71a1f3852bbcceb.zip
bcache: bugfix - moving_gc now moves only correct buckets
Removed gc_move_threshold because picking buckets only by threshold could lead moving extra buckets (ei. if there are buckets at the threshold that aren't supposed to be moved do to space considerations). This is replaced by a GC_MOVE bit in the gc_mark bitmask. Now only marked buckets get moved. Signed-off-by: Nicholas Swenson <nks@daterainc.com> Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/alloc.c')
-rw-r--r--drivers/md/bcache/alloc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c
index 2b46bf1d7e40..4c9852d92b0a 100644
--- a/drivers/md/bcache/alloc.c
+++ b/drivers/md/bcache/alloc.c
@@ -421,9 +421,11 @@ out:
if (watermark <= WATERMARK_METADATA) {
SET_GC_MARK(b, GC_MARK_METADATA);
+ SET_GC_MOVE(b, 0);
b->prio = BTREE_PRIO;
} else {
SET_GC_MARK(b, GC_MARK_RECLAIMABLE);
+ SET_GC_MOVE(b, 0);
b->prio = INITIAL_PRIO;
}