bcache: only use block_bytes() on struct cache
Because struct cache_set and struct cache both have struct cache_sb, therefore macro block_bytes() can be used on both of them. When removing the embedded struct cache_sb from struct cache_set, this macro won't be used on struct cache_set anymore. This patch unifies all block_bytes() usage only on struct cache, this is one of the preparation to remove the embedded struct cache_sb from struct cache_set. Signed-off-by: Coly Li <colyli@suse.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
@@ -25,8 +25,8 @@ struct dentry *bcache_debug;
|
||||
for (i = (start); \
|
||||
(void *) i < (void *) (start) + (KEY_SIZE(&b->key) << 9) &&\
|
||||
i->seq == (start)->seq; \
|
||||
i = (void *) i + set_blocks(i, block_bytes(b->c)) * \
|
||||
block_bytes(b->c))
|
||||
i = (void *) i + set_blocks(i, block_bytes(b->c->cache)) * \
|
||||
block_bytes(b->c->cache))
|
||||
|
||||
void bch_btree_verify(struct btree *b)
|
||||
{
|
||||
@@ -82,14 +82,14 @@ void bch_btree_verify(struct btree *b)
|
||||
|
||||
for_each_written_bset(b, ondisk, i) {
|
||||
unsigned int block = ((void *) i - (void *) ondisk) /
|
||||
block_bytes(b->c);
|
||||
block_bytes(b->c->cache);
|
||||
|
||||
pr_err("*** on disk block %u:\n", block);
|
||||
bch_dump_bset(&b->keys, i, block);
|
||||
}
|
||||
|
||||
pr_err("*** block %zu not written\n",
|
||||
((void *) i - (void *) ondisk) / block_bytes(b->c));
|
||||
((void *) i - (void *) ondisk) / block_bytes(b->c->cache));
|
||||
|
||||
for (j = 0; j < inmemory->keys; j++)
|
||||
if (inmemory->d[j] != sorted->d[j])
|
||||
|
||||
Reference in New Issue
Block a user