FreeBSD/contrib/subversion/subversion/libsvn_fs_x/tree.c
/* Return NODE for PATH from ROOT's node cache, or NULL if the node
   isn't cached; read it from the FS. *NODE remains valid until either
   POOL or the FS gets cleared or destroyed (whichever comes first).
 */
Return NODE for PATH from ROOT's node cache, or NULL if the node
isn't cached; read it from the FS. *NODE remains valid until either
POOL or the FS gets cleared or destroyed (whichever comes first).
Return NODE for PATH from ROOT ' s node cache or NULL if the node isn ' t cached ; read it from the FS . * NODE remains valid until either POOL or the FS gets cleared or destroyed ( whichever comes first ) .
static svn_error_t *
dag_node_cache_get(dag_node_t **node_p,
                   svn_fs_root_t *root,
                   const char *path,
                   apr_pool_t *pool)
{
  svn_boolean_t found;
  dag_node_t *node = NULL;
  svn_cache__t *cache;
  const char *key;
  SVN_ERR_ASSERT(*path == '/');
  if (!root->is_txn_root)
    {
      svn_fs_x__data_t *ffd = root->fs->fsap_data;
      cache_entry_t *bucket;
      auto_clear_dag_cache(ffd->dag_node_cache);
      bucket = cache_lookup(ffd->dag_node_cache, root->rev, path);
      if (bucket->node == NULL)
        {
          locate_cache(&cache, &key, root, path, pool);
          SVN_ERR(svn_cache__get((void **)&node, &found, cache, key,
                                 ffd->dag_node_cache->pool));
          if (found && node)
            {
              svn_fs_x__dag_set_fs(node, root->fs);
              bucket->node = node;
            }
        }
      else
        {
          node = bucket->node;
        }
    }
  else
    {
      locate_cache(&cache, &key, root, path, pool);
      SVN_ERR(svn_cache__get((void **) &node, &found, cache, key, pool));
      if (found && node)
        {
          svn_fs_x__dag_set_fs(node, root->fs);
        }
    }
  *node_p = node;
  return SVN_NO_ERROR;
}
static svn_error_t * dag_node_cache_get ( dag_node_t * * node_p , svn_fs_root_t * root , const char * path , apr_pool_t * pool ) { svn_boolean_t found ; dag_node_t * node = NULL ; svn_cache__t * cache ; const char * key ; SVN_ERR_ASSERT ( * path == ' ' ) ; if ( ! root -> is_txn_root ) { svn_fs_x__data_t * ffd = root -> fs -> fsap_data ; cache_entry_t * bucket ; auto_clear_dag_cache ( ffd -> dag_node_cache ) ; bucket = cache_lookup ( ffd -> dag_node_cache , root -> rev , path ) ; if ( bucket -> node == NULL ) { locate_cache ( & cache , & key , root , path , pool ) ; SVN_ERR ( svn_cache__get ( ( void * * ) & node , & found , cache , key , ffd -> dag_node_cache -> pool ) ) ; if ( found && node ) { svn_fs_x__dag_set_fs ( node , root -> fs ) ; bucket -> node = node ; } } else { node = bucket -> node ; } } else { locate_cache ( & cache , & key , root , path , pool ) ; SVN_ERR ( svn_cache__get ( ( void * * ) & node , & found , cache , key , pool ) ) ; if ( found && node ) { svn_fs_x__dag_set_fs ( node , root -> fs ) ; } } * node_p = node ; return SVN_NO_ERROR ; }
Return NODE for PATH from ROOT's node cache, or NULL if the node
isn't cached; read it from the FS.
Return NODE for PATH from ROOT ' s node cache or NULL if the node isn ' t cached ; read it from the FS .
/* immutable DAG node. use the global caches for it */ /* Patch up the FS, since this might have come from an old FS
              * object. */ /* DAG is mutable / may become invalid. Use the TXN-local cache */ /* Patch up the FS, since this might have come from an old FS
          * object. */