aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2014-01-30 14:57:55 -0500
committerJens Axboe <axboe@kernel.dk>2014-01-30 14:57:55 -0500
commit96d2e8b5e288e9d2a40b95161b855944846526a5 (patch)
tree1fba4e0da90fb2727ba1c121d76dd363c29759f2 /drivers/md/bcache
parent556ee818c06f37b2e583af0363e6b16d0e0270de (diff)
parente3b4825b85eab879b618af6ea18529ca7ab9a64f (diff)
Merge branch 'bcache-for-3.14' of git://evilpiepirate.org/~kent/linux-bcache into for-linus
Diffstat (limited to 'drivers/md/bcache')
-rw-r--r--drivers/md/bcache/bcache.h4
-rw-r--r--drivers/md/bcache/bset.c7
-rw-r--r--drivers/md/bcache/btree.c4
-rw-r--r--drivers/md/bcache/extents.c2
-rw-r--r--drivers/md/bcache/request.c6
-rw-r--r--drivers/md/bcache/sysfs.c2
6 files changed, 15 insertions, 10 deletions
diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
index 0c707e4f4eaf..a4c7306ff43d 100644
--- a/drivers/md/bcache/bcache.h
+++ b/drivers/md/bcache/bcache.h
@@ -210,7 +210,9 @@ BITMASK(GC_MARK, struct bucket, gc_mark, 0, 2);
210#define GC_MARK_RECLAIMABLE 0 210#define GC_MARK_RECLAIMABLE 0
211#define GC_MARK_DIRTY 1 211#define GC_MARK_DIRTY 1
212#define GC_MARK_METADATA 2 212#define GC_MARK_METADATA 2
213BITMASK(GC_SECTORS_USED, struct bucket, gc_mark, 2, 13); 213#define GC_SECTORS_USED_SIZE 13
214#define MAX_GC_SECTORS_USED (~(~0ULL << GC_SECTORS_USED_SIZE))
215BITMASK(GC_SECTORS_USED, struct bucket, gc_mark, 2, GC_SECTORS_USED_SIZE);
214BITMASK(GC_MOVE, struct bucket, gc_mark, 15, 1); 216BITMASK(GC_MOVE, struct bucket, gc_mark, 15, 1);
215 217
216#include "journal.h" 218#include "journal.h"
diff --git a/drivers/md/bcache/bset.c b/drivers/md/bcache/bset.c
index 4f6b5940e609..3f74b4b0747b 100644
--- a/drivers/md/bcache/bset.c
+++ b/drivers/md/bcache/bset.c
@@ -23,7 +23,7 @@ void bch_dump_bset(struct btree_keys *b, struct bset *i, unsigned set)
23 for (k = i->start; k < bset_bkey_last(i); k = next) { 23 for (k = i->start; k < bset_bkey_last(i); k = next) {
24 next = bkey_next(k); 24 next = bkey_next(k);
25 25
26 printk(KERN_ERR "block %u key %zi/%u: ", set, 26 printk(KERN_ERR "block %u key %li/%u: ", set,
27 (uint64_t *) k - i->d, i->keys); 27 (uint64_t *) k - i->d, i->keys);
28 28
29 if (b->ops->key_dump) 29 if (b->ops->key_dump)
@@ -1185,9 +1185,12 @@ static void __btree_sort(struct btree_keys *b, struct btree_iter *iter,
1185 struct bset *out = (void *) __get_free_pages(__GFP_NOWARN|GFP_NOIO, 1185 struct bset *out = (void *) __get_free_pages(__GFP_NOWARN|GFP_NOIO,
1186 order); 1186 order);
1187 if (!out) { 1187 if (!out) {
1188 struct page *outp;
1189
1188 BUG_ON(order > state->page_order); 1190 BUG_ON(order > state->page_order);
1189 1191
1190 out = page_address(mempool_alloc(state->pool, GFP_NOIO)); 1192 outp = mempool_alloc(state->pool, GFP_NOIO);
1193 out = page_address(outp);
1191 used_mempool = true; 1194 used_mempool = true;
1192 order = state->page_order; 1195 order = state->page_order;
1193 } 1196 }
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 98cc0a810a36..5f9c2a665ca5 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -1167,7 +1167,7 @@ uint8_t __bch_btree_mark_key(struct cache_set *c, int level, struct bkey *k)
1167 /* guard against overflow */ 1167 /* guard against overflow */
1168 SET_GC_SECTORS_USED(g, min_t(unsigned, 1168 SET_GC_SECTORS_USED(g, min_t(unsigned,
1169 GC_SECTORS_USED(g) + KEY_SIZE(k), 1169 GC_SECTORS_USED(g) + KEY_SIZE(k),
1170 (1 << 14) - 1)); 1170 MAX_GC_SECTORS_USED));
1171 1171
1172 BUG_ON(!GC_SECTORS_USED(g)); 1172 BUG_ON(!GC_SECTORS_USED(g));
1173 } 1173 }
@@ -1805,7 +1805,7 @@ static bool btree_insert_key(struct btree *b, struct bkey *k,
1805 1805
1806static size_t insert_u64s_remaining(struct btree *b) 1806static size_t insert_u64s_remaining(struct btree *b)
1807{ 1807{
1808 ssize_t ret = bch_btree_keys_u64s_remaining(&b->keys); 1808 long ret = bch_btree_keys_u64s_remaining(&b->keys);
1809 1809
1810 /* 1810 /*
1811 * Might land in the middle of an existing extent and have to split it 1811 * Might land in the middle of an existing extent and have to split it
diff --git a/drivers/md/bcache/extents.c b/drivers/md/bcache/extents.c
index c3ead586dc27..416d1a3e028e 100644
--- a/drivers/md/bcache/extents.c
+++ b/drivers/md/bcache/extents.c
@@ -194,7 +194,7 @@ err:
194 mutex_unlock(&b->c->bucket_lock); 194 mutex_unlock(&b->c->bucket_lock);
195 bch_extent_to_text(buf, sizeof(buf), k); 195 bch_extent_to_text(buf, sizeof(buf), k);
196 btree_bug(b, 196 btree_bug(b,
197"inconsistent btree pointer %s: bucket %li pin %i prio %i gen %i last_gc %i mark %llu gc_gen %i", 197"inconsistent btree pointer %s: bucket %zi pin %i prio %i gen %i last_gc %i mark %llu gc_gen %i",
198 buf, PTR_BUCKET_NR(b->c, k, i), atomic_read(&g->pin), 198 buf, PTR_BUCKET_NR(b->c, k, i), atomic_read(&g->pin),
199 g->prio, g->gen, g->last_gc, GC_MARK(g), g->gc_gen); 199 g->prio, g->gen, g->last_gc, GC_MARK(g), g->gc_gen);
200 return true; 200 return true;
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
index 72cd213f213f..5d5d031cf381 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -353,14 +353,14 @@ static void bch_data_insert_start(struct closure *cl)
353 struct data_insert_op *op = container_of(cl, struct data_insert_op, cl); 353 struct data_insert_op *op = container_of(cl, struct data_insert_op, cl);
354 struct bio *bio = op->bio, *n; 354 struct bio *bio = op->bio, *n;
355 355
356 if (op->bypass)
357 return bch_data_invalidate(cl);
358
359 if (atomic_sub_return(bio_sectors(bio), &op->c->sectors_to_gc) < 0) { 356 if (atomic_sub_return(bio_sectors(bio), &op->c->sectors_to_gc) < 0) {
360 set_gc_sectors(op->c); 357 set_gc_sectors(op->c);
361 wake_up_gc(op->c); 358 wake_up_gc(op->c);
362 } 359 }
363 360
361 if (op->bypass)
362 return bch_data_invalidate(cl);
363
364 /* 364 /*
365 * Journal writes are marked REQ_FLUSH; if the original write was a 365 * Journal writes are marked REQ_FLUSH; if the original write was a
366 * flush, it'll wait on the journal write. 366 * flush, it'll wait on the journal write.
diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
index c6ab69333a6d..d8458d477a12 100644
--- a/drivers/md/bcache/sysfs.c
+++ b/drivers/md/bcache/sysfs.c
@@ -416,7 +416,7 @@ static int btree_bset_stats(struct btree_op *b_op, struct btree *b)
416 return MAP_CONTINUE; 416 return MAP_CONTINUE;
417} 417}
418 418
419int bch_bset_print_stats(struct cache_set *c, char *buf) 419static int bch_bset_print_stats(struct cache_set *c, char *buf)
420{ 420{
421 struct bset_stats_op op; 421 struct bset_stats_op op;
422 int ret; 422 int ret;