FreeBSD/contrib/subversion/subversion/libsvn_fs_fs/verify.c
/* Verify the MD5 checksums of the index data in the rev / pack file
 * containing revision START in FS.  If given, invoke CANCEL_FUNC with
 * CANCEL_BATON at regular intervals.  Use SCRATCH_POOL for temporary
 * allocations.
 */
Verify the MD5 checksums of the index data in the rev / pack file
containing revision START in FS.  If given, invoke CANCEL_FUNC with
CANCEL_BATON at regular intervals.  Use SCRATCH_POOL for temporary
allocations.
Verify the MD5 checksums of the index data in the rev / pack file containing revision START in FS . If given invoke CANCEL_FUNC with CANCEL_BATON at regular intervals . Use SCRATCH_POOL for temporary allocations .
static svn_error_t *
verify_index_checksums(svn_fs_t *fs,
                       svn_revnum_t start,
                       svn_cancel_func_t cancel_func,
                       void *cancel_baton,
                       apr_pool_t *scratch_pool)
{
  svn_fs_fs__revision_file_t *rev_file;
  SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&rev_file, fs, start,
                                           scratch_pool, scratch_pool));
  SVN_ERR(svn_fs_fs__auto_read_footer(rev_file));
  SVN_ERR(verify_index_checksum(rev_file->file, "L2P index",
                                rev_file->l2p_offset, rev_file->p2l_offset,
                                rev_file->l2p_checksum,
                                cancel_func, cancel_baton, scratch_pool));
  SVN_ERR(verify_index_checksum(rev_file->file, "P2L index",
                                rev_file->p2l_offset, rev_file->footer_offset,
                                rev_file->p2l_checksum,
                                cancel_func, cancel_baton, scratch_pool));
  SVN_ERR(svn_fs_fs__close_revision_file(rev_file));
  return SVN_NO_ERROR;
}
static svn_error_t * verify_index_checksums ( svn_fs_t * fs , svn_revnum_t start , svn_cancel_func_t cancel_func , void * cancel_baton , apr_pool_t * scratch_pool ) { svn_fs_fs__revision_file_t * rev_file ; SVN_ERR ( svn_fs_fs__open_pack_or_rev_file ( & rev_file , fs , start , scratch_pool , scratch_pool ) ) ; SVN_ERR ( svn_fs_fs__auto_read_footer ( rev_file ) ) ; SVN_ERR ( verify_index_checksum ( rev_file -> file , " " , rev_file -> l2p_offset , rev_file -> p2l_offset , rev_file -> l2p_checksum , cancel_func , cancel_baton , scratch_pool ) ) ; SVN_ERR ( verify_index_checksum ( rev_file -> file , " " , rev_file -> p2l_offset , rev_file -> footer_offset , rev_file -> p2l_checksum , cancel_func , cancel_baton , scratch_pool ) ) ; SVN_ERR ( svn_fs_fs__close_revision_file ( rev_file ) ) ; return SVN_NO_ERROR ; }
Verify the MD5 checksums of the index data in the rev / pack file
 containing revision START in FS.
Verify the MD5 checksums of the index data in the rev / pack file containing revision START in FS .
/* Open the rev / pack file and read the footer */ /* Verify the index contents against the checksum from the footer. */ /* Done. */