summaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/bset.c
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-11-12 03:20:51 +0100
committerKent Overstreet <kmo@daterainc.com>2014-01-08 22:05:11 +0100
commit085d2a3dd4d65b7bce1dead987c647dbbc014281 (patch)
tree89cfb6a71e0c4ea7ae4ff8eb4c148b75a9f14128 /drivers/md/bcache/bset.c
parentbcache: Remove/fix some header dependencies (diff)
downloadlinux-085d2a3dd4d65b7bce1dead987c647dbbc014281.tar.xz
linux-085d2a3dd4d65b7bce1dead987c647dbbc014281.zip
bcache: Make bch_keylist_realloc() take u64s, not nptrs
Getting away from KEY_PTRS and moving toward KEY_U64s - and getting rid of magic 2s Also - split out the part that checks against journal entry size so as to avoid a dependancy on struct cache_set in bset.c Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/bset.c')
-rw-r--r--drivers/md/bcache/bset.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/md/bcache/bset.c b/drivers/md/bcache/bset.c
index e6882659afb9..f91347a55c41 100644
--- a/drivers/md/bcache/bset.c
+++ b/drivers/md/bcache/bset.c
@@ -14,21 +14,13 @@
/* Keylists */
-int bch_keylist_realloc(struct keylist *l, int nptrs, struct cache_set *c)
+int __bch_keylist_realloc(struct keylist *l, unsigned u64s)
{
size_t oldsize = bch_keylist_nkeys(l);
- size_t newsize = oldsize + 2 + nptrs;
+ size_t newsize = oldsize + u64s;
uint64_t *old_keys = l->keys_p == l->inline_keys ? NULL : l->keys_p;
uint64_t *new_keys;
- /* The journalling code doesn't handle the case where the keys to insert
- * is bigger than an empty write: If we just return -ENOMEM here,
- * bio_insert() and bio_invalidate() will insert the keys created so far
- * and finish the rest when the keylist is empty.
- */
- if (newsize * sizeof(uint64_t) > block_bytes(c) - sizeof(struct jset))
- return -ENOMEM;
-
newsize = roundup_pow_of_two(newsize);
if (newsize <= KEYLIST_INLINE ||