Rework the way FSFS L1 DAG cache (fs_fs_dag_cache_t) deals with the lifetime of the cached nodes.  Drop the existing approach that performs a non-trivial reference counting for pools in favor of doing a couple of explicit dup()'s.
Rework the way FSFS L1 DAG cache (fs_fs_dag_cache_t) deals with the lifetime
of the cached nodes.  Drop the existing approach that performs a non-trivial
reference counting for pools in favor of doing a couple of explicit dup()'s.

As a consequence, this patch restores a standard pool usage pattern for the
accessor functions to the cached DAG nodes — now these nodes are always
allocated in the passed-in pool, and this is a good thing to have.

* subversion/libsvn_fs_fs/tree.c
  (dag_node_cache_get): Ensure that the result is always allocated in the
   passed-in pool instead of (maybe) binding its lifetime to that pool.
   Achieve this by using the passed-in pool when getting the node from L2
   cache and by making a dup() into the L1 cache pool.  For the nodes that
   already are in L1, make a dup() before yielding the result.  After that,
   remove the needs_lock_cache argument and tweak the docstring.
  (get_dag): Update the calls to dag_node_cache_get().  After that, remove
   the unused needs_lock_cache argument and tweak the docstring.
  (svn_fs_fs__create_dag_cache): Do not register the unlock_cache() pool
   cleanup handler, as we don't lock the cache anymore.
  (auto_clear_dag_cache): Do not check whether the cache has locks when
   attempting to clear it.
  (cache_lock_t, lock_cache, unlock_cache, unregister_locks): Remove.
  (fs_fs_dag_cache_t): Remove the 'first_lock' field, tweak the docstring.
  (svn_fs_fs__node_id, svn_fs_fs__node_created_rev, fs_node_relation,
   fs_node_created_path, fs_node_prop, fs_node_proplist, fs_props_changed,
   fs_dir_entries, fs_copied_from, fs_file_length, fs_file_checksum,
   fs_file_contents, fs_try_process_file_contents, fs_contents_changed,
   fs_get_file_delta_stream, history_prev, crawl_directory_dag_for_mergeinfo,
   add_descendant_mergeinfo, open_path, get_root, make_path_mutable,
   copy_helper, get_copy_inheritance): Update the calls to get_dag().


git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@1655651 13f79535-47bb-0310-9956-ffa450edef68

YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion