FreeBSD/contrib/subversion/subversion/libsvn_fs_x/cached_data.c
/* Fetch the representation data (header, txdelta / plain windows)
 * addressed by ENTRY->ITEM in FS and cache it if caches are enabled.
 * Read the data from the already open FILE and the wrapping
 * STREAM object.  If MAX_OFFSET is not -1, don't read windows that start
 * at or beyond that offset.  Use SCRATCH_POOL for temporary allocations.
 */
Fetch the representation data (header, txdelta / plain windows)
addressed by ENTRY->ITEM in FS and cache it if caches are enabled.
Read the data from the already open FILE and the wrapping
STREAM object.  If MAX_OFFSET is not -1, don't read windows that start
at or beyond that offset.  Use SCRATCH_POOL for temporary allocations.
Fetch the representation data ( header txdelta / plain windows ) addressed by ENTRY - > ITEM in FS and cache it if caches are enabled . Read the data from the already open FILE and the wrapping STREAM object . If MAX_OFFSET is not - 1 don ' t read windows that start at or beyond that offset . Use SCRATCH_POOL for temporary allocations .
static svn_error_t *
block_read_contents(svn_fs_t *fs,
                    svn_fs_x__revision_file_t *rev_file,
                    svn_fs_x__p2l_entry_t* entry,
                    svn_fs_x__pair_cache_key_t *key,
                    apr_off_t max_offset,
                    apr_pool_t *scratch_pool)
{
  svn_fs_x__data_t *ffd = fs->fsap_data;
  svn_fs_x__representation_cache_key_t header_key = { 0 };
  rep_state_t rs = { 0 };
  svn_filesize_t fulltext_len;
  svn_fs_x__rep_header_t *rep_header;
  if (!ffd->txdelta_window_cache || !ffd->combined_window_cache)
    return SVN_NO_ERROR;
  header_key.revision = (apr_int32_t)key->revision;
  header_key.is_packed = svn_fs_x__is_packed_rev(fs, header_key.revision);
  header_key.item_index = key->second;
  SVN_ERR(read_rep_header(&rep_header, fs, rev_file->stream, &header_key,
                          scratch_pool));
  SVN_ERR(init_rep_state(&rs, rep_header, fs, rev_file, entry, scratch_pool));
  SVN_ERR(cache_windows(&fulltext_len, fs, &rs, max_offset, scratch_pool));
  return SVN_NO_ERROR;
}
static svn_error_t * block_read_contents ( svn_fs_t * fs , svn_fs_x__revision_file_t * rev_file , svn_fs_x__p2l_entry_t * entry , svn_fs_x__pair_cache_key_t * key , apr_off_t max_offset , apr_pool_t * scratch_pool ) { svn_fs_x__data_t * ffd = fs -> fsap_data ; svn_fs_x__representation_cache_key_t header_key = { 0 } ; rep_state_t rs = { 0 } ; svn_filesize_t fulltext_len ; svn_fs_x__rep_header_t * rep_header ; if ( ! ffd -> txdelta_window_cache || ! ffd -> combined_window_cache ) return SVN_NO_ERROR ; header_key . revision = ( apr_int32_t ) key -> revision ; header_key . is_packed = svn_fs_x__is_packed_rev ( fs , header_key . revision ) ; header_key . item_index = key -> second ; SVN_ERR ( read_rep_header ( & rep_header , fs , rev_file -> stream , & header_key , scratch_pool ) ) ; SVN_ERR ( init_rep_state ( & rs , rep_header , fs , rev_file , entry , scratch_pool ) ) ; SVN_ERR ( cache_windows ( & fulltext_len , fs , & rs , max_offset , scratch_pool ) ) ; return SVN_NO_ERROR ; }
Fetch the representation data (header, txdelta / plain windows)
 addressed by ENTRY->ITEM in FS and cache it if caches are enabled.
Fetch the representation data ( header txdelta / plain windows ) addressed by ENTRY - > ITEM in FS and cache it if caches are enabled .