Loading drivers/md/bcache/alloc.c +6 −16 Original line number Diff line number Diff line Loading @@ -229,24 +229,14 @@ static void invalidate_one_bucket(struct cache *ca, struct bucket *b) fifo_push(&ca->free_inc, b - ca->buckets); } static void invalidate_buckets_lru(struct cache *ca) { unsigned bucket_prio(struct bucket *b) { return ((unsigned) (b->prio - ca->set->min_prio)) * GC_SECTORS_USED(b); } #define bucket_prio(b) \ (((unsigned) (b->prio - ca->set->min_prio)) * GC_SECTORS_USED(b)) bool bucket_max_cmp(struct bucket *l, struct bucket *r) { return bucket_prio(l) < bucket_prio(r); } #define bucket_max_cmp(l, r) (bucket_prio(l) < bucket_prio(r)) #define bucket_min_cmp(l, r) (bucket_prio(l) > bucket_prio(r)) bool bucket_min_cmp(struct bucket *l, struct bucket *r) static void invalidate_buckets_lru(struct cache *ca) { return bucket_prio(l) > bucket_prio(r); } struct bucket *b; ssize_t i; Loading drivers/md/bcache/bcache.h +5 −5 Original line number Diff line number Diff line Loading @@ -644,8 +644,8 @@ struct gc_stat { * we'll continue to run normally for awhile with CACHE_SET_STOPPING set (i.e. * flushing dirty data). * * CACHE_SET_STOPPING_2 gets set at the last phase, when it's time to shut down the * allocation thread. * CACHE_SET_STOPPING_2 gets set at the last phase, when it's time to shut down * the allocation thread. */ #define CACHE_SET_UNREGISTERING 0 #define CACHE_SET_STOPPING 1 Loading Loading @@ -1012,11 +1012,11 @@ static inline struct bucket *PTR_BUCKET(struct cache_set *c, * searches - it told you where a key started. It's not used anymore, * and can probably be safely dropped. */ #define KEY(dev, sector, len) (struct bkey) \ { \ #define KEY(dev, sector, len) \ ((struct bkey) { \ .high = (1ULL << 63) | ((uint64_t) (len) << 20) | (dev), \ .low = (sector) \ } }) static inline void bkey_init(struct bkey *k) { Loading drivers/md/bcache/bset.c +5 −4 Original line number Diff line number Diff line Loading @@ -161,9 +161,9 @@ bool bch_ptr_bad(struct btree *b, const struct bkey *k) #ifdef CONFIG_BCACHE_EDEBUG bug: mutex_unlock(&b->c->bucket_lock); btree_bug(b, "inconsistent pointer %s: bucket %zu pin %i " "prio %i gen %i last_gc %i mark %llu gc_gen %i", pkey(k), PTR_BUCKET_NR(b->c, k, i), atomic_read(&g->pin), btree_bug(b, "inconsistent pointer %s: bucket %zu pin %i prio %i gen %i last_gc %i mark %llu gc_gen %i", pkey(k), PTR_BUCKET_NR(b->c, k, i), atomic_read(&g->pin), g->prio, g->gen, g->last_gc, GC_MARK(g), g->gc_gen); return true; #endif Loading Loading @@ -1049,7 +1049,8 @@ void bch_btree_sort_partial(struct btree *b, unsigned start) for (i = start; i <= b->nsets; i++) keys += b->sets[i].data->keys; order = roundup_pow_of_two(__set_bytes(b->sets->data, keys)) / PAGE_SIZE; order = roundup_pow_of_two(__set_bytes(b->sets->data, keys)) / PAGE_SIZE; if (order) order = ilog2(order); } Loading drivers/md/bcache/btree.c +2 −2 Original line number Diff line number Diff line Loading @@ -1021,8 +1021,8 @@ struct btree *bch_btree_node_alloc(struct cache_set *c, int level, goto err_free; if (!b) { cache_bug(c, "Tried to allocate bucket" " that was in btree cache"); cache_bug(c, "Tried to allocate bucket that was in btree cache"); __bkey_put(c, &k.key); goto retry; } Loading drivers/md/bcache/debug.c +4 −4 Original line number Diff line number Diff line Loading @@ -217,8 +217,8 @@ void bch_data_verify(struct search *s) if (memcmp(p1 + bv->bv_offset, p2 + bv->bv_offset, bv->bv_len)) printk(KERN_ERR "bcache (%s): verify failed" " at sector %llu\n", printk(KERN_ERR "bcache (%s): verify failed at sector %llu\n", bdevname(dc->bdev, name), (uint64_t) s->orig_bio->bi_sector); Loading Loading @@ -525,8 +525,8 @@ static ssize_t btree_fuzz(struct kobject *k, struct kobj_attribute *a, k = bkey_next(k), l = bkey_next(l)) if (bkey_cmp(k, l) || KEY_SIZE(k) != KEY_SIZE(l)) pr_err("key %zi differs: %s " "!= %s", (uint64_t *) k - i->d, pr_err("key %zi differs: %s != %s", (uint64_t *) k - i->d, pkey(k), pkey(l)); for (j = 0; j < 3; j++) { Loading Loading
drivers/md/bcache/alloc.c +6 −16 Original line number Diff line number Diff line Loading @@ -229,24 +229,14 @@ static void invalidate_one_bucket(struct cache *ca, struct bucket *b) fifo_push(&ca->free_inc, b - ca->buckets); } static void invalidate_buckets_lru(struct cache *ca) { unsigned bucket_prio(struct bucket *b) { return ((unsigned) (b->prio - ca->set->min_prio)) * GC_SECTORS_USED(b); } #define bucket_prio(b) \ (((unsigned) (b->prio - ca->set->min_prio)) * GC_SECTORS_USED(b)) bool bucket_max_cmp(struct bucket *l, struct bucket *r) { return bucket_prio(l) < bucket_prio(r); } #define bucket_max_cmp(l, r) (bucket_prio(l) < bucket_prio(r)) #define bucket_min_cmp(l, r) (bucket_prio(l) > bucket_prio(r)) bool bucket_min_cmp(struct bucket *l, struct bucket *r) static void invalidate_buckets_lru(struct cache *ca) { return bucket_prio(l) > bucket_prio(r); } struct bucket *b; ssize_t i; Loading
drivers/md/bcache/bcache.h +5 −5 Original line number Diff line number Diff line Loading @@ -644,8 +644,8 @@ struct gc_stat { * we'll continue to run normally for awhile with CACHE_SET_STOPPING set (i.e. * flushing dirty data). * * CACHE_SET_STOPPING_2 gets set at the last phase, when it's time to shut down the * allocation thread. * CACHE_SET_STOPPING_2 gets set at the last phase, when it's time to shut down * the allocation thread. */ #define CACHE_SET_UNREGISTERING 0 #define CACHE_SET_STOPPING 1 Loading Loading @@ -1012,11 +1012,11 @@ static inline struct bucket *PTR_BUCKET(struct cache_set *c, * searches - it told you where a key started. It's not used anymore, * and can probably be safely dropped. */ #define KEY(dev, sector, len) (struct bkey) \ { \ #define KEY(dev, sector, len) \ ((struct bkey) { \ .high = (1ULL << 63) | ((uint64_t) (len) << 20) | (dev), \ .low = (sector) \ } }) static inline void bkey_init(struct bkey *k) { Loading
drivers/md/bcache/bset.c +5 −4 Original line number Diff line number Diff line Loading @@ -161,9 +161,9 @@ bool bch_ptr_bad(struct btree *b, const struct bkey *k) #ifdef CONFIG_BCACHE_EDEBUG bug: mutex_unlock(&b->c->bucket_lock); btree_bug(b, "inconsistent pointer %s: bucket %zu pin %i " "prio %i gen %i last_gc %i mark %llu gc_gen %i", pkey(k), PTR_BUCKET_NR(b->c, k, i), atomic_read(&g->pin), btree_bug(b, "inconsistent pointer %s: bucket %zu pin %i prio %i gen %i last_gc %i mark %llu gc_gen %i", pkey(k), PTR_BUCKET_NR(b->c, k, i), atomic_read(&g->pin), g->prio, g->gen, g->last_gc, GC_MARK(g), g->gc_gen); return true; #endif Loading Loading @@ -1049,7 +1049,8 @@ void bch_btree_sort_partial(struct btree *b, unsigned start) for (i = start; i <= b->nsets; i++) keys += b->sets[i].data->keys; order = roundup_pow_of_two(__set_bytes(b->sets->data, keys)) / PAGE_SIZE; order = roundup_pow_of_two(__set_bytes(b->sets->data, keys)) / PAGE_SIZE; if (order) order = ilog2(order); } Loading
drivers/md/bcache/btree.c +2 −2 Original line number Diff line number Diff line Loading @@ -1021,8 +1021,8 @@ struct btree *bch_btree_node_alloc(struct cache_set *c, int level, goto err_free; if (!b) { cache_bug(c, "Tried to allocate bucket" " that was in btree cache"); cache_bug(c, "Tried to allocate bucket that was in btree cache"); __bkey_put(c, &k.key); goto retry; } Loading
drivers/md/bcache/debug.c +4 −4 Original line number Diff line number Diff line Loading @@ -217,8 +217,8 @@ void bch_data_verify(struct search *s) if (memcmp(p1 + bv->bv_offset, p2 + bv->bv_offset, bv->bv_len)) printk(KERN_ERR "bcache (%s): verify failed" " at sector %llu\n", printk(KERN_ERR "bcache (%s): verify failed at sector %llu\n", bdevname(dc->bdev, name), (uint64_t) s->orig_bio->bi_sector); Loading Loading @@ -525,8 +525,8 @@ static ssize_t btree_fuzz(struct kobject *k, struct kobj_attribute *a, k = bkey_next(k), l = bkey_next(l)) if (bkey_cmp(k, l) || KEY_SIZE(k) != KEY_SIZE(l)) pr_err("key %zi differs: %s " "!= %s", (uint64_t *) k - i->d, pr_err("key %zi differs: %s != %s", (uint64_t *) k - i->d, pkey(k), pkey(l)); for (j = 0; j < 3; j++) { Loading