FreeBSD/contrib/subversion/subversion/libsvn_fs_x/revprops.c
/* If the revprop generation has an odd value, it means the original writer
   of the revprop got killed. We don't know whether that process as able
   to change the revprop data but we assume that it was. Therefore, we
   increase the generation in that case to basically invalidate everyone's
   cache content.
   Execute this only while holding the write lock to the repo in baton->FFD.
 */
If the revprop generation has an odd value, it means the original writer
of the revprop got killed. We don't know whether that process as able
to change the revprop data but we assume that it was. Therefore, we
increase the generation in that case to basically invalidate everyone's
cache content.
Execute this only while holding the write lock to the repo in baton->FFD.
If the revprop generation has an odd value it means the original writer of the revprop got killed . We don ' t know whether that process as able to change the revprop data but we assume that it was . Therefore we increase the generation in that case to basically invalidate everyone ' s cache content . Execute this only while holding the write lock to the repo in baton - > FFD .
static svn_error_t *
revprop_generation_fixup(void *void_baton,
                         apr_pool_t *scratch_pool)
{
  revprop_generation_upgrade_t *baton = void_baton;
  svn_fs_x__data_t *ffd = baton->fs->fsap_data;
  assert(ffd->has_write_lock);
  SVN_ERR(close_revprop_generation_file(baton->fs, scratch_pool));
  SVN_ERR(read_revprop_generation_file(baton->generation, baton->fs,
                                       scratch_pool));
  if (*baton->generation % 2)
    {
      ++*baton->generation;
      SVN_ERR(write_revprop_generation_file(baton->fs,
                                            *baton->generation,
                                            scratch_pool));
    }
  return SVN_NO_ERROR;
}
static svn_error_t * revprop_generation_fixup ( void * void_baton , apr_pool_t * scratch_pool ) { revprop_generation_upgrade_t * baton = void_baton ; svn_fs_x__data_t * ffd = baton -> fs -> fsap_data ; assert ( ffd -> has_write_lock ) ; SVN_ERR ( close_revprop_generation_file ( baton -> fs , scratch_pool ) ) ; SVN_ERR ( read_revprop_generation_file ( baton -> generation , baton -> fs , scratch_pool ) ) ; if ( * baton -> generation % 2 ) { ++ * baton -> generation ; SVN_ERR ( write_revprop_generation_file ( baton -> fs , * baton -> generation , scratch_pool ) ) ; } return SVN_NO_ERROR ; }
If the revprop generation has an odd value, it means the original writer
of the revprop got killed.
If the revprop generation has an odd value it means the original writer of the revprop got killed .
/* Make sure we don't operate on stale OS buffers. */ /* Maybe, either the original revprop writer or some other reader has
     already corrected / bumped the revprop generation.  Thus, we need
     to read it again.  However, we will now be the only ones changing
     the file contents due to us holding the write lock. */ /* Cause everyone to re-read revprops upon their next access, if the
     last revprop write did not complete properly. */