You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2015/03/29 21:58:53 UTC
svn commit: r1669960 - in
/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x:
cached_data.c tree.c
Author: stefan2
Date: Sun Mar 29 19:58:53 2015
New Revision: 1669960
URL: http://svn.apache.org/r1669960
Log:
On the 1.10-cache-improvements branch:
Remove tests for cache availability in FSX because the interfaces are
always accessible now in the FFD.
* subversion/libsvn_fs_x/cached_data.c
(get_node_revision_body,
create_rep_state_body,
get_cached_window_sizes,
get_cached_window,
set_cached_window,
get_cached_combined_window,
set_cached_combined_window,
read_container_window,
read_rep_header,
svn_fs_x__get_contents,
svn_fs_x__try_process_file_contents,
svn_fs_x__get_file_delta_stream,
svn_fs_x__rep_contents_dir,
svn_fs_x__rep_contents_dir_entry,
svn_fs_x__get_proplist,
svn_fs_x__get_changes,
block_read_contents,
block_read_changes,
block_read_changes_container,
block_read_noderev,
block_read_noderevs_container,
block_read_reps_container,
block_read): The caches may be dummies but are always available.
* subversion/libsvn_fs_x/tree.c
(get_mergeinfo_for_path): Same.
Modified:
subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/cached_data.c
subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/tree.c
Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/cached_data.c?rev=1669960&r1=1669959&r2=1669960&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/cached_data.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/cached_data.c Sun Mar 29 19:58:53 2015
@@ -355,16 +355,13 @@ get_node_revision_body(svn_fs_x__noderev
/* Not found or not applicable. Try a noderev cache lookup.
* If that succeeds, we are done here. */
- if (ffd->node_revision_cache)
- {
- SVN_ERR(svn_cache__get((void **) noderev_p,
- &is_cached,
- ffd->node_revision_cache,
- &key,
- result_pool));
- if (is_cached)
- return SVN_NO_ERROR;
- }
+ SVN_ERR(svn_cache__get((void **) noderev_p,
+ &is_cached,
+ ffd->node_revision_cache,
+ &key,
+ result_pool));
+ if (is_cached)
+ return SVN_NO_ERROR;
/* block-read will parse the whole block and will also return
the one noderev that we need right now. */
@@ -655,7 +652,7 @@ create_rep_state_body(rep_state_t **rep_
: NULL;
/* cache lookup, i.e. skip reading the rep header if possible */
- if (ffd->rep_header_cache && SVN_IS_VALID_REVNUM(revision))
+ if (SVN_IS_VALID_REVNUM(revision))
SVN_ERR(svn_cache__get((void **) &rh, &is_cached,
ffd->rep_header_cache, &key, result_pool));
@@ -743,9 +740,8 @@ create_rep_state_body(rep_state_t **rep_
{
SVN_ERR(block_read(NULL, fs, &rs->rep_id, rs->sfile->rfile,
result_pool, scratch_pool));
- if (ffd->rep_header_cache)
- SVN_ERR(svn_cache__set(ffd->rep_header_cache, &key, rh,
- scratch_pool));
+ SVN_ERR(svn_cache__set(ffd->rep_header_cache, &key, rh,
+ scratch_pool));
}
}
@@ -1075,22 +1071,14 @@ get_cached_window_sizes(window_sizes_t *
svn_boolean_t *is_cached,
apr_pool_t *pool)
{
- if (! rs->window_cache)
- {
- /* txdelta window has not been enabled */
- *is_cached = FALSE;
- }
- else
- {
- svn_fs_x__window_cache_key_t key = { 0 };
- SVN_ERR(svn_cache__get_partial((void **)sizes,
- is_cached,
- rs->window_cache,
- get_window_key(&key, rs),
- get_cached_window_sizes_func,
- NULL,
- pool));
- }
+ svn_fs_x__window_cache_key_t key = { 0 };
+ SVN_ERR(svn_cache__get_partial((void **)sizes,
+ is_cached,
+ rs->window_cache,
+ get_window_key(&key, rs),
+ get_cached_window_sizes_func,
+ NULL,
+ pool));
return SVN_NO_ERROR;
}
@@ -1103,33 +1091,25 @@ get_cached_window(svn_txdelta_window_t *
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
- if (! rs->window_cache)
- {
- /* txdelta window has not been enabled */
- *is_cached = FALSE;
- }
- else
- {
- /* ask the cache for the desired txdelta window */
- svn_fs_x__txdelta_cached_window_t *cached_window;
- svn_fs_x__window_cache_key_t key = { 0 };
- get_window_key(&key, rs);
- key.chunk_index = chunk_index;
- SVN_ERR(svn_cache__get((void **) &cached_window,
- is_cached,
- rs->window_cache,
- &key,
- result_pool));
-
- if (*is_cached)
- {
- /* found it. Pass it back to the caller. */
- *window_p = cached_window->window;
-
- /* manipulate the RS as if we just read the data */
- rs->current = cached_window->end_offset;
- rs->chunk_index = chunk_index;
- }
+ /* ask the cache for the desired txdelta window */
+ svn_fs_x__txdelta_cached_window_t *cached_window;
+ svn_fs_x__window_cache_key_t key = { 0 };
+ get_window_key(&key, rs);
+ key.chunk_index = chunk_index;
+ SVN_ERR(svn_cache__get((void **) &cached_window,
+ is_cached,
+ rs->window_cache,
+ &key,
+ result_pool));
+
+ if (*is_cached)
+ {
+ /* found it. Pass it back to the caller. */
+ *window_p = cached_window->window;
+
+ /* manipulate the RS as if we just read the data */
+ rs->current = cached_window->end_offset;
+ rs->chunk_index = chunk_index;
}
return SVN_NO_ERROR;
@@ -1145,23 +1125,20 @@ set_cached_window(svn_txdelta_window_t *
apr_off_t start_offset,
apr_pool_t *scratch_pool)
{
- if (rs->window_cache)
- {
- /* store the window and the first offset _past_ it */
- svn_fs_x__txdelta_cached_window_t cached_window;
- svn_fs_x__window_cache_key_t key = {0};
-
- cached_window.window = window;
- cached_window.start_offset = start_offset - rs->start;
- cached_window.end_offset = rs->current;
-
- /* but key it with the start offset because that is the known state
- * when we will look it up */
- SVN_ERR(svn_cache__set(rs->window_cache,
- get_window_key(&key, rs),
- &cached_window,
- scratch_pool));
- }
+ /* store the window and the first offset _past_ it */
+ svn_fs_x__txdelta_cached_window_t cached_window;
+ svn_fs_x__window_cache_key_t key = {0};
+
+ cached_window.window = window;
+ cached_window.start_offset = start_offset - rs->start;
+ cached_window.end_offset = rs->current;
+
+ /* but key it with the start offset because that is the known state
+ * when we will look it up */
+ SVN_ERR(svn_cache__set(rs->window_cache,
+ get_window_key(&key, rs),
+ &cached_window,
+ scratch_pool));
return SVN_NO_ERROR;
}
@@ -1178,23 +1155,13 @@ get_cached_combined_window(svn_stringbuf
svn_boolean_t *is_cached,
apr_pool_t *pool)
{
- if (! rs->combined_cache)
- {
- /* txdelta window has not been enabled */
- *is_cached = FALSE;
- }
- else
- {
- /* ask the cache for the desired txdelta window */
- svn_fs_x__window_cache_key_t key = { 0 };
- return svn_cache__get((void **)window_p,
- is_cached,
- rs->combined_cache,
- get_window_key(&key, rs),
- pool);
- }
-
- return SVN_NO_ERROR;
+ /* ask the cache for the desired txdelta window */
+ svn_fs_x__window_cache_key_t key = { 0 };
+ return svn_cache__get((void **)window_p,
+ is_cached,
+ rs->combined_cache,
+ get_window_key(&key, rs),
+ pool);
}
/* Store the WINDOW read for the rep state RS in the current FSX session's
@@ -1205,18 +1172,13 @@ set_cached_combined_window(svn_stringbuf
rep_state_t *rs,
apr_pool_t *scratch_pool)
{
- if (rs->combined_cache)
- {
- /* but key it with the start offset because that is the known state
- * when we will look it up */
- svn_fs_x__window_cache_key_t key = { 0 };
- return svn_cache__set(rs->combined_cache,
- get_window_key(&key, rs),
- window,
- scratch_pool);
- }
-
- return SVN_NO_ERROR;
+ /* but key it with the start offset because that is the known state
+ * when we will look it up */
+ svn_fs_x__window_cache_key_t key = { 0 };
+ return svn_cache__set(rs->combined_cache,
+ get_window_key(&key, rs),
+ window,
+ scratch_pool);
}
/* Build an array of rep_state structures in *LIST giving the delta
@@ -1458,24 +1420,20 @@ read_container_window(svn_stringbuf_t **
svn_fs_x__data_t *ffd = fs->fsap_data;
svn_fs_x__pair_cache_key_t key;
svn_revnum_t revision = svn_fs_x__get_revnum(rs->rep_id.change_set);
+ svn_boolean_t is_cached = FALSE;
+ svn_fs_x__reps_baton_t baton;
SVN_ERR(auto_set_start_offset(rs, scratch_pool));
key.revision = svn_fs_x__packed_base_rev(fs, revision);
key.second = rs->start;
/* already in cache? */
- if (ffd->reps_container_cache)
- {
- svn_boolean_t is_cached = FALSE;
- svn_fs_x__reps_baton_t baton;
- baton.fs = fs;
- baton.idx = rs->sub_item;
-
- SVN_ERR(svn_cache__get_partial((void**)&extractor, &is_cached,
- ffd->reps_container_cache, &key,
- svn_fs_x__reps_get_func, &baton,
- result_pool));
- }
+ baton.fs = fs;
+ baton.idx = rs->sub_item;
+ SVN_ERR(svn_cache__get_partial((void**)&extractor, &is_cached,
+ ffd->reps_container_cache, &key,
+ svn_fs_x__reps_get_func, &baton,
+ result_pool));
/* read from disk, if necessary */
if (extractor == NULL)
@@ -1742,18 +1700,13 @@ read_rep_header(svn_fs_x__rep_header_t *
svn_fs_x__data_t *ffd = fs->fsap_data;
svn_boolean_t is_cached = FALSE;
- if (ffd->rep_header_cache)
- {
- SVN_ERR(svn_cache__get((void**)rep_header, &is_cached,
- ffd->rep_header_cache, key, pool));
- if (is_cached)
- return SVN_NO_ERROR;
- }
+ SVN_ERR(svn_cache__get((void**)rep_header, &is_cached,
+ ffd->rep_header_cache, key, pool));
+ if (is_cached)
+ return SVN_NO_ERROR;
SVN_ERR(svn_fs_x__read_rep_header(rep_header, stream, pool, pool));
-
- if (ffd->rep_header_cache)
- SVN_ERR(svn_cache__set(ffd->rep_header_cache, key, *rep_header, pool));
+ SVN_ERR(svn_cache__set(ffd->rep_header_cache, key, *rep_header, pool));
return SVN_NO_ERROR;
}
@@ -2186,7 +2139,7 @@ svn_fs_x__get_contents(svn_stream_t **co
/* Make the stream attempt fulltext cache lookups if the fulltext
* is cacheable. If it is not, then also don't try to buffer and
* cache it. */
- if (ffd->fulltext_cache && cache_fulltext
+ if ( cache_fulltext
&& SVN_IS_VALID_REVNUM(revision)
&& fulltext_size_is_cachable(ffd, len))
{
@@ -2257,8 +2210,7 @@ svn_fs_x__try_process_file_contents(svn_
fulltext_cache_key.revision = svn_fs_x__get_revnum(rep->id.change_set);
fulltext_cache_key.second = rep->id.number;
- if (ffd->fulltext_cache
- && SVN_IS_VALID_REVNUM(fulltext_cache_key.revision)
+ if ( SVN_IS_VALID_REVNUM(fulltext_cache_key.revision)
&& fulltext_size_is_cachable(ffd, rep->expanded_size))
{
cache_access_wrapper_baton_t wrapper_baton;
@@ -2344,12 +2296,11 @@ svn_fs_x__get_file_delta_stream(svn_txde
svn_stream_t *source_stream, *target_stream;
rep_state_t *rep_state;
svn_fs_x__rep_header_t *rep_header;
- svn_fs_x__data_t *ffd = fs->fsap_data;
/* Try a shortcut: if the target is stored as a delta against the source,
then just use that delta. However, prefer using the fulltext cache
whenever that is available. */
- if (target->data_rep && (source || !ffd->fulltext_cache))
+ if (target->data_rep && source)
{
/* Read target's base rep if any. */
SVN_ERR(create_rep_state(&rep_state, &rep_header, NULL,
@@ -2654,23 +2605,19 @@ svn_fs_x__rep_contents_dir(apr_array_hea
/* find the cache we may use */
svn_cache__t *cache = locate_dir_cache(fs, &key, noderev);
- if (cache)
- {
- svn_boolean_t found;
+ svn_boolean_t found;
- SVN_ERR(svn_cache__get((void **)entries_p, &found, cache, &key,
- result_pool));
- if (found)
- return SVN_NO_ERROR;
- }
+ SVN_ERR(svn_cache__get((void **)entries_p, &found, cache, &key,
+ result_pool));
+ if (found)
+ return SVN_NO_ERROR;
/* Read in the directory contents. */
SVN_ERR(get_dir_contents(entries_p, fs, noderev, result_pool,
scratch_pool));
/* Update the cache, if we are to use one. */
- if (cache)
- SVN_ERR(svn_cache__set(cache, &key, *entries_p, scratch_pool));
+ SVN_ERR(svn_cache__set(cache, &key, *entries_p, scratch_pool));
return SVN_NO_ERROR;
}
@@ -2699,25 +2646,22 @@ svn_fs_x__rep_contents_dir_entry(svn_fs_
/* find the cache we may use */
svn_fs_x__id_t key;
svn_cache__t *cache = locate_dir_cache(fs, &key, noderev);
- if (cache)
- {
- svn_fs_x__ede_baton_t baton;
- baton.hint = *hint;
- baton.name = name;
-
- /* Cache lookup. */
- SVN_ERR(svn_cache__get_partial((void **)dirent,
- &found,
- cache,
- &key,
- svn_fs_x__extract_dir_entry,
- &baton,
- result_pool));
-
- /* Remember the new clue only if we found something at that spot. */
- if (found)
- *hint = baton.hint;
- }
+ svn_fs_x__ede_baton_t baton;
+ baton.hint = *hint;
+ baton.name = name;
+
+ /* Cache lookup. */
+ SVN_ERR(svn_cache__get_partial((void **)dirent,
+ &found,
+ cache,
+ &key,
+ svn_fs_x__extract_dir_entry,
+ &baton,
+ result_pool));
+
+ /* Remember the new clue only if we found something at that spot. */
+ if (found)
+ *hint = baton.hint;
/* fetch data from disk if we did not find it in the cache */
if (! found)
@@ -2778,7 +2722,7 @@ svn_fs_x__get_proplist(apr_hash_t **prop
key.revision = svn_fs_x__get_revnum(rep->id.change_set);
key.second = rep->id.number;
- if (ffd->properties_cache && SVN_IS_VALID_REVNUM(key.revision))
+ if (SVN_IS_VALID_REVNUM(key.revision))
{
svn_boolean_t is_cached;
SVN_ERR(svn_cache__get((void **) proplist_p, &is_cached,
@@ -2794,7 +2738,7 @@ svn_fs_x__get_proplist(apr_hash_t **prop
result_pool));
SVN_ERR(svn_stream_close(stream));
- if (ffd->properties_cache && SVN_IS_VALID_REVNUM(rep->id.change_set))
+ if (SVN_IS_VALID_REVNUM(rep->id.change_set))
SVN_ERR(svn_cache__set(ffd->properties_cache, &key, proplist,
scratch_pool));
}
@@ -2834,7 +2778,7 @@ svn_fs_x__get_changes(apr_array_header_t
/* try cache lookup first */
- if (ffd->changes_container_cache && svn_fs_x__is_packed_rev(fs, rev))
+ if (svn_fs_x__is_packed_rev(fs, rev))
{
apr_off_t offset;
apr_uint32_t sub_item;
@@ -2850,15 +2794,11 @@ svn_fs_x__get_changes(apr_array_header_t
svn_fs_x__changes_get_list_func,
&sub_item, result_pool));
}
- else if (ffd->changes_cache)
+ else
{
SVN_ERR(svn_cache__get((void **) changes, &found, ffd->changes_cache,
&rev, result_pool));
}
- else
- {
- found = FALSE;
- }
if (!found)
{
@@ -2890,15 +2830,11 @@ block_read_contents(svn_fs_t *fs,
apr_off_t max_offset,
apr_pool_t *scratch_pool)
{
- svn_fs_x__data_t *ffd = fs->fsap_data;
svn_fs_x__representation_cache_key_t header_key = { 0 };
rep_state_t rs = { 0 };
svn_filesize_t fulltext_len;
svn_fs_x__rep_header_t *rep_header;
- if (!ffd->txdelta_window_cache || !ffd->combined_window_cache)
- return SVN_NO_ERROR;
-
header_key.revision = (apr_int32_t)key->revision;
header_key.is_packed = svn_fs_x__is_packed_rev(fs, header_key.revision);
header_key.item_index = key->second;
@@ -2976,14 +2912,13 @@ block_read_changes(apr_array_header_t **
svn_fs_x__data_t *ffd = fs->fsap_data;
svn_stream_t *stream;
svn_revnum_t revision = svn_fs_x__get_revnum(entry->items[0].change_set);
- if (!must_read && !ffd->changes_cache)
- return SVN_NO_ERROR;
+ apr_size_t estimated_size;
/* we don't support containers, yet */
SVN_ERR_ASSERT(entry->item_count == 1);
/* already in cache? */
- if (!must_read && ffd->changes_cache)
+ if (!must_read)
{
svn_boolean_t is_cached = FALSE;
SVN_ERR(svn_cache__has_key(&is_cached, ffd->changes_cache, &revision,
@@ -2995,24 +2930,20 @@ block_read_changes(apr_array_header_t **
SVN_ERR(read_item(&stream, fs, rev_file, entry, scratch_pool));
/* read changes from revision file */
-
SVN_ERR(svn_fs_x__read_changes(changes, stream, result_pool, scratch_pool));
/* cache for future reference */
- if (ffd->changes_cache)
- {
- /* Guesstimate for the size of the in-cache representation. */
- apr_size_t estimated_size = (apr_size_t)250 * (*changes)->nelts;
+ /* Guesstimate for the size of the in-cache representation. */
+ estimated_size = (apr_size_t)250 * (*changes)->nelts;
- /* Don't even serialize data that probably won't fit into the
- * cache. This often implies that either CHANGES is very
- * large, memory is scarce or both. Having a huge temporary
- * copy would not be a good thing in either case. */
- if (svn_cache__is_cachable(ffd->changes_cache, estimated_size))
- SVN_ERR(svn_cache__set(ffd->changes_cache, &revision, *changes,
- scratch_pool));
- }
+ /* Don't even serialize data that probably won't fit into the
+ * cache. This often implies that either CHANGES is very
+ * large, memory is scarce or both. Having a huge temporary
+ * copy would not be a good thing in either case. */
+ if (svn_cache__is_cachable(ffd->changes_cache, estimated_size))
+ SVN_ERR(svn_cache__set(ffd->changes_cache, &revision, *changes,
+ scratch_pool));
return SVN_NO_ERROR;
}
@@ -3037,7 +2968,7 @@ block_read_changes_container(apr_array_h
key.second = entry->offset;
/* already in cache? */
- if (!must_read && ffd->changes_container_cache)
+ if (!must_read)
{
svn_boolean_t is_cached = FALSE;
SVN_ERR(svn_cache__has_key(&is_cached, ffd->changes_container_cache,
@@ -3058,10 +2989,8 @@ block_read_changes_container(apr_array_h
if (must_read)
SVN_ERR(svn_fs_x__changes_get_list(changes, container, sub_item,
result_pool));
-
- if (ffd->changes_container_cache)
- SVN_ERR(svn_cache__set(ffd->changes_container_cache, &key, container,
- scratch_pool));
+ SVN_ERR(svn_cache__set(ffd->changes_container_cache, &key, container,
+ scratch_pool));
return SVN_NO_ERROR;
}
@@ -3078,14 +3007,12 @@ block_read_noderev(svn_fs_x__noderev_t *
{
svn_fs_x__data_t *ffd = fs->fsap_data;
svn_stream_t *stream;
- if (!must_read && !ffd->node_revision_cache)
- return SVN_NO_ERROR;
/* we don't support containers, yet */
SVN_ERR_ASSERT(entry->item_count == 1);
/* already in cache? */
- if (!must_read && ffd->node_revision_cache)
+ if (!must_read)
{
svn_boolean_t is_cached = FALSE;
SVN_ERR(svn_cache__has_key(&is_cached, ffd->node_revision_cache, key,
@@ -3100,9 +3027,8 @@ block_read_noderev(svn_fs_x__noderev_t *
SVN_ERR(svn_fs_x__read_noderev(noderev_p, stream, result_pool,
scratch_pool));
- if (ffd->node_revision_cache)
- SVN_ERR(svn_cache__set(ffd->node_revision_cache, key, *noderev_p,
- scratch_pool));
+ SVN_ERR(svn_cache__set(ffd->node_revision_cache, key, *noderev_p,
+ scratch_pool));
return SVN_NO_ERROR;
}
@@ -3127,7 +3053,7 @@ block_read_noderevs_container(svn_fs_x__
key.second = entry->offset;
/* already in cache? */
- if (!must_read && ffd->noderevs_container_cache)
+ if (!must_read)
{
svn_boolean_t is_cached = FALSE;
SVN_ERR(svn_cache__has_key(&is_cached, ffd->noderevs_container_cache,
@@ -3147,9 +3073,8 @@ block_read_noderevs_container(svn_fs_x__
SVN_ERR(svn_fs_x__noderevs_get(noderev_p, container, sub_item,
result_pool));
- if (ffd->noderevs_container_cache)
- SVN_ERR(svn_cache__set(ffd->noderevs_container_cache, &key, container,
- scratch_pool));
+ SVN_ERR(svn_cache__set(ffd->noderevs_container_cache, &key, container,
+ scratch_pool));
return SVN_NO_ERROR;
}
@@ -3174,7 +3099,7 @@ block_read_reps_container(svn_fs_x__rep_
key.second = entry->offset;
/* already in cache? */
- if (!must_read && ffd->reps_container_cache)
+ if (!must_read)
{
svn_boolean_t is_cached = FALSE;
SVN_ERR(svn_cache__has_key(&is_cached, ffd->reps_container_cache,
@@ -3195,9 +3120,8 @@ block_read_reps_container(svn_fs_x__rep_
SVN_ERR(svn_fs_x__reps_get(extractor, fs, container, sub_item,
result_pool));
- if (ffd->noderevs_container_cache)
- SVN_ERR(svn_cache__set(ffd->reps_container_cache, &key, container,
- scratch_pool));
+ SVN_ERR(svn_cache__set(ffd->reps_container_cache, &key, container,
+ scratch_pool));
return SVN_NO_ERROR;
}
@@ -3289,11 +3213,10 @@ block_read(void **result,
break;
case SVN_FS_X__ITEM_TYPE_NODEREV:
- if (ffd->node_revision_cache || is_result)
- SVN_ERR(block_read_noderev((svn_fs_x__noderev_t **)&item,
- fs, revision_file,
- entry, &key, is_result,
- pool, iterpool));
+ SVN_ERR(block_read_noderev((svn_fs_x__noderev_t **)&item,
+ fs, revision_file,
+ entry, &key, is_result,
+ pool, iterpool));
break;
case SVN_FS_X__ITEM_TYPE_CHANGES:
Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/tree.c?rev=1669960&r1=1669959&r2=1669960&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/tree.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/tree.c Sun Mar 29 19:58:53 2015
@@ -4057,16 +4057,13 @@ get_mergeinfo_for_path(svn_mergeinfo_t *
cache_key = mergeinfo_cache_key(path, rev_root, inherit,
adjust_inherited_mergeinfo, scratch_pool);
- if (ffd->mergeinfo_existence_cache)
- {
- SVN_ERR(svn_cache__get((void **)&mergeinfo_exists, &found,
- ffd->mergeinfo_existence_cache,
- cache_key, result_pool));
- if (found && mergeinfo_exists->data[0] == '1')
- SVN_ERR(svn_cache__get((void **)mergeinfo, &found,
- ffd->mergeinfo_cache,
- cache_key, result_pool));
- }
+ SVN_ERR(svn_cache__get((void **)&mergeinfo_exists, &found,
+ ffd->mergeinfo_existence_cache,
+ cache_key, result_pool));
+ if (found && mergeinfo_exists->data[0] == '1')
+ SVN_ERR(svn_cache__get((void **)mergeinfo, &found,
+ ffd->mergeinfo_cache,
+ cache_key, result_pool));
if (! found)
{
@@ -4074,16 +4071,13 @@ get_mergeinfo_for_path(svn_mergeinfo_t *
inherit,
adjust_inherited_mergeinfo,
result_pool, scratch_pool));
- if (ffd->mergeinfo_existence_cache)
- {
- mergeinfo_exists = svn_stringbuf_create(*mergeinfo ? "1" : "0",
- scratch_pool);
- SVN_ERR(svn_cache__set(ffd->mergeinfo_existence_cache,
- cache_key, mergeinfo_exists, scratch_pool));
- if (*mergeinfo)
- SVN_ERR(svn_cache__set(ffd->mergeinfo_cache,
- cache_key, *mergeinfo, scratch_pool));
- }
+ mergeinfo_exists = svn_stringbuf_create(*mergeinfo ? "1" : "0",
+ scratch_pool);
+ SVN_ERR(svn_cache__set(ffd->mergeinfo_existence_cache,
+ cache_key, mergeinfo_exists, scratch_pool));
+ if (*mergeinfo)
+ SVN_ERR(svn_cache__set(ffd->mergeinfo_cache,
+ cache_key, *mergeinfo, scratch_pool));
}
return SVN_NO_ERROR;