FreeBSD/contrib/subversion/subversion/libsvn_fs_x/cached_data.c
/* Read the whole representation RS and return it in *NWIN. */
Read the whole representation RS and return it in *NWIN.
Read the whole representation RS and return it in * NWIN .
static svn_error_t *
read_container_window(svn_stringbuf_t **nwin,
                      rep_state_t *rs,
                      apr_size_t size,
                      apr_pool_t *result_pool,
                      apr_pool_t *scratch_pool)
{
  svn_fs_x__rep_extractor_t *extractor = NULL;
  svn_fs_t *fs = rs->sfile->fs;
  svn_fs_x__data_t *ffd = fs->fsap_data;
  svn_fs_x__pair_cache_key_t key;
  svn_revnum_t revision = svn_fs_x__get_revnum(rs->rep_id.change_set);
  SVN_ERR(auto_set_start_offset(rs, scratch_pool));
  key.revision = svn_fs_x__packed_base_rev(fs, revision);
  key.second = rs->start;
  if (ffd->reps_container_cache)
    {
      svn_boolean_t is_cached = FALSE;
      svn_fs_x__reps_baton_t baton;
      baton.fs = fs;
      baton.idx = rs->sub_item;
      SVN_ERR(svn_cache__get_partial((void**)&extractor, &is_cached,
                                     ffd->reps_container_cache, &key,
                                     svn_fs_x__reps_get_func, &baton,
                                     result_pool));
    }
  if (extractor == NULL)
    {
      SVN_ERR(auto_open_shared_file(rs->sfile));
      SVN_ERR(block_read((void **)&extractor, fs, &rs->rep_id,
                         rs->sfile->rfile, result_pool, scratch_pool));
    }
  SVN_ERR(svn_fs_x__extractor_drive(nwin, extractor, rs->current, size,
                                    result_pool, scratch_pool));
  rs->current += (apr_off_t)size;
  return SVN_NO_ERROR;
}
static svn_error_t * read_container_window ( svn_stringbuf_t * * nwin , rep_state_t * rs , apr_size_t size , apr_pool_t * result_pool , apr_pool_t * scratch_pool ) { svn_fs_x__rep_extractor_t * extractor = NULL ; svn_fs_t * fs = rs -> sfile -> fs ; svn_fs_x__data_t * ffd = fs -> fsap_data ; svn_fs_x__pair_cache_key_t key ; svn_revnum_t revision = svn_fs_x__get_revnum ( rs -> rep_id . change_set ) ; SVN_ERR ( auto_set_start_offset ( rs , scratch_pool ) ) ; key . revision = svn_fs_x__packed_base_rev ( fs , revision ) ; key . second = rs -> start ; if ( ffd -> reps_container_cache ) { svn_boolean_t is_cached = FALSE ; svn_fs_x__reps_baton_t baton ; baton . fs = fs ; baton . idx = rs -> sub_item ; SVN_ERR ( svn_cache__get_partial ( ( void * * ) & extractor , & is_cached , ffd -> reps_container_cache , & key , svn_fs_x__reps_get_func , & baton , result_pool ) ) ; } if ( extractor == NULL ) { SVN_ERR ( auto_open_shared_file ( rs -> sfile ) ) ; SVN_ERR ( block_read ( ( void * * ) & extractor , fs , & rs -> rep_id , rs -> sfile -> rfile , result_pool , scratch_pool ) ) ; } SVN_ERR ( svn_fs_x__extractor_drive ( nwin , extractor , rs -> current , size , result_pool , scratch_pool ) ) ; rs -> current += ( apr_off_t ) size ; return SVN_NO_ERROR ; }
Read the whole representation RS and return it in *NWIN.
Read the whole representation RS and return it in * NWIN .
/* already in cache? */ /* read from disk, if necessary */ /* Update RS. */