FreeBSD/contrib/subversion/subversion/libsvn_fs_x/lock.c
/* A function that calls WALK_DIGESTS_FUNC/WALK_DIGESTS_BATON for
   all lock digest files in and under PATH in FS.
   HAVE_WRITE_LOCK should be true if the caller (directly or indirectly)
   has the FS write lock. */
A function that calls WALK_DIGESTS_FUNC/WALK_DIGESTS_BATON for
all lock digest files in and under PATH in FS.
HAVE_WRITE_LOCK should be true if the caller (directly or indirectly)
has the FS write lock.
A function that calls WALK_DIGESTS_FUNC / WALK_DIGESTS_BATON for all lock digest files in and under PATH in FS . HAVE_WRITE_LOCK should be true if the caller ( directly or indirectly ) has the FS write lock .
static svn_error_t *
walk_digest_files(const char *fs_path,
                  const char *digest_path,
                  walk_digests_callback_t walk_digests_func,
                  void *walk_digests_baton,
                  svn_boolean_t have_write_lock,
                  apr_pool_t *pool)
{
  apr_hash_index_t *hi;
  apr_hash_t *children;
  apr_pool_t *subpool;
  svn_lock_t *lock;
  SVN_ERR(read_digest_file(&children, &lock, fs_path, digest_path, pool));
  SVN_ERR(walk_digests_func(walk_digests_baton, fs_path, digest_path, lock,
                            have_write_lock, pool));
  if (! apr_hash_count(children))
    return SVN_NO_ERROR;
  subpool = svn_pool_create(pool);
  for (hi = apr_hash_first(pool, children); hi; hi = apr_hash_next(hi))
    {
      const char *digest = apr_hash_this_key(hi);
      svn_pool_clear(subpool);
      SVN_ERR(read_digest_file
              (NULL, &lock, fs_path,
               digest_path_from_digest(fs_path, digest, subpool), subpool));
      SVN_ERR(walk_digests_func(walk_digests_baton, fs_path, digest_path, lock,
                                have_write_lock, subpool));
    }
  svn_pool_destroy(subpool);
  return SVN_NO_ERROR;
}
static svn_error_t * walk_digest_files ( const char * fs_path , const char * digest_path , walk_digests_callback_t walk_digests_func , void * walk_digests_baton , svn_boolean_t have_write_lock , apr_pool_t * pool ) { apr_hash_index_t * hi ; apr_hash_t * children ; apr_pool_t * subpool ; svn_lock_t * lock ; SVN_ERR ( read_digest_file ( & children , & lock , fs_path , digest_path , pool ) ) ; SVN_ERR ( walk_digests_func ( walk_digests_baton , fs_path , digest_path , lock , have_write_lock , pool ) ) ; if ( ! apr_hash_count ( children ) ) return SVN_NO_ERROR ; subpool = svn_pool_create ( pool ) ; for ( hi = apr_hash_first ( pool , children ) ; hi ; hi = apr_hash_next ( hi ) ) { const char * digest = apr_hash_this_key ( hi ) ; svn_pool_clear ( subpool ) ; SVN_ERR ( read_digest_file ( NULL , & lock , fs_path , digest_path_from_digest ( fs_path , digest , subpool ) , subpool ) ) ; SVN_ERR ( walk_digests_func ( walk_digests_baton , fs_path , digest_path , lock , have_write_lock , subpool ) ) ; } svn_pool_destroy ( subpool ) ; return SVN_NO_ERROR ; }
A function that calls WALK_DIGESTS_FUNC/WALK_DIGESTS_BATON for
all lock digest files in and under PATH in FS.
A function that calls WALK_DIGESTS_FUNC / WALK_DIGESTS_BATON for all lock digest files in and under PATH in FS .
/* First, send up any locks in the current digest file. */ /* Now, report all the child entries (if any; bail otherwise). */