On the log-addressing branch:

Implement the log-to-phys index API including caching facilities.
The code will be used by the next commit when we actual enable
logical addresssing.  At that point we also introduce the index
lookup API function (sub-function code already part of this commit).

* subversion/libsvn_fs_fs/index.h
  (): new file
  (SVN_FS_FS__ITEM_INDEX_*): hard-coded item_index values
  (SVN_FS_FS__ITEM_TYPE_*): available item types
  (svn_fs_fs__l2p_proto_index_open,
   svn_fs_fs__l2p_proto_index_add_revision,
   svn_fs_fs__l2p_proto_index_add_entry,
   svn_fs_fs__l2p_index_create): declare l2p index creation API
  (svn_fs_fs__page_cache_key_t,
   svn_fs_fs__serialize_l2p_header,
   svn_fs_fs__deserialize_l2p_header,
   svn_fs_fs__serialize_l2p_page,
   svn_fs_fs__deserialize_l2p_page): cache serialization interface
                                     exposed to be accessible in caching.c

* subversion/libsvn_fs_fs/index.c
  (l2p_page_table_entry_t,
   l2p_header_t,
   l2p_page_t,
   l2p_proto_entry_t): declare index and proto-index data types

  (base_revision): rev / pack file mapping utility
  (write_entry_to_proto_index,
   encode_l2p_page): index creation utilities
  (svn_fs_fs__l2p_proto_index_open,
   svn_fs_fs__l2p_proto_index_add_revision,
   svn_fs_fs__l2p_proto_index_add_entry,
   svn_fs_fs__l2p_index_create): implement index creation API

  (auto_open_l2p_index): new utility function
  (get_l2p_header_body): read the header incl. page table from file
  (l2p_page_info_baton_t,
   l2p_page_info_copy,
   l2p_page_info_access_func,
   get_l2p_page_info): get a page info from header cache, populate
                       the cache upon miss

  (l2p_page_table_baton_t,
   l2p_page_table_access_func,
   get_l2p_page_table): get the list of pages for a revision from
                        the header cache

  (get_l2p_page,
   prefetch_l2p_pages): read an index page from file and cache them

  (l2p_entry_baton_t,
   l2p_page_get_entry,
   l2p_entry_access_func): extract a single entry from a index page /
                           cached index page

  (l2p_index_lookup,
   l2p_proto_index_lookup): top-level index lookup functions

  (svn_fs_fs__serialize_l2p_header,
   svn_fs_fs__deserialize_l2p_header,
   svn_fs_fs__serialize_l2p_page,
   svn_fs_fs__deserialize_l2p_page): implement cache (de-)serialization

* subversion/libsvn_fs_fs/fs.h
  (PATH_EXT_L2P_INDEX,
   PATH_INDEX): define l2p related file name parts
  (CONFIG_OPTION_L2P_PAGE_SIZE): new config option
  (fs_fs_data_t): add l2p page size setting;
                  add l2p header and page caches

* subversion/libsvn_fs_fs/caching.c
  (svn_fs_fs__initialize_caches): initialize the new caches

* subversion/libsvn_fs_fs/fs_fs.c
  (read_config): parse new config option
  (write_config): extend config file template

* subversion/libsvn_fs_fs/util.h
  (svn_fs_fs__path_l2p_index,
   svn_fs_fs__path_l2p_proto_index): new path getters for the l2p index

* subversion/libsvn_fs_fs/util.c
  (svn_fs_fs__path_l2p_index,
   svn_fs_fs__path_l2p_proto_index): implement


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/log-addressing@1511735 13f79535-47bb-0310-9956-ffa450edef68