1. 11 11月, 2013 7 次提交
    • K
      bcache: Kill bch_next_recurse_key() · 50310164
      Kent Overstreet 提交于
      This dates from before the btree iterator, and now it's finally gone
      Signed-off-by: NKent Overstreet <kmo@daterainc.com>
      50310164
    • K
      bcache: PRECEDING_KEY() · 0eacac22
      Kent Overstreet 提交于
      btree_insert_key() was open coding this, this is just refactoring.
      Signed-off-by: NKent Overstreet <kmo@daterainc.com>
      0eacac22
    • K
      bcache: bch_(btree|extent)_ptr_invalid() · d5cc66e9
      Kent Overstreet 提交于
      Trying to treat btree pointers and leaf node pointers the same way was a
      mistake - going to start being more explicit about the type of
      key/pointer we're dealing with. This is the first part of that
      refactoring; this patch shouldn't change any actual behaviour.
      Signed-off-by: NKent Overstreet <kmo@daterainc.com>
      d5cc66e9
    • K
      bcache: Debug code improvements · 280481d0
      Kent Overstreet 提交于
      Couple changes:
       * Consolidate bch_check_keys() and bch_check_key_order(), and move the
         checks that only check_key_order() could do to bch_btree_iter_next().
      
       * Get rid of CONFIG_BCACHE_EDEBUG - now, all that code is compiled in
         when CONFIG_BCACHE_DEBUG is enabled, and there's now a sysfs file to
         flip on the EDEBUG checks at runtime.
      
       * Dropped an old not terribly useful check in rw_unlock(), and
         refactored/improved a some of the other debug code.
      Signed-off-by: NKent Overstreet <kmo@daterainc.com>
      280481d0
    • K
      bcache: Pull on disk data structures out into a separate header · 81ab4190
      Kent Overstreet 提交于
      Now, the on disk data structures are in a header that can be exported to
      userspace - and having them all centralized is nice too.
      Signed-off-by: NKent Overstreet <kmo@daterainc.com>
      81ab4190
    • K
      bcache: Clean up keylist code · c2f95ae2
      Kent Overstreet 提交于
      More random refactoring.
      Signed-off-by: NKent Overstreet <kmo@daterainc.com>
      c2f95ae2
    • K
      bcache: Add btree_insert_node() · 26c949f8
      Kent Overstreet 提交于
      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: NKent Overstreet <kmo@daterainc.com>
      26c949f8
  2. 27 6月, 2013 1 次提交
    • K
      bcache: Fix/revamp tracepoints · c37511b8
      Kent Overstreet 提交于
      The tracepoints were reworked to be more sensible, and fixed a null
      pointer deref in one of the tracepoints.
      
      Converted some of the pr_debug()s to tracepoints - this is partly a
      performance optimization; it used to be that with DEBUG or
      CONFIG_DYNAMIC_DEBUG pr_debug() was an empty macro; but at some point it
      was changed to an empty inline function.
      
      Some of the pr_debug() statements had rather expensive function calls as
      part of the arguments, so this code was getting run unnecessarily even
      on non debug kernels - in some fast paths, too.
      Signed-off-by: NKent Overstreet <koverstreet@google.com>
      c37511b8
  3. 24 3月, 2013 1 次提交