FreeBSD/contrib/subversion/subversion/libsvn_fs_x/cached_data.c
/* Read the rep args for REP in filesystem FS and create a rep_state
   for reading the representation.  Return the rep_state in *REP_STATE
   and the rep args in *REP_ARGS, both allocated in POOL.

   When reading multiple reps, i.e. a skip delta chain, you may provide
   non-NULL SHARED_FILE.  (If SHARED_FILE is not NULL, in the first
   call it should be a pointer to NULL.)  The function will use this
   variable to store the previous call results and tries to re-use it.
   This may result in significant savings in I/O for packed files and
   number of open file handles.
 */
Read the rep args for REP in filesystem FS and create a rep_state
for reading the representation.  Return the rep_state in *REP_STATE
and the rep args in *REP_ARGS, both allocated in POOL.

When reading multiple reps, i.e. a skip delta chain, you may provide
non-NULL SHARED_FILE.  (If SHARED_FILE is not NULL, in the first
call it should be a pointer to NULL.)  The function will use this
variable to store the previous call results and tries to re-use it.
This may result in significant savings in I/O for packed files and
number of open file handles.
Read the rep args for REP in filesystem FS and create a rep_state for reading the representation . Return the rep_state in * REP_STATE and the rep args in * REP_ARGS both allocated in POOL . When reading multiple reps i . e . a skip delta chain you may provide non - NULL SHARED_FILE . ( If SHARED_FILE is not NULL in the first call it should be a pointer to NULL . ) The function will use this variable to store the previous call results and tries to re - use it . This may result in significant savings in I / O for packed files and number of open file handles .
static svn_error_t *
create_rep_state(rep_state_t **rep_state,
                 svn_fs_x__rep_header_t **rep_header,
                 shared_file_t **shared_file,
                 svn_fs_x__representation_t *rep,
                 svn_fs_t *fs,
                 apr_pool_t *result_pool,
                 apr_pool_t *scratch_pool)
{
  svn_error_t *err = create_rep_state_body(rep_state, rep_header,
                                           shared_file, rep, fs,
                                           result_pool, scratch_pool);
  if (err && err->apr_err == SVN_ERR_FS_CORRUPT)
    {
      return svn_error_createf(SVN_ERR_FS_CORRUPT, err,
                               "Corrupt representation '%s'",
                               rep
                               ? svn_fs_x__unparse_representation
                                   (rep, TRUE, scratch_pool,
                                    scratch_pool)->data
                               : "(null)");
    }
  return svn_error_trace(err);
}
static svn_error_t * create_rep_state ( rep_state_t * * rep_state , svn_fs_x__rep_header_t * * rep_header , shared_file_t * * shared_file , svn_fs_x__representation_t * rep , svn_fs_t * fs , apr_pool_t * result_pool , apr_pool_t * scratch_pool ) { svn_error_t * err = create_rep_state_body ( rep_state , rep_header , shared_file , rep , fs , result_pool , scratch_pool ) ; if ( err && err -> apr_err == SVN_ERR_FS_CORRUPT ) { return svn_error_createf ( SVN_ERR_FS_CORRUPT , err , " " , rep ? svn_fs_x__unparse_representation ( rep , TRUE , scratch_pool , scratch_pool ) -> data : " " ) ; } return svn_error_trace ( err ) ; }
Read the rep args for REP in filesystem FS and create a rep_state
for reading the representation.
Read the rep args for REP in filesystem FS and create a rep_state for reading the representation .
/* ### This always returns "-1" for transaction reps, because
         ### this particular bit of code doesn't know if the rep is
         ### stored in the protorev or in the mutable area (for props
         ### or dir contents).  It is pretty rare for FSX to *read*
         ### from the protorev file, though, so this is probably OK.
         ### And anyone going to debug corruption errors is probably
         ### going to jump straight to this comment anyway! */ /* ### Call representation_string() ? */