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/08/10 14:30:00 UTC
svn commit: r1695044 - in /subversion/trunk/subversion/libsvn_fs_x:
caching.c fs.h pack.c pack.h temp_serializer.c temp_serializer.h
Author: stefan2
Date: Mon Aug 10 12:30:00 2015
New Revision: 1695044
URL: http://svn.apache.org/r1695044
Log:
Remove manifest file reading and caching code from FSX - which never
used manifests in the first place.
* subversion/libsvn_fs_x/fs.h
(svn_fs_x__data_t): Remove the packed_offset_cache.
* subversion/libsvn_fs_x/caching.c
(svn_fs_x__initialize_caches): Remove its initialization call.
* subversion/libsvn_fs_x/temp_serializer.h
(svn_fs_x__serialize_manifest,
svn_fs_x__deserialize_manifest): Remove.
* subversion/libsvn_fs_x/temp_serializer.c
(svn_fs_x__serialize_manifest,
svn_fs_x__deserialize_manifest): Same.
* subversion/libsvn_fs_x/pack.h
(svn_fs_x__get_packed_offset): Remove unused declaration.
* subversion/libsvn_fs_x/pack.c
(svn_fs_x__get_packed_offset): Remove unused implementation.
Modified:
subversion/trunk/subversion/libsvn_fs_x/caching.c
subversion/trunk/subversion/libsvn_fs_x/fs.h
subversion/trunk/subversion/libsvn_fs_x/pack.c
subversion/trunk/subversion/libsvn_fs_x/pack.h
subversion/trunk/subversion/libsvn_fs_x/temp_serializer.c
subversion/trunk/subversion/libsvn_fs_x/temp_serializer.h
Modified: subversion/trunk/subversion/libsvn_fs_x/caching.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/caching.c?rev=1695044&r1=1695043&r2=1695044&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/caching.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/caching.c Mon Aug 10 12:30:00 2015
@@ -435,23 +435,6 @@ svn_fs_x__initialize_caches(svn_fs_t *fs
no_handler, FALSE,
fs->pool, scratch_pool));
- /* Only 16 bytes per entry (a revision number + the corresponding offset).
- Since we want ~8k pages, that means 512 entries per page. */
- SVN_ERR(create_cache(&(ffd->packed_offset_cache),
- NULL,
- membuffer,
- 32, 1,
- svn_fs_x__serialize_manifest,
- svn_fs_x__deserialize_manifest,
- sizeof(svn_revnum_t),
- apr_pstrcat(scratch_pool, prefix, "PACK-MANIFEST",
- SVN_VA_NULL),
- SVN_CACHE__MEMBUFFER_HIGH_PRIORITY,
- has_namespace,
- fs,
- no_handler, FALSE,
- fs->pool, scratch_pool));
-
/* initialize node revision cache, if caching has been enabled */
SVN_ERR(create_cache(&(ffd->node_revision_cache),
NULL,
Modified: subversion/trunk/subversion/libsvn_fs_x/fs.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/fs.h?rev=1695044&r1=1695043&r2=1695044&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/fs.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/fs.h Mon Aug 10 12:30:00 2015
@@ -305,12 +305,6 @@ typedef struct svn_fs_x__data_t
/* Node properties cache. Maps from rep key to apr_hash_t. */
svn_cache__t *properties_cache;
- /* Pack manifest cache; a cache mapping (svn_revnum_t) shard number to
- a manifest; and a manifest is a mapping from (svn_revnum_t) revision
- number offset within a shard to (apr_off_t) byte-offset in the
- respective pack file. */
- svn_cache__t *packed_offset_cache;
-
/* Cache for txdelta_window_t objects;
* the key is svn_fs_x__window_cache_key_t */
svn_cache__t *txdelta_window_cache;
Modified: subversion/trunk/subversion/libsvn_fs_x/pack.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/pack.c?rev=1695044&r1=1695043&r2=1695044&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/pack.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/pack.c Mon Aug 10 12:30:00 2015
@@ -2012,72 +2012,6 @@ pack_log_addressed(svn_fs_t *fs,
return SVN_NO_ERROR;
}
-/* Given REV in FS, set *REV_OFFSET to REV's offset in the packed file.
- Use SCRATCH_POOL for temporary allocations. */
-svn_error_t *
-svn_fs_x__get_packed_offset(apr_off_t *rev_offset,
- svn_fs_t *fs,
- svn_revnum_t rev,
- apr_pool_t *scratch_pool)
-{
- svn_fs_x__data_t *ffd = fs->fsap_data;
- svn_stream_t *manifest_stream;
- svn_boolean_t is_cached;
- svn_revnum_t shard;
- apr_int64_t shard_pos;
- apr_array_header_t *manifest;
- apr_pool_t *iterpool;
-
- shard = rev / ffd->max_files_per_dir;
-
- /* position of the shard within the manifest */
- shard_pos = rev % ffd->max_files_per_dir;
-
- /* fetch exactly that element into *rev_offset, if the manifest is found
- in the cache */
- SVN_ERR(svn_cache__get_partial((void **) rev_offset, &is_cached,
- ffd->packed_offset_cache, &shard,
- svn_fs_x__get_sharded_offset, &shard_pos,
- scratch_pool));
-
- if (is_cached)
- return SVN_NO_ERROR;
-
- /* Open the manifest file. */
- SVN_ERR(svn_stream_open_readonly(&manifest_stream,
- svn_fs_x__path_rev_packed(fs, rev, PATH_MANIFEST,
- scratch_pool),
- scratch_pool, scratch_pool));
-
- /* While we're here, let's just read the entire manifest file into an array,
- so we can cache the entire thing. */
- iterpool = svn_pool_create(scratch_pool);
- manifest = apr_array_make(scratch_pool, ffd->max_files_per_dir,
- sizeof(apr_off_t));
- while (1)
- {
- svn_boolean_t eof;
- apr_int64_t val;
-
- svn_pool_clear(iterpool);
- SVN_ERR(svn_fs_x__read_number_from_stream(&val, &eof, manifest_stream,
- iterpool));
- if (eof)
- break;
-
- APR_ARRAY_PUSH(manifest, apr_off_t) = (apr_off_t)val;
- }
- svn_pool_destroy(iterpool);
-
- *rev_offset = APR_ARRAY_IDX(manifest, rev % ffd->max_files_per_dir,
- apr_off_t);
-
- /* Close up shop and cache the array. */
- SVN_ERR(svn_stream_close(manifest_stream));
- return svn_cache__set(ffd->packed_offset_cache, &shard, manifest,
- scratch_pool);
-}
-
/* In filesystem FS, pack the revision SHARD containing exactly
* MAX_FILES_PER_DIR revisions from SHARD_PATH into the PACK_FILE_DIR,
* using SCRATCH_POOL for temporary allocations. Try to limit the amount of
Modified: subversion/trunk/subversion/libsvn_fs_x/pack.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/pack.h?rev=1695044&r1=1695043&r2=1695044&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/pack.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/pack.h Mon Aug 10 12:30:00 2015
@@ -39,17 +39,6 @@ svn_fs_x__pack(svn_fs_t *fs,
void *cancel_baton,
apr_pool_t *scratch_pool);
-/**
- * For the packed revision REV in FS, determine the offset within the
- * revision pack file and return it in REV_OFFSET.
- * Use SCRATCH_POOL for temporary allocations.
- */
-svn_error_t *
-svn_fs_x__get_packed_offset(apr_off_t *rev_offset,
- svn_fs_t *fs,
- svn_revnum_t rev,
- apr_pool_t *scratch_pool);
-
/* Return the svn_dir_entry_t* objects of DIRECTORY in an APR array
* allocated in RESULT_POOL with entries added in storage (on-disk) order.
* FS' format will be used to pick the optimal ordering strategy. Use
Modified: subversion/trunk/subversion/libsvn_fs_x/temp_serializer.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/temp_serializer.c?rev=1695044&r1=1695043&r2=1695044&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/temp_serializer.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/temp_serializer.c Mon Aug 10 12:30:00 2015
@@ -480,39 +480,6 @@ svn_fs_x__deserialize_txdelta_window(voi
return SVN_NO_ERROR;
}
-svn_error_t *
-svn_fs_x__serialize_manifest(void **data,
- apr_size_t *data_len,
- void *in,
- apr_pool_t *pool)
-{
- apr_array_header_t *manifest = in;
-
- *data_len = sizeof(apr_off_t) *manifest->nelts;
- *data = apr_palloc(pool, *data_len);
- memcpy(*data, manifest->elts, *data_len);
-
- return SVN_NO_ERROR;
-}
-
-svn_error_t *
-svn_fs_x__deserialize_manifest(void **out,
- void *data,
- apr_size_t data_len,
- apr_pool_t *result_pool)
-{
- apr_array_header_t *manifest
- = apr_array_make(result_pool, 1, sizeof(apr_off_t));
-
- manifest->nelts = (int) (data_len / sizeof(apr_off_t));
- manifest->nalloc = (int) (data_len / sizeof(apr_off_t));
- manifest->elts = (char*)data;
-
- *out = manifest;
-
- return SVN_NO_ERROR;
-}
-
/* Auxiliary structure representing the content of a properties hash.
This structure is much easier to (de-)serialize than an apr_hash.
*/
Modified: subversion/trunk/subversion/libsvn_fs_x/temp_serializer.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/temp_serializer.h?rev=1695044&r1=1695043&r2=1695044&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/temp_serializer.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/temp_serializer.h Mon Aug 10 12:30:00 2015
@@ -91,26 +91,6 @@ svn_fs_x__deserialize_txdelta_window(voi
apr_pool_t *result_pool);
/**
- * Implements #svn_cache__serialize_func_t for a manifest
- * (@a in is an #apr_array_header_t of apr_off_t elements).
- */
-svn_error_t *
-svn_fs_x__serialize_manifest(void **data,
- apr_size_t *data_len,
- void *in,
- apr_pool_t *pool);
-
-/**
- * Implements #svn_cache__deserialize_func_t for a manifest
- * (@a *out is an #apr_array_header_t of apr_off_t elements).
- */
-svn_error_t *
-svn_fs_x__deserialize_manifest(void **out,
- void *data,
- apr_size_t data_len,
- apr_pool_t *result_pool);
-
-/**
* Implements #svn_cache__serialize_func_t for a properties hash
* (@a in is an #apr_hash_t of svn_string_t elements, keyed by const char*).
*/