linux/drivers/md/bcache
Kent Overstreet 26c949f806 bcache: Add btree_insert_node()
The flow of control in the old btree insertion code was rather -
backwards; we'd recurse down the btree (in btree_insert_recurse()), and
then if we needed to split the keys to be inserted into the parent node
would be effectively returned up to btree_insert_recurse(), which would
notice there was more work to do and finish the insertion.

The main problem with this was that the full logic for btree insertion
could only be used by calling btree_insert_recurse; if you'd gotten to a
btree leaf some other way and had a key to insert, if it turned out that
node needed to be split you were SOL.

This inverts the flow of control so btree_insert_node() does _full_
btree insertion, including splitting - and takes a (leaf) btree node to
insert into as a parameter.

This means we can now _correctly_ handle cache misses - for cache
misses, we need to insert a fake "check" key into the btree when we
discover we have a cache miss - while we still have the btree locked.
Previously, if the btree node was full inserting a cache miss would just
fail.

Signed-off-by: Kent Overstreet <kmo@daterainc.com>
2013-11-10 21:55:57 -08:00
..
alloc.c bcache: Use blkdev_issue_discard() 2013-11-10 21:55:54 -08:00
bcache.h bcache: Stripe size isn't necessarily a power of two 2013-11-10 21:55:55 -08:00
bset.c bcache: Add btree_insert_node() 2013-11-10 21:55:57 -08:00
bset.h bcache: Add btree_insert_node() 2013-11-10 21:55:57 -08:00
btree.c bcache: Add btree_insert_node() 2013-11-10 21:55:57 -08:00
btree.h bcache: Explicitly track btree node's parent 2013-11-10 21:55:57 -08:00
closure.c bcache: Fix a dumb race 2013-07-12 00:22:33 -07:00
closure.h bcache: Build fixes from test robot 2013-03-25 13:06:13 -06:00
debug.c bcache: Use standard utility code 2013-07-01 14:43:53 -07:00
debug.h bcache: Rip out pkey()/pbtree() 2013-06-26 17:09:15 -07:00
io.c bcache: Use standard utility code 2013-07-01 14:43:53 -07:00
journal.c bcache: Add on error panic/unregister setting 2013-11-10 21:55:55 -08:00
journal.h bcache: Fix a journalling performance bug 2013-11-10 21:55:53 -08:00
Kconfig bcache: drop "select CLOSURES" 2013-05-15 00:42:51 -07:00
Makefile
movinggc.c bcache: Fix a lockdep splat 2013-11-10 21:55:54 -08:00
request.c bcache: Fixed incorrect order of arguments to bio_alloc_bioset() 2013-10-23 07:55:36 +01:00
request.h bcache: Fix/revamp tracepoints 2013-06-26 17:09:15 -07:00
stats.c bcache: Fix error handling in init code 2013-05-15 00:48:14 -07:00
stats.h
super.c bcache: Stripe size isn't necessarily a power of two 2013-11-10 21:55:55 -08:00
sysfs.c bcache: Stripe size isn't necessarily a power of two 2013-11-10 21:55:55 -08:00
sysfs.h bcache: Don't export utility code, prefix with bch_ 2013-03-28 12:50:55 -06:00
trace.c bcache: Rip out pkey()/pbtree() 2013-06-26 17:09:15 -07:00
util.c bcache: Fix a writeback performance regression 2013-09-24 14:41:43 -07:00
util.h bcache: Fix a writeback performance regression 2013-09-24 14:41:43 -07:00
writeback.c bcache: Stripe size isn't necessarily a power of two 2013-11-10 21:55:55 -08:00
writeback.h bcache: Stripe size isn't necessarily a power of two 2013-11-10 21:55:55 -08:00