FreeBSD/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c
/* Return the cache object in FS responsible to storing the directory the
 * NODEREV plus the corresponding *KEY.  If no cache exists, return NULL.
 * PAIR_KEY must point to some key struct, which does not need to be
 * initialized.  We use it to avoid dynamic allocation.
 */
Return the cache object in FS responsible to storing the directory the
NODEREV plus the corresponding *KEY.  If no cache exists, return NULL.
PAIR_KEY must point to some key struct, which does not need to be
initialized.  We use it to avoid dynamic allocation.
Return the cache object in FS responsible to storing the directory the NODEREV plus the corresponding * KEY . If no cache exists return NULL . PAIR_KEY must point to some key struct which does not need to be initialized . We use it to avoid dynamic allocation .
static svn_cache__t *
locate_dir_cache(svn_fs_t *fs,
                 const void **key,
                 pair_cache_key_t *pair_key,
                 node_revision_t *noderev,
                 apr_pool_t *pool)
{
  fs_fs_data_t *ffd = fs->fsap_data;
  if (svn_fs_fs__id_is_txn(noderev->id))
    {
      *key = svn_fs_fs__id_unparse(noderev->id, pool)->data;
      return ffd->txn_dir_cache;
    }
  else
    {
      if (noderev->data_rep)
        {
          pair_key->revision = noderev->data_rep->revision;
          pair_key->second = noderev->data_rep->item_index;
          *key = pair_key;
        }
      else
        {
          *key = NULL;
        }
      return ffd->dir_cache;
    }
}
static svn_cache__t * locate_dir_cache ( svn_fs_t * fs , const void * * key , pair_cache_key_t * pair_key , node_revision_t * noderev , apr_pool_t * pool ) { fs_fs_data_t * ffd = fs -> fsap_data ; if ( svn_fs_fs__id_is_txn ( noderev -> id ) ) { * key = svn_fs_fs__id_unparse ( noderev -> id , pool ) -> data ; return ffd -> txn_dir_cache ; } else { if ( noderev -> data_rep ) { pair_key -> revision = noderev -> data_rep -> revision ; pair_key -> second = noderev -> data_rep -> item_index ; * key = pair_key ; } else { * key = NULL ; } return ffd -> dir_cache ; } }
Return the cache object in FS responsible to storing the directory the
 NODEREV plus the corresponding *KEY.
Return the cache object in FS responsible to storing the directory the NODEREV plus the corresponding * KEY .
/* data in txns requires the expensive fs_id-based addressing mode */ /* committed data can use simple rev,item pairs */ /* no data rep -> empty directory.
             A NULL key causes a cache miss. */