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/10/11 15:12:36 UTC
svn commit: r1707973 - /subversion/trunk/subversion/libsvn_fs_fs/revprops.c
Author: stefan2
Date: Sun Oct 11 13:12:36 2015
New Revision: 1707973
URL: http://svn.apache.org/viewvc?rev=1707973&view=rev
Log:
Code cleanup:
Properly name the RESULT_POOL in FSFS revprop functions that follow the
2-pool paradigm
* subversion/libsvn_fs_fs/revprops.c
(parse_revprop,
get_min_filename_len,
get_revprop_packname,
parse_packed_revprops): Rename the POOL parameter to RESULT_POOL.
Modified:
subversion/trunk/subversion/libsvn_fs_fs/revprops.c
Modified: subversion/trunk/subversion/libsvn_fs_fs/revprops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/revprops.c?rev=1707973&r1=1707972&r2=1707973&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/revprops.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/revprops.c Sun Oct 11 13:12:36 2015
@@ -182,21 +182,22 @@ typedef struct packed_revprops_t
/* Parse the serialized revprops in CONTENT and return them in *PROPERTIES.
* Also, put them into the revprop cache, if activated, for future use.
*
- * The returned hash will be allocated in POOL, SCRATCH_POOL is being used
- * for temporary allocations.
+ * The returned hash will be allocated in RESULT_POOL, SCRATCH_POOL is being
+ * used for temporary allocations.
*/
static svn_error_t *
parse_revprop(apr_hash_t **properties,
svn_fs_t *fs,
svn_revnum_t revision,
svn_string_t *content,
- apr_pool_t *pool,
+ apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
svn_stream_t *stream = svn_stream_from_string(content, scratch_pool);
- *properties = apr_hash_make(pool);
+ *properties = apr_hash_make(result_pool);
- SVN_ERR_W(svn_hash_read2(*properties, stream, SVN_HASH_TERMINATOR, pool),
+ SVN_ERR_W(svn_hash_read2(*properties, stream, SVN_HASH_TERMINATOR,
+ result_pool),
apr_psprintf(scratch_pool, "Failed to parse revprops for r%ld.",
revision));
@@ -259,12 +260,13 @@ get_min_filename_len(packed_revprops_t *
}
/* Given FS and REVPROPS->REVISION, fill the FILENAME, FOLDER and MANIFEST
- * members. Use POOL for allocating results and SCRATCH_POOL for temporaries.
+ * members. Use RESULT_POOL for allocating results and SCRATCH_POOL for
+ * temporaries.
*/
static svn_error_t *
get_revprop_packname(svn_fs_t *fs,
packed_revprops_t *revprops,
- apr_pool_t *pool,
+ apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
fs_fs_data_t *ffd = fs->fsap_data;
@@ -285,18 +287,20 @@ get_revprop_packname(svn_fs_t *fs,
--rev_count;
}
- revprops->manifest = apr_array_make(pool, rev_count, sizeof(const char*));
+ revprops->manifest = apr_array_make(result_pool, rev_count,
+ sizeof(const char*));
/* No line in the file can be less than this number of chars long. */
min_filename_len = get_min_filename_len(revprops);
/* Read the content of the manifest file */
revprops->folder
- = svn_fs_fs__path_revprops_pack_shard(fs, revprops->revision, pool);
+ = svn_fs_fs__path_revprops_pack_shard(fs, revprops->revision,
+ result_pool);
manifest_file_path
- = svn_dirent_join(revprops->folder, PATH_MANIFEST, pool);
+ = svn_dirent_join(revprops->folder, PATH_MANIFEST, result_pool);
- SVN_ERR(svn_fs_fs__read_content(&content, manifest_file_path, pool));
+ SVN_ERR(svn_fs_fs__read_content(&content, manifest_file_path, result_pool));
/* There CONTENT must have a certain minimal size and there no
* unterminated lines at the end of the file. Both guarantees also
@@ -389,7 +393,7 @@ static svn_error_t *
parse_packed_revprops(svn_fs_t *fs,
packed_revprops_t *revprops,
svn_boolean_t read_all,
- apr_pool_t *pool,
+ apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
svn_stream_t *stream;
@@ -401,7 +405,7 @@ parse_packed_revprops(svn_fs_t *fs,
/* decompress (even if the data is only "stored", there is still a
* length header to remove) */
svn_stringbuf_t *compressed = revprops->packed_revprops;
- svn_stringbuf_t *uncompressed = svn_stringbuf_create_empty(pool);
+ svn_stringbuf_t *uncompressed = svn_stringbuf_create_empty(result_pool);
SVN_ERR(svn__decompress(compressed->data, compressed->len,
uncompressed, APR_SIZE_MAX));
@@ -441,18 +445,21 @@ parse_packed_revprops(svn_fs_t *fs,
offset = header_end - uncompressed->data + 2;
- revprops->packed_revprops = svn_stringbuf_create_empty(pool);
+ revprops->packed_revprops = svn_stringbuf_create_empty(result_pool);
revprops->packed_revprops->data = uncompressed->data + offset;
revprops->packed_revprops->len = (apr_size_t)(uncompressed->len - offset);
- revprops->packed_revprops->blocksize = (apr_size_t)(uncompressed->blocksize - offset);
+ revprops->packed_revprops->blocksize = (apr_size_t)(uncompressed->blocksize
+ - offset);
/* STREAM still points to the first entry in the sizes list. */
revprops->start_revision = (svn_revnum_t)first_rev;
if (read_all)
{
/* Init / construct REVPROPS members. */
- revprops->sizes = apr_array_make(pool, (int)count, sizeof(offset));
- revprops->offsets = apr_array_make(pool, (int)count, sizeof(offset));
+ revprops->sizes = apr_array_make(result_pool, (int)count,
+ sizeof(offset));
+ revprops->offsets = apr_array_make(result_pool, (int)count,
+ sizeof(offset));
}
/* Now parse, revision by revision, the size and content of each
@@ -478,7 +485,7 @@ parse_packed_revprops(svn_fs_t *fs,
if (revision == revprops->revision)
{
SVN_ERR(parse_revprop(&revprops->properties, fs, revision,
- &serialized, pool, iterpool));
+ &serialized, result_pool, iterpool));
revprops->serialized_size = serialized.len;
/* If we only wanted the revprops for REVISION then we are done. */