diff options
author | Kent Overstreet <kmo@daterainc.com> | 2014-01-08 21:22:02 -0800 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2014-03-18 12:22:36 -0700 |
commit | c13f3af9247db929fe1be86c0442ef161e615ac4 (patch) | |
tree | 4af0f4811f92718230992a19f97f41df6f3c59ca /drivers/md/bcache/bset.h | |
parent | 15754020524a56517df082799f07de880f4b29e2 (diff) | |
download | op-kernel-dev-c13f3af9247db929fe1be86c0442ef161e615ac4.zip op-kernel-dev-c13f3af9247db929fe1be86c0442ef161e615ac4.tar.gz |
bcache: Add bch_keylist_init_single()
This will potentially save us an allocation when we've got inode/dirent bkeys
that don't fit in the keylist's inline keys.
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/bset.h')
-rw-r--r-- | drivers/md/bcache/bset.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/md/bcache/bset.h b/drivers/md/bcache/bset.h index 003260f..5f6728d 100644 --- a/drivers/md/bcache/bset.h +++ b/drivers/md/bcache/bset.h @@ -478,6 +478,12 @@ static inline void bch_keylist_init(struct keylist *l) l->top_p = l->keys_p = l->inline_keys; } +static inline void bch_keylist_init_single(struct keylist *l, struct bkey *k) +{ + l->keys = k; + l->top = bkey_next(k); +} + static inline void bch_keylist_push(struct keylist *l) { l->top = bkey_next(l->top); |