Open fsfs-improvements integration branch

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-improvements@1499981 13f79535-47bb-0310-9956-ffa450edef68
On the fsfs-improvements branch:

* BRANCH-README: add

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-improvements@1499984 13f79535-47bb-0310-9956-ffa450edef68
On the fsfs-improvements branch: Sync with /trunk.

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-improvements@1502256 13f79535-47bb-0310-9956-ffa450edef68
On the fsfs-improvements branch:  First FSFS refactoring step.

This introduces a low-level FSFS data structure read / write API.
The basic functionality is taken out of fsfs.c and functions are
given proper svn_fs_fs__ prefixes.  All file and char* parameters
have been replaced consistently by stream and stringbuf objects.

Also, introduce proper enum type to represent the various ways a
representation may be encoded (plain, self-delta, delta) instead
of a collection of booleans.

* subversion/libsvn_fs_fs/low_level.h
  (SVN_FS_FS__KIND_FILE,
   SVN_FS_FS__KIND_DIR): declare FSFS-global constants
  (svn_fs_fs__rep_type_t): new enum type
  (svn_fs_fs__rep_header_t): former rep_args struct
  (svn_fs_fs__parse_revision_trailer
   svn_fs_fs__unparse_revision_trailer
   svn_fs_fs__read_changes,
   svn_fs_fs__write_changes
   svn_fs_fs__read_noderev,
   svn_fs_fs__write_noderev,
   svn_fs_fs__parse_representation
   svn_fs_fs__unparse_representation
   svn_fs_fs__read_rep_header,
   svn_fs_fs__write_rep_header): declare the low-level API funcs

* subversion/libsvn_fs_fs/low_level.c
  (HEADER_ID,
   HEADER_TYPE,
   HEADER_COUNT,
   HEADER_PROPS,
   HEADER_TEXT,
   HEADER_CPATH,
   HEADER_PRED,
   HEADER_COPYFROM,
   HEADER_COPYROOT,
   HEADER_FRESHTXNRT,
   HEADER_MINFO_HERE,
   HEADER_MINFO_CNT,
   ACTION_MODIFY,
   ACTION_ADD,
   ACTION_DELETE,
   ACTION_REPLACE,
   ACTION_RESET,
   FLAG_TRUE,
   FLAG_FALSE,
   REP_PLAIN,
   REP_DELTA,
   FSFS_MAX_PATH_LEN,
   MAX_CHANGE_LINE_LEN): constants moved over from fsfs.c
  (read_header_block,
   read_rep_offsets,
   read_change,
   write_change_entry): code moved over from fsfs.c
  (svn_fs_fs__parse_revision_trailer
   svn_fs_fs__unparse_revision_trailer
   svn_fs_fs__read_changes,
   svn_fs_fs__write_changes
   svn_fs_fs__read_noderev,
   svn_fs_fs__write_noderev,
   svn_fs_fs__parse_representation
   svn_fs_fs__unparse_representation
   svn_fs_fs__read_rep_header,
   svn_fs_fs__write_rep_header): implement API, code mostly taken
                                 from fsfs.c

* subversion/libsvn_fs_fs/fs_fs.h
  (svn_fs_fs__write_noderev,
   svn_fs_fs__read_noderev): moved to low_level.c

* subversion/libsvn_fs_fs/fs_fs.c
  (HEADER_ID,
   HEADER_TYPE,
   HEADER_COUNT,
   HEADER_PROPS,
   HEADER_TEXT,
   HEADER_CPATH,
   HEADER_PRED,
   HEADER_COPYFROM,
   HEADER_COPYROOT,
   HEADER_FRESHTXNRT,
   HEADER_MINFO_HERE,
   HEADER_MINFO_CNT,
   ACTION_MODIFY,
   ACTION_ADD,
   ACTION_DELETE,
   ACTION_REPLACE,
   ACTION_RESET,
   FLAG_TRUE,
   FLAG_FALSE,
   REP_PLAIN,
   REP_DELTA,
   FSFS_MAX_PATH_LEN,
   MAX_CHANGE_LINE_LEN): constants moved to low_level.c
  (KIND_FILE,
   KIND_DIR): renamed and moved to low_level.h
  (read_header_block,
   read_rep_offsets,
   read_change,
   write_change_entry,
   svn_fs_fs__read_noderev,
   svn_fs_fs__write_noderev): moved to low_level.c
  (read_rep_offsets_body,
   representation_string,
   read_rep_line,
   read_all_changes): renamed and moved to low_level.c
  (get_fs_id_at_offset,
   get_root_changes_offset,
   rep_write_get_baton,
   write_hash_delta_rep,
   write_final_changed_path_info,
   commit_body): simplify using the new API
  (create_rep_state_body): update caller & signature
  (store_sha1_rep_mapping,
   create_rep_state,
   build_rep_list,
   svn_fs_fs__get_file_delta_stream,
   unparse_dir_entry,
   parse_dir_entries,
   svn_fs_fs__txn_changes_fetch,
   get_changes,
   svn_fs_fs__add_change,
   choose_delta_base,
   get_shared_rep,
   recover_find_max_ids,
   verify_walker): update caller


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-improvements@1502517 13f79535-47bb-0310-9956-ffa450edef68
On the fsfs-improvements branch:  Moving a few utility functions
out of fsfs.c into a new util.* pair of files.  These will be used
by various FSFS modules and further functions will be moved there.  

Since these functions are now part of an internal API, they get
proper svn_fs_fs__ prefixes and commentary.

* subversion/libsvn_fs_fs/util.h
  (svn_fs_fs__is_packed_rev,
   svn_fs_fs__path_rev_packed,
   svn_fs_fs__path_min_unpacked_rev,
   svn_fs_fs__read_min_unpacked_rev,
   svn_fs_fs__read_number_from_stream): declare new internal API function
  (svn_fs_fs__write_revnum_file): ditto; 
                                  switch parameter from path string to fs

* subversion/libsvn_fs_fs/util.c
  (svn_fs_fs__is_packed_rev,
   svn_fs_fs__path_rev_packed,
   svn_fs_fs__path_min_unpacked_rev,
   svn_fs_fs__read_min_unpacked_rev,
   svn_fs_fs__read_number_from_stream,
   svn_fs_fs__write_revnum_file): implement using former fsfs.c code

* subversion/libsvn_fs_fs/fs_fs.c
  (read_min_unpacked_rev,
   is_packed_rev,
   path_rev_packed,
   path_min_unpacked_rev,
   read_min_unpacked_rev,
   read_number_from_stream,
   write_revnum_file): renamed & moved to util.c
  (path_rev,
   update_min_unpacked_rev,
   upgrade_body,
   get_packed_offset,
   open_and_seek_revision,
   get_root_changes_offset,
   parse_packed_revprops, 
   svn_fs_fs__create,
   pack_shard,
   pack_body, 
   hotcopy_copy_packed_shard,
   hotcopy_body,
   hotcopy_create_empty_dest): update callers

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-improvements@1502594 13f79535-47bb-0310-9956-ffa450edef68
On the fsfs-improvements branch:  Classic refactoring moving general
packing logic from fs_fs.c to the new pack.* pair of files.  Revprop
packing will be bundled with the revprop logic later and remains in
fs_fs.c for now.  We need to expose some of it as private API, though.

* subversion/libsvn_fs_fs/pack.h
  (svn_fs_fs__pack,
   svn_fs_fs__get_packed_offset): define private API

* subversion/libsvn_fs_fs/pack.c
  (pack_baton): struct moved here from fs_fs.c
  (pack_phys_addressed,
   pack_rev_shard,
   pack_shard,
   pack_body): code moved here from fs_fs.c
  (svn_fs_fs__get_packed_offset,
   svn_fs_fs__pack): rename / move here from fs_fs.c

* subversion/libsvn_fs_fs/fs_fs.h
  (svn_fs_fs__pack): remove here
  (svn_fs_fs__pack_revprops_shard,
   svn_fs_fs__delete_revprops_shard): make part of our private API

* subversion/libsvn_fs_fs/fs_fs.c
  (upgrade_pack_revprops,
   upgrade_cleanup_pack_revprops,
   open_and_seek_revision,
   get_root_changes_offset,
   create_rep_state_body): update callers
  (svn_fs_fs__pack_revprops_shard,
   svn_fs_fs__delete_revprops_shard): add "svn_fs_fs__" prefix;
                                      drop forward declaration from .c file
  (get_packed_offset,
   pack_rev_shard,
   pack_shard,
   pack_baton
   pack_body,
   svn_fs_fs__pack): code moved to pack.c

* subversion/libsvn_fs_fs/fs.c
  (): add #include

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-improvements@1502605 13f79535-47bb-0310-9956-ffa450edef68
On the fsfs-improvements branch: Sync with /trunk.

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-improvements@1502791 13f79535-47bb-0310-9956-ffa450edef68
On the fsfs-improvements branch:  Move more of the commonly used file and
path utilities from fs_fs.* to utils.*.  Again, we add the svn_fs_fs__
prefix to everything in utils.h.

Also make all path getters that didn't do so before return a const char*
instead of an svn_error_t *.

* subversion/libsvn_fs_fs/util.h
  (SVN_FS_FS__RECOVERABLE_RETRY_COUNT): declare private API constant
  (svn_fs_fs__is_packed_revprop,
   svn_fs_fs__path_rev_shard,
   svn_fs_fs__path_rev,
   svn_fs_fs__path_revprop_generation,
   svn_fs_fs__path_revprops_pack_shard,
   svn_fs_fs__path_revprops_shard,
   svn_fs_fs__path_revprops,
   svn_fs_fs__path_rev_absolute,
   svn_fs_fs__check_file_buffer_numeric,
   svn_fs_fs__update_min_unpacked_rev,
   svn_fs_fs__try_stringbuf_from_file,
   svn_fs_fs__read_content,
   svn_fs_fs__move_into_place): declare private API taken from fs_fs.*
  (svn_fs_fs__path_rev_absolute): ditto; change return type

* subversion/libsvn_fs_fs/util.c
  (svn_fs_fs__is_packed_revprop,
   svn_fs_fs__path_rev_shard,
   svn_fs_fs__path_rev,
   svn_fs_fs__path_revprop_generation,
   svn_fs_fs__path_revprops_pack_shard,
   svn_fs_fs__path_revprops_shard,
   svn_fs_fs__path_revprops,
   svn_fs_fs__path_rev_absolute,
   svn_fs_fs__check_file_buffer_numeric,
   svn_fs_fs__update_min_unpacked_rev,
   svn_fs_fs__try_stringbuf_from_file,
   svn_fs_fs__read_content,
   svn_fs_fs__move_into_place): rename; code taken from fs_fs.c
  (svn_fs_fs__path_rev_absolute): ditto; change return type

* subversion/libsvn_fs_fs/fs_fs.h
  (svn_fs_fs__path_rev_absolute): remove here, moved to utils.h

* subversion/libsvn_fs_fs/fs_fs.c
  (RECOVERABLE_RETRY_COUNT): renamed and moved to utils.h
  (is_packed_revprop,
   path_revprop_generation,
   path_rev_shard,
   path_rev,
   svn_fs_fs__path_rev_absolute,
   path_revprops_shard,
   path_revprops_pack_shard,
   path_revprops,
   check_file_buffer_numeric,
   update_min_unpacked_rev,
   try_stringbuf_from_file,
   read_content,
   move_into_place): renamed and moved to utils.c
  (with_some_lock_file,
   check_format_file_buffer_numeric,
   svn_fs_fs__open,
   get_youngest,
   open_pack_or_rev_file,
   read_revprop_generation_file,
   write_revprop_generation_file,
   read_non_packed_revprop,
   get_revprop_packname,
   read_pack_revprop,
   get_revision_proplist,
   write_non_packed_revprop,
   set_revision_proplist,
   get_and_increment_txn_key_body,
   get_next_revision_ids,
   commit_body,
   write_revision_zero,
   svn_fs_fs__create,
   packed_revprop_available,
   recover_body,
   hotcopy_update_current,
   hotcopy_body,
   hotcopy_create_empty_dest): update callers
  (get_root_changes_offset): update docstring

* subversion/libsvn_fs_fs/lock.c
  (delete_lock, 
   lock_body): update callers

* subversion/libsvn_fs_fs/pack.c
  (pack_body): update docstring


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-improvements@1502964 13f79535-47bb-0310-9956-ffa450edef68
On the fsfs-improvements branch:  Clean up fallout of the 
svn_fs_fs__path_rev_absolute API change.

* subversion/libsvn_fs_fs/fs_fs.c
  (open_pack_or_rev_file): Fix access to unitialized data.

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-improvements@1503236 13f79535-47bb-0310-9956-ffa450edef68
On the fsfs-improvements branch:  Move all non-txn revprops code
from fs_fs.* to the new revprops.* pair of files and turn functions
required by other parts into private API with an svn_fs_fs__ prefix.

Once at it, get rid of svn_fs_fs__revision_proplist and directly
use svn_fs_fs__get_revision_proplist instead.

* subversion/libsvn_fs_fs/revprops.h
  (svn_fs_fs__pack_revprops_shard,
   svn_fs_fs__delete_revprops_shard): moved here from fs_fs.h
  (svn_fs_fs__write_revprop_generation_file,
   svn_fs_fs__upgrade_pack_revprops,
   svn_fs_fs__upgrade_cleanup_pack_revprops,
   svn_fs_fs__get_revision_proplist,
   svn_fs_fs__set_revision_proplist,
   svn_fs_fs__packed_revprop_available,
   svn_fs_fs__copy_revprops): declare new private API

* subversion/libsvn_fs_fs/revprops.c
  (REVPROP_CHANGE_TIMEOUT,
   ATOMIC_REVPROP_GENERATION,
   ATOMIC_REVPROP_TIMEOUT,
   ATOMIC_REVPROP_NAMESPACE): constants moved over from fs_fs.c
  (struct revprop_generation_fixup_t,
   struct packed_revprops_t): types moved over from fs_fs.c
  (read_revprop_generation_file,
   ensure_revprop_namespace,
   ensure_revprop_generation,
   ensure_revprop_timeout,
   log_revprop_cache_init_warning,
   has_revprop_cache,
   revprop_generation_fixup,
   read_revprop_generation,
   begin_revprop_change,
   end_revprop_change,
   parse_revprop,
   read_non_packed_revprop,
   get_revprop_packname,
   parse_packed_revprops,
   read_pack_revprop,
   write_non_packed_revprop,
   switch_to_new_revprop,
   serialize_revprops_header,
   repack_revprops,
   repack_stream_open,
   write_packed_revprop,
   svn_fs_fs__pack_revprops_shard,
   svn_fs_fs__delete_revprops_shard): moved over from fs_fs.c;
                                      update function calls as needed
  (svn_fs_fs__upgrade_pack_revprops,
   svn_fs_fs__upgrade_cleanup_pack_revprops,
   svn_fs_fs__write_revprop_generation_file,
   svn_fs_fs__cleanup_revprop_namespace,
   svn_fs_fs__get_revision_proplist,
   svn_fs_fs__set_revision_proplist,
   svn_fs_fs__packed_revprop_available,
   svn_fs_fs__copy_revprops): ditto; rename due to API conventions

* subversion/libsvn_fs_fs/fs_fs.h
  (svn_fs_fs__pack_revprops_shard,
   svn_fs_fs__delete_revprops_shard): moved to from revprops.h

* subversion/libsvn_fs_fs/fs.c
  (): include the new prevprops.h header
  (fs_vtable): use svn_fs_fs__get_revision_proplist directly

* subversion/libsvn_fs_fs/pack.c
  (): include the new prevprops.h header

* subversion/libsvn_fs_fs/fs_fs.c
  (REVPROP_CHANGE_TIMEOUT,
   ATOMIC_REVPROP_GENERATION,
   ATOMIC_REVPROP_TIMEOUT,
   ATOMIC_REVPROP_NAMESPACE): constants moved over to revprops.c
  (struct revprop_generation_fixup_t,
   struct packed_revprops_t): types moved over to revprops.c
  (read_revprop_generation_file,
   ensure_revprop_namespace,
   ensure_revprop_generation,
   ensure_revprop_timeout,
   log_revprop_cache_init_warning,
   has_revprop_cache,
   revprop_generation_fixup,
   read_revprop_generation,
   begin_revprop_change,
   end_revprop_change,
   parse_revprop,
   read_non_packed_revprop,
   get_revprop_packname,
   parse_packed_revprops,
   read_pack_revprop,
   write_non_packed_revprop,
   switch_to_new_revprop,
   serialize_revprops_header,
   repack_revprops,
   repack_stream_open,
   write_packed_revprop,
   svn_fs_fs__pack_revprops_shard,
   svn_fs_fs__delete_revprops_shard): moved over to revprops.c
  (upgrade_pack_revprops,
   upgrade_cleanup_pack_revprops,
   write_revprop_generation_file,
   cleanup_revprop_namespace,
   get_revision_proplist,
   set_revision_proplist,
   packed_revprop_available,
   copy_revprops): renamed and moved over to revprops.c
  (svn_fs_fs__revision_proplist): drop
  (upgrade_body,
   write_revision_zero,
   recover_body,
   change_rev_prop_body,
   hotcopy_body): update callers

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-improvements@1503279 13f79535-47bb-0310-9956-ffa450edef68
On the fsfs-improvements branch:  Move some more of the path calculation
and file I/O functions to utils.*.

* subversion/libsvn_fs_fs/util.h
  (svn_fs_fs__path_txn_dir,
   svn_fs_fs__path_txn_proto_rev,
   svn_fs_fs__path_txn_node_rev,
   svn_fs_fs__path_txn_node_props,
   svn_fs_fs__path_txn_node_children,
   svn_fs_fs__get_file_offset,
   svn_fs_fs__open_pack_or_rev_file): declare new private APIs

* subversion/libsvn_fs_fs/util.c
  (svn_fs_fs__path_txn_dir,
   svn_fs_fs__path_txn_proto_rev,
   svn_fs_fs__path_txn_node_rev,
   svn_fs_fs__path_txn_node_props,
   svn_fs_fs__path_txn_node_children,
   svn_fs_fs__get_file_offset,
   svn_fs_fs__open_pack_or_rev_file): code taken from fs_fs.c;
                                      added API prefix

* subversion/libsvn_fs_fs/fs_fs.c
  (path_txn_dir,
   path_txn_proto_rev,
   path_txn_node_rev,
   path_txn_node_props,
   path_txn_node_children,
   get_file_offset,
   open_pack_or_rev_file): moved to utils.c
  (path_txn_sha1,
   path_txn_changes,
   path_txn_props,
   path_txn_next_ids,
   open_and_seek_revision,
   get_writable_proto_rev_body, 
   purge_shared_txn, 
   svn_fs_fs__revision_exists, 
   open_and_seek_revision, 
   open_and_seek_transaction, 
   get_node_revision_body, 
   svn_fs_fs__put_node_revision, 
   svn_fs_fs__rev_get_root, 
   create_rep_state_body, 
   read_delta_window, 
   get_dir_contents, 
   svn_fs_fs__get_proplist, 
   get_changes, 
   svn_fs_fs__create_txn, 
   svn_fs_fs__purge_txn, 
   svn_fs_fs__set_entry, 
   rep_write_get_baton, 
   rep_write_contents_close, 
   svn_fs_fs__set_proplist, 
   write_hash_rep, 
   write_hash_delta_rep, 
   write_final_rev, 
   write_final_changed_path_info, 
   commit_body, 
   recover_get_largest_revision, 
   recover_body, 
   svn_fs_fs__open_txn, 
   svn_fs_fs__delete_node_revision, 
   hotcopy_update_current): update callers

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-improvements@1503664 13f79535-47bb-0310-9956-ffa450edef68
On the fsfs-improvements branch:  Minor code beautification,
renaming rev_state to rev_state_t and typedef-ing it.

* subversion/libsvn_fs_fs/fs_fs.c
  (rep_state): rename to rev_state_t and typedef it
  (create_rep_state_body,
   create_rep_state,
   get_window_key,
   get_cached_window,
   set_cached_window,
   get_cached_combined_window,
   set_cached_combined_window,
   build_rep_list,
   read_delta_window,
   read_plain_window,
   get_combined_window,
   get_contents,
   delta_read_baton,
   svn_fs_fs__get_file_delta_stream,
   choose_delta_base,
   verify_walker): update users


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-improvements@1503666 13f79535-47bb-0310-9956-ffa450edef68
On the fsfs-improvements branch:  Some actual refactoring.
Factor out some low-level functions processing representations
and their delta chains.  Also, substitute calls to the static
get_root_changes_offset with svn_fs_fs__rev_get_root API calls
in a few places (prepares for the following commit).

* subversion/libsvn_fs_fs/fs_fs.c
  (create_rep_state,
   build_rep_list): add missing spaces in comments
  (check_rep): new utility function factored out from verify_walker
  (rep_chain_length): new utility function factored out from choose_delta_base
  (choose_delta_base,
   verify_walker): use new utilities
  (get_changes): tighter variable scope; use svn_fs_fs__revision_exists API
                 instead of static ensure_revision_exists
  (recover_body,
   hotcopy_update_current): use svn_fs_fs__rev_get_root API

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-improvements@1503676 13f79535-47bb-0310-9956-ffa450edef68
On the fsfs-improvements branch:  Create an internal API above the
low-level API.  It provides cached read access to repository data.

As usual, the code is taken from fs_fs.* and moved to a new pair of
files, cached_data.*.  The only API change is that svn_fs_fs__get_contents
now takes a representation_t * instead of noderev_t *.

* subversion/libsvn_fs_fs/cached_data.h
  (): new file
  (svn_fs_fs__get_node_revision(node_revision_t **noderev_p,
   svn_fs_fs__rev_get_root(svn_fs_id_t **root_id,
   svn_fs_fs__rep_contents_dir,
   svn_fs_fs__rep_contents_dir_entry,
   svn_fs_fs__get_contents,
   svn_fs_fs__try_process_file_contents,
   svn_fs_fs__get_file_delta_stream,
   svn_fs_fs__get_proplist): declarations moved here from fs_fs.h
  (svn_fs_fs__check_rep,
   svn_fs_fs__rep_chain_length): new private API
  (svn_fs_fs__get_contents): moved here from fs_fs.h; changed signature

* subversion/libsvn_fs_fs/cached_data.c
  (): new file
  (rep_state_t,
   cache_access_wrapper_baton_t,
   rep_read_baton,
   delta_read_baton): types moved from here from fs_fs.c
   open_and_seek_revision,
   open_and_seek_transaction,
   open_and_seek_representation,
   err_dangling_id,
   get_cached_node_revision_body,
   set_cached_node_revision_body,
   get_node_revision_body,
   get_fs_id_at_offset,
   get_root_changes_offset,
   create_rep_state_body,
   create_rep_state,
   get_window_key,
   get_cached_window,
   set_cached_window,
   get_cached_combined_window,
   set_cached_combined_window,
   build_rep_list,
   rep_read_get_baton,
   read_delta_window,
   read_plain_window,
   get_combined_window,
   fulltext_size_is_cachable,
   rep_read_contents_close,
   get_contents,
   rep_read_contents,
   cache_access_wrapper,
   delta_read_next_window,
   delta_read_md5_digest,
   get_dir_contents,
   parse_dir_entries,
   locate_dir_cache): static functions moved here from fs_fs.c
  (svn_fs_fs__get_node_revision(node_revision_t **noderev_p,
   svn_fs_fs__rev_get_root(svn_fs_id_t **root_id,
   svn_fs_fs__rep_contents_dir,
   svn_fs_fs__rep_contents_dir_entry,
   svn_fs_fs__get_contents,
   svn_fs_fs__try_process_file_contents,
   svn_fs_fs__get_file_delta_stream,
   svn_fs_fs__get_proplist): implementations moved here from fs_fs.c
  (svn_fs_fs__check_rep,
   svn_fs_fs__rep_chain_length): ditto, added API prefix
  (svn_fs_fs__get_contents): changed signature; implementation taken
                             from fs_fs.c's read_representation()

* subversion/libsvn_fs_fs/fs_fs.h
  (svn_fs_fs__get_node_revision(node_revision_t **noderev_p,
   svn_fs_fs__rev_get_root(svn_fs_id_t **root_id,
   svn_fs_fs__rep_contents_dir,
   svn_fs_fs__rep_contents_dir_entry,
   svn_fs_fs__get_contents,
   svn_fs_fs__try_process_file_contents,
   svn_fs_fs__get_file_delta_stream,
   svn_fs_fs__get_proplist): declarations moved staight to cached_data.h
  (svn_fs_fs__recover): 
  (svn_fs_fs__revision_exists): 

* subversion/libsvn_fs_fs/fs_fs.c
  (): #include new header
  (rep_state_t,
   cache_access_wrapper_baton_t,
   rep_read_baton,
   delta_read_baton): types moved from here from fs_fs.c
   open_and_seek_revision,
   open_and_seek_transaction,
   open_and_seek_representation,
   err_dangling_id,
   get_cached_node_revision_body,
   set_cached_node_revision_body,
   get_node_revision_body,
   get_fs_id_at_offset,
   get_root_changes_offset,
   create_rep_state_body,
   create_rep_state,
   get_window_key,
   get_cached_window,
   set_cached_window,
   get_cached_combined_window,
   set_cached_combined_window,
   build_rep_list,
   rep_read_get_baton,
   read_delta_window,
   read_plain_window,
   get_combined_window,
   fulltext_size_is_cachable,
   rep_read_contents_close,
   get_contents,
   rep_read_contents,
   cache_access_wrapper,
   delta_read_next_window,
   delta_read_md5_digest,
   get_dir_contents,
   parse_dir_entries,
   locate_dir_cache,
   check_rep,
   rep_chain_length,
   read_representation,
   svn_fs_fs__get_node_revision,
   svn_fs_fs__rev_get_root,
   svn_fs_fs__rep_contents_dir,
   svn_fs_fs__rep_contents_dir_entry,
   svn_fs_fs__get_contents,
   svn_fs_fs__try_process_file_contents,
   svn_fs_fs__get_file_delta_stream,
   svn_fs_fs__get_proplist,
   svn_fs_fs__get_contents): moved to cached_data.c
  (svn_fs_fs__paths_changed,
   choose_delta_base,
   rep_write_get_baton,
   write_hash_delta_rep,
   verify_walker): update private API caller

* subversion/libsvn_fs_fs/dag.c
  (): #include new header
  (svn_fs_fs__dag_get_contents): update private API caller

* subversion/libsvn_fs_fs/tree.c
  (): #include new header

* tools/server-side/svn-rep-sharing-stats.c
  (): #include new header

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-improvements@1503692 13f79535-47bb-0310-9956-ffa450edef68
On the fsfs-improvements branch:  Move repository verification
code from fs_fs.* to a new verify.* pair of files.

Also, factor out the actual checks from the svn_fs_fs__verify
function such that more checks may be added later easily.

* subversion/libsvn_fs_fs/verify.h
  (): new file
  (svn_fs_fs__verify): move declaration here from fs_fs.h

* subversion/libsvn_fs_fs/verify.c
  (): new file, code taken from fs_fs.c
  (verify_walker_baton_t,
   verify_walker): moved here
  (verify_rep_cache): factored out from svn_fs_fs__verify
  (svn_fs_fs__verify): stripped down to parameter checks

* subversion/libsvn_fs_fs/fs_fs.h
  (): new file
  (svn_fs_fs__verify): move declaration to verify.h

* subversion/libsvn_fs_fs/fs_fs.c
  (verify_walker_baton_t,
   verify_walker,
   svn_fs_fs__verify): code moved to verify.c
  (get_shared_rep): update caller

* subversion/libsvn_fs_fs/fs.c
  (): #include new header

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-improvements@1503718 13f79535-47bb-0310-9956-ffa450edef68
On the fsfs-improvements branch:  Move recovery code out of fs_fs.*
into a new, separate recovery.* pair of files.  This requires the
creation of two new utility APIs, svn_fs_fs__write_current and
svn_fs_fs__find_max_ids.  The latter is a wrapper around the existing
recover_find_max_ids code.

* subversion/libsvn_fs_fs/util.h
  (svn_fs_fs__write_current): declare new private API

* subversion/libsvn_fs_fs/util.c
  (svn_fs_fs__write_current): code moved over from fs_fs.c

* subversion/libsvn_fs_fs/recovery.h
  (svn_fs_fs__find_max_ids): declare new private API
  (svn_fs_fs__recover): declaration moved over from fs_fs.h

* subversion/libsvn_fs_fs/util.c
  (recover_read_from_file_baton,
   recover_baton): types moved over from fs_fs.c
  (recover_get_largest_revision,
   read_handler_recover,
   recover_find_max_ids,
   recover_body): static functions moved over from fs_fs.c
  (svn_fs_fs__find_max_ids): implement new API function
  (svn_fs_fs__recover): code moved over from fs_fs.c

* subversion/libsvn_fs_fs/fs.c
  (): #include new header

* subversion/libsvn_fs_fs/fs_fs.c
  (): #include new header
  (write_current): moved to utils.c
  (recover_read_from_file_baton,
   recover_baton,
   recover_get_largest_revision,
   read_handler_recover,
   recover_find_max_ids,
   recover_body,
   svn_fs_fs__recover): moved to recovery.c
  (write_final_current): update caller
  (hotcopy_update_current): simplify using the new API

* subversion/libsvn_fs_fs/fs_fs.h
  (svn_fs_fs__recover): moved to recovery.h


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-improvements@1503742 13f79535-47bb-0310-9956-ffa450edef68
On the fsfs-improvements branch:  Move path getters for some global
FSFS files from fs_fs.c to utils.*.

Also, publish the write_format function and simplify its signature.

* subversion/libsvn_fs_fs/util.h
  (svn_fs_fs__path_txn_current,
   svn_fs_fs__path_txn_current_lock,
   svn_fs_fs__path_lock): declare new private API

* subversion/libsvn_fs_fs/util.c
  (svn_fs_fs__path_txn_current,
   svn_fs_fs__path_txn_current_lock,
   svn_fs_fs__path_lock): implement with code taken from fs_fs.c

* subversion/libsvn_fs_fs/fs_fs.h
  (svn_fs_fs__write_format): declare write_format as a new private API

* subversion/libsvn_fs_fs/fs_fs.c
  (path_txn_current,
   path_txn_current_lock,
   path_lock): moved to utils.c
  (write_format): rename; shorten signature and update implementation
  (upgrade_body,
   svn_fs_fs__create,
   hotcopy_body): update callers

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-improvements@1503789 13f79535-47bb-0310-9956-ffa450edef68
On the fsfs-improvements branch:  Move the hotcopy code from fs_fs.c
to the new hotcopy.* pair of files.  No further code changes required.

* subversion/libsvn_fs_fs/hotcopy.h
  (): new file
  (svn_fs_fs__hotcopy): declaration moved here from fs_fs.h

* subversion/libsvn_fs_fs/hotcopy.c
  (): new file
  (hotcopy_body_baton,
   hotcopy_io_dir_file_copy,
   entry_name_to_utf8,
   hotcopy_io_copy_dir_recursively,
   hotcopy_copy_shard_file,
   hotcopy_copy_packed_shard,
   hotcopy_update_current,
   hotcopy_remove_rev_files,
   hotcopy_incremental_check_preconditions,
   hotcopy_body,
   hotcopy_setup_shared_fs_data,
   hotcopy_create_empty_dest,
   svn_fs_fs__hotcopy): moved here from fs_fs.c

* subversion/libsvn_fs_fs/fs_fs.h
  (): #include new header
  (svn_fs_fs__hotcopy): moved to hotcopy.h

* subversion/libsvn_fs_fs/fs_fs.c
  (hotcopy_body_baton,
   hotcopy_io_dir_file_copy,
   entry_name_to_utf8,
   hotcopy_io_copy_dir_recursively,
   hotcopy_copy_shard_file,
   hotcopy_copy_packed_shard,
   hotcopy_update_current,
   hotcopy_remove_rev_files,
   hotcopy_incremental_check_preconditions,
   hotcopy_body,
   hotcopy_setup_shared_fs_data,
   hotcopy_create_empty_dest,
   svn_fs_fs__hotcopy): moved to hotcopy.c

* subversion/libsvn_fs_fs/fs.c
  (): #include new header


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-improvements@1503792 13f79535-47bb-0310-9956-ffa450edef68
On the fsfs-improvements branch:  remove static functions that are
already available via private API.

Also, make with_txn_current_lock available through a private API
as well (symmetrical to svn_fs_fs__with_write_lock.

* subversion/libsvn_fs_fs/fs_fs.h
  (svn_fs_fs__with_txn_current_lock): declare a new private API

* subversion/libsvn_fs_fs/fs_fs.c
  (path_txn_current,
   path_txn_current_lock): drop
  (upgrade_body,
   get_and_increment_txn_key_body, 
   create_txn_dir,
   svn_fs_fs__create): call the APIs
  (with_txn_current_lock): rename to ...
  (svn_fs_fs__with_txn_current_lock): this


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-improvements@1504098 13f79535-47bb-0310-9956-ffa450edef68
On the fsfs-improvements branch:  Last step in the fs_fs.* split up.
Move transaction code to the new transaction.* pair.  Although this
is a large patch, this time it is actually just moving code around
and adding a few #includes.

* subversion/libsvn_fs_fs/transaction.h
  (): new file
  (svn_fs_fs__put_node_revision,
   svn_fs_fs__txn_changes_fetch,
   svn_fs_fs__paths_changed,
   svn_fs_fs__create_txn,
   svn_fs_fs__change_txn_prop,
   svn_fs_fs__change_txn_props,
   svn_fs_fs__get_txn,
   svn_fs_fs__reserve_copy_id,
   svn_fs_fs__create_node,
   svn_fs_fs__purge_txn,
   svn_fs_fs__abort_txn,
   svn_fs_fs__set_entry,
   svn_fs_fs__add_change,
   svn_fs_fs__set_contents,
   svn_fs_fs__create_successor,
   svn_fs_fs__set_proplist,
   svn_fs_fs__commit,
   svn_fs_fs__list_transactions,
   svn_fs_fs__open_txn,
   svn_fs_fs__txn_proplist,
   svn_fs_fs__delete_node_revision,
   svn_fs_fs__get_txn_ids,
   svn_fs_fs__txn_prop,
   svn_fs_fs__begin_txn): moved over from fs_fs.h

* subversion/libsvn_fs_fs/transaction.c
  (): new file
  (txn_vtable): moved variable declaration here from fs_fs.c
  (unlock_proto_rev_baton,
   get_writable_proto_rev_baton,
   get_and_increment_txn_key_baton,
   rep_write_baton,
   write_hash_baton,
   commit_baton): moved structure declaration here from fs_fs.c
  (path_txn_sha1,
   path_txn_changes,
   path_txn_props,
   path_txn_proto_rev_lock,
   path_txn_next_ids,
   path_and_offset_of,
   get_shared_txn,
   free_shared_txn,
   with_txnlist_lock,
   unlock_proto_rev_body,
   unlock_proto_rev,
   unlock_proto_rev_list_locked,
   get_writable_proto_rev_body,
   get_writable_proto_rev,
   purge_shared_txn_body,
   purge_shared_txn,
   store_sha1_rep_mapping,
   unparse_dir_entry,
   unparse_dir_entries,
   fold_change,
   process_changes,
   create_new_txn_noderev_from_rev,
   get_and_increment_txn_key_body,
   create_txn_dir,
   create_txn_dir_pre_1_5,
   get_txn_proplist,
   write_next_ids,
   read_next_ids,
   get_new_txn_node_id,
   rep_write_contents,
   choose_delta_base,
   rep_write_cleanup,
   rep_write_get_baton,
   get_shared_rep,
   rep_write_contents_close,
   set_representation,
   get_next_revision_ids,
   write_hash_handler,
   write_hash_rep,
   write_hash_delta_rep,
   validate_root_noderev,
   write_final_rev,
   write_final_changed_path_info,
   verify_as_revision_before_current_plus_plus,
   write_final_current,
   verify_locks,
   commit_body,
   write_reps_to_cache): moved static functions here from fs_fs.c
  (svn_fs_fs__put_node_revision,
   svn_fs_fs__txn_changes_fetch,
   svn_fs_fs__paths_changed,
   svn_fs_fs__create_txn,
   svn_fs_fs__change_txn_prop,
   svn_fs_fs__change_txn_props,
   svn_fs_fs__get_txn,
   svn_fs_fs__reserve_copy_id,
   svn_fs_fs__create_node,
   svn_fs_fs__purge_txn,
   svn_fs_fs__abort_txn,
   svn_fs_fs__set_entry,
   svn_fs_fs__add_change,
   svn_fs_fs__set_contents,
   svn_fs_fs__create_successor,
   svn_fs_fs__set_proplist,
   svn_fs_fs__commit,
   svn_fs_fs__list_transactions,
   svn_fs_fs__open_txn,
   svn_fs_fs__txn_proplist,
   svn_fs_fs__delete_node_revision,
   svn_fs_fs__get_txn_ids,
   svn_fs_fs__txn_prop,
   svn_fs_fs__begin_txn): moved API implementation here from fs_fs.c

* subversion/libsvn_fs_fs/fs_fs.h
  (svn_fs_fs__put_node_revision,
   svn_fs_fs__txn_changes_fetch,
   svn_fs_fs__paths_changed,
   svn_fs_fs__create_txn,
   svn_fs_fs__change_txn_prop,
   svn_fs_fs__change_txn_props,
   svn_fs_fs__get_txn,
   svn_fs_fs__reserve_copy_id,
   svn_fs_fs__create_node,
   svn_fs_fs__purge_txn,
   svn_fs_fs__abort_txn,
   svn_fs_fs__set_entry,
   svn_fs_fs__add_change,
   svn_fs_fs__set_contents,
   svn_fs_fs__create_successor,
   svn_fs_fs__set_proplist,
   svn_fs_fs__commit,
   svn_fs_fs__list_transactions,
   svn_fs_fs__open_txn,
   svn_fs_fs__txn_proplist,
   svn_fs_fs__delete_node_revision,
   svn_fs_fs__get_txn_ids,
   svn_fs_fs__txn_prop,
   svn_fs_fs__begin_txn): moved to transaction.h

* subversion/libsvn_fs_fs/fs_fs.c
  (): #include the new header
  (txn_vtable,
   unlock_proto_rev_baton,
   get_writable_proto_rev_baton,
   get_and_increment_txn_key_baton,
   rep_write_baton,
   write_hash_baton,
   commit_baton,
   path_txn_sha1,
   path_txn_changes,
   path_txn_props,
   path_txn_proto_rev_lock,
   path_txn_next_ids,
   path_and_offset_of,
   get_shared_txn,
   free_shared_txn,
   with_txnlist_lock,
   unlock_proto_rev_body,
   unlock_proto_rev,
   unlock_proto_rev_list_locked,
   get_writable_proto_rev_body,
   get_writable_proto_rev,
   purge_shared_txn_body,
   purge_shared_txn,
   store_sha1_rep_mapping,
   unparse_dir_entry,
   unparse_dir_entries,
   fold_change,
   process_changes,
   create_new_txn_noderev_from_rev,
   get_and_increment_txn_key_body,
   create_txn_dir,
   create_txn_dir_pre_1_5,
   get_txn_proplist,
   write_next_ids,
   read_next_ids,
   get_new_txn_node_id,
   rep_write_contents,
   choose_delta_base,
   rep_write_cleanup,
   rep_write_get_baton,
   get_shared_rep,
   rep_write_contents_close,
   set_representation,
   get_next_revision_ids,
   write_hash_handler,
   write_hash_rep,
   write_hash_delta_rep,
   validate_root_noderev,
   write_final_rev,
   write_final_changed_path_info,
   verify_as_revision_before_current_plus_plus,
   write_final_current,
   verify_locks,
   commit_body,
   write_reps_to_cache,
   svn_fs_fs__put_node_revision,
   svn_fs_fs__txn_changes_fetch,
   svn_fs_fs__paths_changed,
   svn_fs_fs__create_txn,
   svn_fs_fs__change_txn_prop,
   svn_fs_fs__change_txn_props,
   svn_fs_fs__get_txn,
   svn_fs_fs__reserve_copy_id,
   svn_fs_fs__create_node,
   svn_fs_fs__purge_txn,
   svn_fs_fs__abort_txn,
   svn_fs_fs__set_entry,
   svn_fs_fs__add_change,
   svn_fs_fs__set_contents,
   svn_fs_fs__create_successor,
   svn_fs_fs__set_proplist,
   svn_fs_fs__commit,
   svn_fs_fs__list_transactions,
   svn_fs_fs__open_txn,
   svn_fs_fs__txn_proplist,
   svn_fs_fs__delete_node_revision,
   svn_fs_fs__get_txn_ids,
   svn_fs_fs__txn_prop,
   svn_fs_fs__begin_txn): moved to transaction.c

* subversion/libsvn_fs_fs/dag.c
  (): #include the new header

* subversion/libsvn_fs_fs/fs.c
  (): #include the new header

* subversion/libsvn_fs_fs/pack.c
  (): #include the new header

* subversion/libsvn_fs_fs/tree.c
  (): #include the new header


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-improvements@1504100 13f79535-47bb-0310-9956-ffa450edef68