You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by iv...@apache.org on 2014/06/20 12:34:47 UTC
svn commit: r1604130 - in
/subversion/branches/remove-log-addressing/tools/server-side/svnfsfs:
dump-index-cmd.c load-index-cmd.c stats-cmd.c svnfsfs.c
Author: ivan
Date: Fri Jun 20 10:34:47 2014
New Revision: 1604130
URL: http://svn.apache.org/r1604130
Log:
On remove-log-addressing branch: Remove log addressing support from
svnfsfs utility.
* tools/server-side/svnfsfs/dump-index-cmd.c
* tools/server-side/svnfsfs/load-index-cmd.c
(): Remove file.
* tools/server-side/svnfsfs/stats-cmd.c
(parse_representation, read_noderev, read_revisions): Do check for log
addressing support.
(read_item, read_log_rev_or_packfile, read_log_pack_file): Remove.
* tools/server-side/svnfsfs/svnfsfs.c
(cmd_table): Remove dump-index and load-index subcommands.
Removed:
subversion/branches/remove-log-addressing/tools/server-side/svnfsfs/dump-index-cmd.c
subversion/branches/remove-log-addressing/tools/server-side/svnfsfs/load-index-cmd.c
Modified:
subversion/branches/remove-log-addressing/tools/server-side/svnfsfs/stats-cmd.c
subversion/branches/remove-log-addressing/tools/server-side/svnfsfs/svnfsfs.c
Modified: subversion/branches/remove-log-addressing/tools/server-side/svnfsfs/stats-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/tools/server-side/svnfsfs/stats-cmd.c?rev=1604130&r1=1604129&r2=1604130&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/tools/server-side/svnfsfs/stats-cmd.c (original)
+++ subversion/branches/remove-log-addressing/tools/server-side/svnfsfs/stats-cmd.c Fri Jun 20 10:34:47 2014
@@ -797,16 +797,13 @@ parse_representation(rep_stats_t **repre
result->offset = (apr_size_t)offset;
result->size = (apr_size_t)size;
- if (!svn_fs_fs__use_log_addressing(fs->fs, revision))
- {
- SVN_ERR(read_rep_base(&result->delta_base, &header_size,
- &is_plain, fs, file_content,
- (apr_size_t)offset,
- pool, scratch_pool));
+ SVN_ERR(read_rep_base(&result->delta_base, &header_size,
+ &is_plain, fs, file_content,
+ (apr_size_t)offset,
+ pool, scratch_pool));
- result->header_size = header_size;
- result->is_plain = is_plain;
- }
+ result->header_size = header_size;
+ result->is_plain = is_plain;
svn_sort__array_insert(revision_info->representations, &result, idx);
}
@@ -1169,8 +1166,7 @@ read_noderev(fs_t *fs,
/* if this is a directory and has not been processed, yet, read and
* process it recursively */
- if ( is_dir && text && text->ref_count == 1
- && !svn_fs_fs__use_log_addressing(fs->fs, revision_info->revision))
+ if (is_dir && text && text->ref_count == 1)
SVN_ERR(parse_dir(fs, file_content, text, revision_info,
pool, scratch_pool));
@@ -1343,166 +1339,6 @@ read_phys_revision_file(fs_t *fs,
return SVN_NO_ERROR;
}
-/* Read the item described by ENTRY from the REV_FILE in FS and return
- * the respective byte sequence in *CONTENTS allocated in POOL.
- */
-static svn_error_t *
-read_item(svn_stringbuf_t **contents,
- fs_t *fs,
- svn_fs_fs__revision_file_t *rev_file,
- svn_fs_fs__p2l_entry_t *entry,
- apr_pool_t *pool)
-{
- fs_fs_data_t *ffd = fs->fs->fsap_data;
-
- svn_stringbuf_t *item = svn_stringbuf_create_ensure(entry->size, pool);
- item->len = entry->size;
- item->data[item->len] = 0;
-
- SVN_ERR(svn_io_file_aligned_seek(rev_file->file, ffd->block_size, NULL,
- entry->offset, pool));
- SVN_ERR(svn_io_file_read_full2(rev_file->file, item->data, item->len,
- NULL, NULL, pool));
-
- *contents = item;
-
- return SVN_NO_ERROR;
-}
-
-/* Process the logically addressed revision contents of revisions BASE to
- * BASE + COUNT - 1 in FS. Use POOL for allocations.
- */
-static svn_error_t *
-read_log_rev_or_packfile(fs_t *fs,
- svn_revnum_t base,
- int count,
- apr_pool_t *pool)
-{
- apr_pool_t *iterpool = svn_pool_create(pool);
- apr_pool_t *localpool = svn_pool_create(pool);
- apr_off_t max_offset;
- apr_off_t offset = 0;
- int i;
- svn_fs_fs__revision_file_t *rev_file;
- fs_fs_data_t *ffd = fs->fs->fsap_data;
-
- /* we will process every revision in the rev / pack file */
- for (i = 0; i < count; ++i)
- {
- /* create the revision info for the current rev */
- revision_info_t *info = apr_pcalloc(pool, sizeof(*info));
- info->representations = apr_array_make(pool, 4, sizeof(rep_stats_t*));
- info->revision = base + i;
-
- APR_ARRAY_PUSH(fs->revisions, revision_info_t*) = info;
- }
-
- /* open the pack / rev file that is covered by the p2l index */
- SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&rev_file, fs->fs, base,
- localpool));
- SVN_ERR(svn_fs_fs__p2l_get_max_offset(&max_offset, fs->fs, rev_file,
- base, localpool));
-
- /* record the whole pack size in the first rev so the total sum will
- still be correct */
- APR_ARRAY_IDX(fs->revisions, base, revision_info_t*)->end = max_offset;
-
- /* for all offsets in the file, get the P2L index entries and process
- the interesting items (change lists, noderevs) */
- for (offset = 0; offset < max_offset; )
- {
- apr_array_header_t *entries;
-
- svn_pool_clear(iterpool);
-
- /* get all entries for the current block */
- SVN_ERR(svn_fs_fs__p2l_index_lookup(&entries, fs->fs, rev_file, base,
- offset, ffd->p2l_page_size,
- iterpool));
-
- /* process all entries (and later continue with the next block) */
- for (i = 0; i < entries->nelts; ++i)
- {
- svn_fs_fs__p2l_entry_t *entry
- = &APR_ARRAY_IDX(entries, i, svn_fs_fs__p2l_entry_t);
-
- /* skip bits we previously processed */
- if (i == 0 && entry->offset < offset)
- continue;
-
- /* skip zero-sized entries */
- if (entry->size == 0)
- continue;
-
- /* read and process interesting items */
- if (entry->type == SVN_FS_FS__ITEM_TYPE_NODEREV)
- {
- svn_stringbuf_t *item;
- revision_info_t *info = APR_ARRAY_IDX(fs->revisions,
- entry->item.revision,
- revision_info_t*);
- SVN_ERR(read_item(&item, fs, rev_file, entry, iterpool));
- SVN_ERR(read_noderev(fs, item, 0, info, pool, iterpool));
- }
- else if (entry->type == SVN_FS_FS__ITEM_TYPE_CHANGES)
- {
- svn_stringbuf_t *item;
- revision_info_t *info = APR_ARRAY_IDX(fs->revisions,
- entry->item.revision,
- revision_info_t*);
- SVN_ERR(read_item(&item, fs, rev_file, entry, iterpool));
- info->change_count
- = get_change_count(item->data + 0, item->len);
- info->changes_len += entry->size;
- }
-
- /* advance offset */
- offset += entry->size;
- }
- }
-
- /* clean up and close file handles */
- svn_pool_destroy(iterpool);
- svn_pool_destroy(localpool);
-
- return SVN_NO_ERROR;
-}
-
-/* Read the content of the pack file staring at revision BASE logical
- * addressing mode and store it in FS. Use POOL for allocations.
- */
-static svn_error_t *
-read_log_pack_file(fs_t *fs,
- svn_revnum_t base,
- apr_pool_t *pool)
-{
- fs_fs_data_t *ffd = fs->fs->fsap_data;
- SVN_ERR(read_log_rev_or_packfile(fs, base, ffd->max_files_per_dir, pool));
-
- /* one more pack file processed */
- print_progress(base);
-
- return SVN_NO_ERROR;
-}
-
-/* Read the content of the file for REVISION in logical addressing mode
- * and store its contents in FS. Use POOL for allocations.
- */
-static svn_error_t *
-read_log_revision_file(fs_t *fs,
- svn_revnum_t revision,
- apr_pool_t *pool)
-{
- fs_fs_data_t *ffd = fs->fs->fsap_data;
- SVN_ERR(read_log_rev_or_packfile(fs, revision, 1, pool));
-
- /* show progress every 1000 revs or so */
- if (revision % ffd->max_files_per_dir == 0)
- print_progress(revision);
-
- return SVN_NO_ERROR;
-}
-
/* Read the repository at PATH and return the result in *FS.
* Use POOL for allocations.
*/
@@ -1543,17 +1379,14 @@ read_revisions(fs_t **fs,
for ( revision = 0
; revision < ffd->min_unpacked_rev
; revision += ffd->max_files_per_dir)
- if (svn_fs_fs__use_log_addressing((*fs)->fs, revision))
- SVN_ERR(read_log_pack_file(*fs, revision, pool));
- else
+ {
SVN_ERR(read_phys_pack_file(*fs, revision, pool));
-
+ }
/* read non-packed revs */
for ( ; revision <= ffd->youngest_rev_cache; ++revision)
- if (svn_fs_fs__use_log_addressing((*fs)->fs, revision))
- SVN_ERR(read_log_revision_file(*fs, revision, pool));
- else
+ {
SVN_ERR(read_phys_revision_file(*fs, revision, pool));
+ }
return SVN_NO_ERROR;
}
Modified: subversion/branches/remove-log-addressing/tools/server-side/svnfsfs/svnfsfs.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/tools/server-side/svnfsfs/svnfsfs.c?rev=1604130&r1=1604129&r2=1604130&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/tools/server-side/svnfsfs/svnfsfs.c (original)
+++ subversion/branches/remove-log-addressing/tools/server-side/svnfsfs/svnfsfs.c Fri Jun 20 10:34:47 2014
@@ -148,16 +148,6 @@ static const svn_opt_subcommand_desc2_t
"Describe the usage of this program or its subcommands.\n"),
{0} },
- {"dump-index", subcommand__dump_index, {0}, N_
- ("usage: svnfsfs dump-index REPOS_PATH\n\n"
- "Dump the index contents to console.\n"),
- {'r', 'M'} },
-
- {"load-index", subcommand__load_index, {0}, N_
- ("usage: svnfsfs load-index REPOS_PATH\n\n"
- "Read the index contents to console.\n"),
- {'M'} },
-
{"stats", subcommand__stats, {0}, N_
("usage: svnfsfs stats REPOS_PATH\n\n"
"Write object size statistics to console.\n"),