FreeBSD/contrib/subversion/subversion/libsvn_fs_fs/transaction.c
/* Write the changed path info CHANGED_PATHS from transaction TXN_ID to the
   permanent rev-file FILE in filesystem FS.  *OFFSET_P is set the to offset
   in the file of the beginning of this information.  Perform temporary
   allocations in POOL. */
Write the changed path info CHANGED_PATHS from transaction TXN_ID to the
permanent rev-file FILE in filesystem FS.  *OFFSET_P is set the to offset
in the file of the beginning of this information.  Perform temporary
allocations in POOL.
Write the changed path info CHANGED_PATHS from transaction TXN_ID to the permanent rev - file FILE in filesystem FS . * OFFSET_P is set the to offset in the file of the beginning of this information . Perform temporary allocations in POOL .
static svn_error_t *
write_final_changed_path_info(apr_off_t *offset_p,
                              apr_file_t *file,
                              svn_fs_t *fs,
                              const svn_fs_fs__id_part_t *txn_id,
                              apr_hash_t *changed_paths,
                              apr_pool_t *pool)
{
  apr_off_t offset;
  svn_stream_t *stream;
  svn_checksum_ctx_t *fnv1a_checksum_ctx;
  SVN_ERR(svn_fs_fs__get_file_offset(&offset, file, pool));
  stream = fnv1a_wrap_stream(&fnv1a_checksum_ctx,
                             svn_stream_from_aprfile2(file, TRUE, pool),
                             pool);
  SVN_ERR(svn_fs_fs__write_changes(stream, fs, changed_paths, TRUE, pool));
  *offset_p = offset;
  if (svn_fs_fs__use_log_addressing(fs))
    {
      svn_fs_fs__p2l_entry_t entry;
      entry.offset = offset;
      SVN_ERR(svn_fs_fs__get_file_offset(&offset, file, pool));
      entry.size = offset - entry.offset;
      entry.type = SVN_FS_FS__ITEM_TYPE_CHANGES;
      entry.item.revision = SVN_INVALID_REVNUM;
      entry.item.number = SVN_FS_FS__ITEM_INDEX_CHANGES;
      SVN_ERR(fnv1a_checksum_finalize(&entry.fnv1_checksum,
                                      fnv1a_checksum_ctx,
                                      pool));
      SVN_ERR(store_p2l_index_entry(fs, txn_id, &entry, pool));
      SVN_ERR(store_l2p_index_entry(fs, txn_id, entry.offset,
                                    SVN_FS_FS__ITEM_INDEX_CHANGES, pool));
    }
  return SVN_NO_ERROR;
}
static svn_error_t * write_final_changed_path_info ( apr_off_t * offset_p , apr_file_t * file , svn_fs_t * fs , const svn_fs_fs__id_part_t * txn_id , apr_hash_t * changed_paths , apr_pool_t * pool ) { apr_off_t offset ; svn_stream_t * stream ; svn_checksum_ctx_t * fnv1a_checksum_ctx ; SVN_ERR ( svn_fs_fs__get_file_offset ( & offset , file , pool ) ) ; stream = fnv1a_wrap_stream ( & fnv1a_checksum_ctx , svn_stream_from_aprfile2 ( file , TRUE , pool ) , pool ) ; SVN_ERR ( svn_fs_fs__write_changes ( stream , fs , changed_paths , TRUE , pool ) ) ; * offset_p = offset ; if ( svn_fs_fs__use_log_addressing ( fs ) ) { svn_fs_fs__p2l_entry_t entry ; entry . offset = offset ; SVN_ERR ( svn_fs_fs__get_file_offset ( & offset , file , pool ) ) ; entry . size = offset - entry . offset ; entry . type = SVN_FS_FS__ITEM_TYPE_CHANGES ; entry . item . revision = SVN_INVALID_REVNUM ; entry . item . number = SVN_FS_FS__ITEM_INDEX_CHANGES ; SVN_ERR ( fnv1a_checksum_finalize ( & entry . fnv1_checksum , fnv1a_checksum_ctx , pool ) ) ; SVN_ERR ( store_p2l_index_entry ( fs , txn_id , & entry , pool ) ) ; SVN_ERR ( store_l2p_index_entry ( fs , txn_id , entry . offset , SVN_FS_FS__ITEM_INDEX_CHANGES , pool ) ) ; } return SVN_NO_ERROR ; }
Write the changed path info CHANGED_PATHS from transaction TXN_ID to the
permanent rev-file FILE in filesystem FS.
Write the changed path info CHANGED_PATHS from transaction TXN_ID to the permanent rev - file FILE in filesystem FS .
/* write to target file & calculate checksum */ /* reference changes from the indexes */