summaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/btree.c
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-12-17 21:46:35 -0800
committerKent Overstreet <kmo@daterainc.com>2014-01-08 13:05:10 -0800
commit88b9f8c426f35e04738220c1bc05dd1ea1b513a3 (patch)
treeb0391209b767145e53d4c0f52d3cb56376e4dc53 /drivers/md/bcache/btree.c
parent5c41c8a713da7874bd79196696a275beeb11821e (diff)
downloadop-kernel-dev-88b9f8c426f35e04738220c1bc05dd1ea1b513a3.zip
op-kernel-dev-88b9f8c426f35e04738220c1bc05dd1ea1b513a3.tar.gz
bcache: kill index()
That was a terrible name for a macro, add some better helpers to replace it. Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/btree.c')
-rw-r--r--drivers/md/bcache/btree.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 5a6b752..8e2573a 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -258,7 +258,7 @@ static void bch_btree_node_read_done(struct btree *b)
err = "corrupted btree";
for (i = write_block(b);
- index(i, b) < btree_blocks(b);
+ bset_sector_offset(b, i) < KEY_SIZE(&b->key);
i = ((void *) i) + block_bytes(b->c))
if (i->seq == b->sets[0].data->seq)
goto err;
@@ -278,9 +278,9 @@ out:
return;
err:
set_btree_node_io_error(b);
- bch_cache_set_error(b->c, "%s at bucket %zu, block %zu, %u keys",
+ bch_cache_set_error(b->c, "%s at bucket %zu, block %u, %u keys",
err, PTR_BUCKET_NR(b->c, &b->key, 0),
- index(i, b), i->keys);
+ bset_block_offset(b, i), i->keys);
goto out;
}
OpenPOWER on IntegriCloud