FreeBSD/contrib/subversion/subversion/libsvn_fs_x/cached_data.c
/* Try to get the representation header identified by KEY from FS's cache.
 * If it has not been cached, read it from the current position in STREAM
 * and put it into the cache (if caching has been enabled for rep headers).
 * Return the result in *REP_HEADER.  Use POOL for allocations.
 */
Try to get the representation header identified by KEY from FS's cache.
If it has not been cached, read it from the current position in STREAM
and put it into the cache (if caching has been enabled for rep headers).
Return the result in *REP_HEADER.  Use POOL for allocations.
Try to get the representation header identified by KEY from FS ' s cache . If it has not been cached read it from the current position in STREAM and put it into the cache ( if caching has been enabled for rep headers ) . Return the result in * REP_HEADER . Use POOL for allocations .
static svn_error_t *
read_rep_header(svn_fs_x__rep_header_t **rep_header,
                svn_fs_t *fs,
                svn_stream_t *stream,
                svn_fs_x__representation_cache_key_t *key,
                apr_pool_t *pool)
{
  svn_fs_x__data_t *ffd = fs->fsap_data;
  svn_boolean_t is_cached = FALSE;
  if (ffd->rep_header_cache)
    {
      SVN_ERR(svn_cache__get((void**)rep_header, &is_cached,
                             ffd->rep_header_cache, key, pool));
      if (is_cached)
        return SVN_NO_ERROR;
    }
  SVN_ERR(svn_fs_x__read_rep_header(rep_header, stream, pool, pool));
  if (ffd->rep_header_cache)
    SVN_ERR(svn_cache__set(ffd->rep_header_cache, key, *rep_header, pool));
  return SVN_NO_ERROR;
}
static svn_error_t * read_rep_header ( svn_fs_x__rep_header_t * * rep_header , svn_fs_t * fs , svn_stream_t * stream , svn_fs_x__representation_cache_key_t * key , apr_pool_t * pool ) { svn_fs_x__data_t * ffd = fs -> fsap_data ; svn_boolean_t is_cached = FALSE ; if ( ffd -> rep_header_cache ) { SVN_ERR ( svn_cache__get ( ( void * * ) rep_header , & is_cached , ffd -> rep_header_cache , key , pool ) ) ; if ( is_cached ) return SVN_NO_ERROR ; } SVN_ERR ( svn_fs_x__read_rep_header ( rep_header , stream , pool , pool ) ) ; if ( ffd -> rep_header_cache ) SVN_ERR ( svn_cache__set ( ffd -> rep_header_cache , key , * rep_header , pool ) ) ; return SVN_NO_ERROR ; }
Try to get the representation header identified by KEY from FS's cache.
Try to get the representation header identified by KEY from FS ' s cache .