Author: stefan2
Date: Mon Aug 26 09:45:36 2013
New Revision: 1517479
URL: http://svn.apache.org/r1517479
Log:
Merged branches/fsfs-improvements into /trunk (clean merge).
Removed BRANCH-README.
Added:
subversion/trunk/subversion/libsvn_fs_fs/cached_data.c
- copied unchanged from r1517476,
subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/cached_data.c
subversion/trunk/subversion/libsvn_fs_fs/cached_data.h
- copied unchanged from r1517476,
subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/cached_data.h
subversion/trunk/subversion/libsvn_fs_fs/hotcopy.c
- copied unchanged from r1517476,
subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/hotcopy.c
subversion/trunk/subversion/libsvn_fs_fs/hotcopy.h
- copied unchanged from r1517476,
subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/hotcopy.h
subversion/trunk/subversion/libsvn_fs_fs/low_level.c
- copied unchanged from r1517476,
subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/low_level.c
subversion/trunk/subversion/libsvn_fs_fs/low_level.h
- copied unchanged from r1517476,
subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/low_level.h
subversion/trunk/subversion/libsvn_fs_fs/pack.c
- copied unchanged from r1517476,
subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/pack.c
subversion/trunk/subversion/libsvn_fs_fs/pack.h
- copied unchanged from r1517476,
subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/pack.h
subversion/trunk/subversion/libsvn_fs_fs/recovery.c
- copied unchanged from r1517476,
subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/recovery.c
subversion/trunk/subversion/libsvn_fs_fs/recovery.h
- copied unchanged from r1517476,
subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/recovery.h
subversion/trunk/subversion/libsvn_fs_fs/revprops.c
- copied unchanged from r1517476,
subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/revprops.c
subversion/trunk/subversion/libsvn_fs_fs/revprops.h
- copied unchanged from r1517476,
subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/revprops.h
subversion/trunk/subversion/libsvn_fs_fs/transaction.c
- copied unchanged from r1517476,
subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c
subversion/trunk/subversion/libsvn_fs_fs/transaction.h
- copied unchanged from r1517476,
subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.h
subversion/trunk/subversion/libsvn_fs_fs/util.c
- copied unchanged from r1517476,
subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/util.c
subversion/trunk/subversion/libsvn_fs_fs/util.h
- copied unchanged from r1517476,
subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/util.h
subversion/trunk/subversion/libsvn_fs_fs/verify.c
- copied unchanged from r1517476,
subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/verify.c
subversion/trunk/subversion/libsvn_fs_fs/verify.h
- copied unchanged from r1517476,
subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/verify.h
Removed:
subversion/trunk/subversion/libsvn_fs_fs/key-gen.c
subversion/trunk/subversion/libsvn_fs_fs/key-gen.h
Modified:
subversion/trunk/ (props changed)
subversion/trunk/notes/knobs
subversion/trunk/subversion/include/svn_fs.h
subversion/trunk/subversion/libsvn_fs/fs-loader.c
subversion/trunk/subversion/libsvn_fs/fs-loader.h
subversion/trunk/subversion/libsvn_fs_base/tree.c
subversion/trunk/subversion/libsvn_fs_fs/caching.c
subversion/trunk/subversion/libsvn_fs_fs/dag.c
subversion/trunk/subversion/libsvn_fs_fs/dag.h
subversion/trunk/subversion/libsvn_fs_fs/fs.c
subversion/trunk/subversion/libsvn_fs_fs/fs.h
subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
subversion/trunk/subversion/libsvn_fs_fs/fs_fs.h
subversion/trunk/subversion/libsvn_fs_fs/id.c
subversion/trunk/subversion/libsvn_fs_fs/id.h
subversion/trunk/subversion/libsvn_fs_fs/lock.c
subversion/trunk/subversion/libsvn_fs_fs/rep-cache.c
subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.c
subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.h
subversion/trunk/subversion/libsvn_fs_fs/tree.c
subversion/trunk/subversion/libsvn_fs_x/ (props changed)
subversion/trunk/subversion/libsvn_fs_x/tree.c
subversion/trunk/subversion/libsvn_repos/reporter.c
subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c
subversion/trunk/subversion/svnserve/svnserve.c
subversion/trunk/subversion/tests/libsvn_fs_fs/ (props changed)
subversion/trunk/subversion/tests/libsvn_fs_x/ (props changed)
subversion/trunk/tools/server-side/svn-rep-sharing-stats.c
Propchange: subversion/trunk/
------------------------------------------------------------------------------
Merged /subversion/branches/fsfs-improvements:r1499981-1517476
Modified: subversion/trunk/notes/knobs
URL:
http://svn.apache.org/viewvc/subversion/trunk/notes/knobs?rev=1517479&r1=1517478&r2=1517479&view=diff
==============================================================================
--- subversion/trunk/notes/knobs (original)
+++ subversion/trunk/notes/knobs Mon Aug 26 09:45:36 2013
@@ -68,6 +68,7 @@ SERF_VERBOSE
SSL_VERBOSE
SVN_DEPRECATED
SVN_FS__TRAIL_DEBUG
+SVN_FS_FS__LOG_ACCESS
SVN_UTF_NO_UNINITIALISED_ACCESS
2.4 Test-only
@@ -395,7 +396,17 @@ SVN_I_LIKE_LATENCY_SO_IGNORE_HTTPV2
Default: not defined
Suggested: defined, not defined
-5.14 SVN_UTF_NO_UNINITIALISED_ACCESS
+5.14 SVN_FS_FS__LOG_ACCESS
+
+ Scope: libsvn_fs_fs/cached_data.c
+ Purpose: logs type and location info for any fsfs data access above the
+ cache layer to console (i.e. what data gets requested from FSFS
+ rather than disk)
+ Range: definedness
+ Default: not defined
+ Suggested: defined, not defined
+
+5.15 SVN_UTF_NO_UNINITIALISED_ACCESS
Scope: libsvn_subr
Purpose: Disables some code that triggers warnings in memory tools
Modified: subversion/trunk/subversion/include/svn_fs.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_fs.h?rev=1517479&r1=1517478&r2=1517479&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_fs.h (original)
+++ subversion/trunk/subversion/include/svn_fs.h Mon Aug 26 09:45:36 2013
@@ -1832,6 +1832,19 @@ svn_fs_dir_entries(apr_hash_t **entries_
const char *path,
apr_pool_t *pool);
+/** Take the #svn_fs_dirent_t structures in @a entries as returned by
+ * #svn_fs_dir_entries for @a root and determine an optimized ordering
+ * in which data access would most likely be efficient. Set @a *ordered_p
+ * to a newly allocated APR array of pointers to these #svn_fs_dirent_t
+ * structures. Allocate the array (but not its contents) in @a pool.
+ *
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_fs_dir_optimal_order(apr_array_header_t **ordered_p,
+ svn_fs_root_t *root,
+ apr_hash_t *entries,
+ apr_pool_t *pool);
/** Create a new directory named @a path in @a root. The new directory has
* no entries, and no properties. @a root must be the root of a transaction,
Modified: subversion/trunk/subversion/libsvn_fs/fs-loader.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs/fs-loader.c?rev=1517479&r1=1517478&r2=1517479&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/trunk/subversion/libsvn_fs/fs-loader.c Mon Aug 26 09:45:36 2013
@@ -1184,6 +1184,16 @@ svn_fs_dir_entries(apr_hash_t **entries_
}
svn_error_t *
+svn_fs_dir_optimal_order(apr_array_header_t **ordered_p,
+ svn_fs_root_t *root,
+ apr_hash_t *entries,
+ apr_pool_t *pool)
+{
+ return svn_error_trace(root->vtable->dir_optimal_order(ordered_p, root,
+ entries, pool));
+}
+
+svn_error_t *
svn_fs_make_dir(svn_fs_root_t *root, const char *path, apr_pool_t *pool)
{
SVN_ERR(svn_fs__path_valid(path, pool));
Modified: subversion/trunk/subversion/libsvn_fs/fs-loader.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs/fs-loader.h?rev=1517479&r1=1517478&r2=1517479&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs/fs-loader.h (original)
+++ subversion/trunk/subversion/libsvn_fs/fs-loader.h Mon Aug 26 09:45:36 2013
@@ -325,6 +325,10 @@ typedef struct root_vtable_t
/* Directories */
svn_error_t *(*dir_entries)(apr_hash_t **entries_p, svn_fs_root_t *root,
const char *path, apr_pool_t *pool);
+ svn_error_t *(*dir_optimal_order)(apr_array_header_t **ordered_p,
+ svn_fs_root_t *root,
+ apr_hash_t *entries,
+ apr_pool_t *pool);
svn_error_t *(*make_dir)(svn_fs_root_t *root, const char *path,
apr_pool_t *pool);
svn_error_t *(*copy)(svn_fs_root_t *from_root, const char *from_path,
Modified: subversion/trunk/subversion/libsvn_fs_base/tree.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_base/tree.c?rev=1517479&r1=1517478&r2=1517479&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_base/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_base/tree.c Mon Aug 26 09:45:36 2013
@@ -1562,6 +1562,23 @@ base_dir_entries(apr_hash_t **table_p,
return SVN_NO_ERROR;
}
+static svn_error_t *
+base_dir_optimal_order(apr_array_header_t **ordered_p,
+ svn_fs_root_t *root,
+ apr_hash_t *entries,
+ apr_pool_t *pool)
+{
+ /* 1:1 copy of entries with no differnce in ordering */
+ apr_hash_index_t *hi;
+ apr_array_header_t *result = apr_array_make(pool, apr_hash_count(entries),
+ sizeof(svn_fs_dirent_t *));
+ for (hi = apr_hash_first(pool, entries); hi; hi = apr_hash_next(hi))
+ APR_ARRAY_PUSH(result, svn_fs_dirent_t *) = svn__apr_hash_index_val(hi);
+
+ *ordered_p = result;
+ return SVN_NO_ERROR;
+}
+
/* Merges and commits. */
@@ -5385,6 +5402,7 @@ static root_vtable_t root_vtable = {
base_change_node_prop,
base_props_changed,
base_dir_entries,
+ base_dir_optimal_order,
base_make_dir,
base_copy,
base_revision_link,
Modified: subversion/trunk/subversion/libsvn_fs_fs/caching.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/caching.c?rev=1517479&r1=1517478&r2=1517479&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/caching.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/caching.c Mon Aug 26 09:45:36 2013
@@ -116,7 +116,8 @@ read_config(svn_memcache_t **memcache_p,
*cache_txdeltas
= svn_hash__get_bool(fs->config,
SVN_FS_CONFIG_FSFS_CACHE_DELTAS,
- FALSE);
+ TRUE);
+
/* by default, cache fulltexts.
* Most SVN tools care about reconstructed file content.
* Thus, this is a reasonable default.
@@ -397,6 +398,15 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
membuffer = svn_cache__get_global_membuffer_cache();
+ /* General rules for assigning cache priorities:
+ *
+ * - Data that can be reconstructed from other elements has low prio
+ * (e.g. fulltexts, directories etc.)
+ * - Index data required to find any of the other data has high prio
+ * (e.g. noderevs)
+ * - everthing else should use default prio
+ */
+
#ifdef SVN_DEBUG_CACHE_DUMP_STATS
/* schedule printing the global access statistics upon pool cleanup,
@@ -440,7 +450,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
svn_fs_fs__dag_deserialize,
APR_HASH_KEY_STRING,
apr_pstrcat(pool, prefix, "DAG", (char *)NULL),
- 0,
+ SVN_CACHE__MEMBUFFER_LOW_PRIORITY,
fs,
no_handler,
fs->pool));
@@ -455,9 +465,9 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
1024, 8,
svn_fs_fs__serialize_dir_entries,
svn_fs_fs__deserialize_dir_entries,
- APR_HASH_KEY_STRING,
+ sizeof(pair_cache_key_t),
apr_pstrcat(pool, prefix, "DIR", (char *)NULL),
- 0,
+ SVN_CACHE__MEMBUFFER_LOW_PRIORITY,
fs,
no_handler,
fs->pool));
@@ -473,7 +483,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
sizeof(svn_revnum_t),
apr_pstrcat(pool, prefix, "PACK-MANIFEST",
(char *)NULL),
- 0,
+ SVN_CACHE__MEMBUFFER_HIGH_PRIORITY,
fs,
no_handler,
fs->pool));
@@ -487,7 +497,21 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
svn_fs_fs__deserialize_node_revision,
sizeof(pair_cache_key_t),
apr_pstrcat(pool, prefix, "NODEREVS", (char *)NULL),
- 0,
+ SVN_CACHE__MEMBUFFER_HIGH_PRIORITY,
+ fs,
+ no_handler,
+ fs->pool));
+
+ /* initialize representation header cache, if caching has been enabled */
+ SVN_ERR(create_cache(&(ffd->rep_header_cache),
+ NULL,
+ membuffer,
+ 0, 0, /* Do not use inprocess cache */
+ svn_fs_fs__serialize_rep_header,
+ svn_fs_fs__deserialize_rep_header,
+ sizeof(representation_cache_key_t),
+ apr_pstrcat(pool, prefix, "REPHEADER", (char *)NULL),
+ SVN_CACHE__MEMBUFFER_HIGH_PRIORITY,
fs,
no_handler,
fs->pool));
@@ -531,7 +555,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
sizeof(pair_cache_key_t),
apr_pstrcat(pool, prefix, "PROP",
(char *)NULL),
- 0,
+ SVN_CACHE__MEMBUFFER_LOW_PRIORITY,
fs,
no_handler,
fs->pool));
@@ -584,7 +608,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
sizeof(pair_cache_key_t),
apr_pstrcat(pool, prefix, "REVPROP",
(char *)NULL),
- 0,
+ SVN_CACHE__MEMBUFFER_HIGH_PRIORITY,
fs,
no_handler,
fs->pool));
@@ -603,7 +627,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
0, 0, /* Do not use inprocess cache */
svn_fs_fs__serialize_txdelta_window,
svn_fs_fs__deserialize_txdelta_window,
- APR_HASH_KEY_STRING,
+ sizeof(window_cache_key_t),
apr_pstrcat(pool, prefix, "TXDELTA_WINDOW",
(char *)NULL),
0,
@@ -617,7 +641,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
0, 0, /* Do not use inprocess cache */
/* Values are svn_stringbuf_t */
NULL, NULL,
- APR_HASH_KEY_STRING,
+ sizeof(window_cache_key_t),
apr_pstrcat(pool, prefix, "COMBINED_WINDOW",
(char *)NULL),
SVN_CACHE__MEMBUFFER_LOW_PRIORITY,
Modified: subversion/trunk/subversion/libsvn_fs_fs/dag.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/dag.c?rev=1517479&r1=1517478&r2=1517479&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/dag.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/dag.c Mon Aug 26 09:45:36 2013
@@ -28,11 +28,12 @@
#include "svn_props.h"
#include "svn_pools.h"
+#include "cached_data.h"
#include "dag.h"
#include "fs.h"
-#include "key-gen.h"
#include "fs_fs.h"
#include "id.h"
+#include "transaction.h"
#include "../libsvn_fs/fs-loader.h"
@@ -173,7 +174,7 @@ get_node_revision(node_revision_t **node
svn_boolean_t svn_fs_fs__dag_check_mutable(const dag_node_t *node)
{
- return (svn_fs_fs__id_txn_id(svn_fs_fs__dag_get_id(node)) != NULL);
+ return svn_fs_fs__id_is_txn(svn_fs_fs__dag_get_id(node));
}
@@ -312,8 +313,9 @@ dir_entry_id_from_node(const svn_fs_id_t
{
svn_fs_dirent_t *dirent;
- SVN_ERR(svn_fs_fs__dag_dir_entry(&dirent, parent, name, scratch_pool));
- *id_p = dirent ? svn_fs_fs__id_copy(dirent->id, result_pool) : NULL;
+ SVN_ERR(svn_fs_fs__dag_dir_entry(&dirent, parent, name, result_pool,
+ scratch_pool));
+ *id_p = dirent ? dirent->id : NULL;
return SVN_NO_ERROR;
}
@@ -332,7 +334,7 @@ set_entry(dag_node_t *parent,
const char *name,
const svn_fs_id_t *id,
svn_node_kind_t kind,
- const char *txn_id,
+ const svn_fs_fs__id_part_t *txn_id,
apr_pool_t *pool)
{
node_revision_t *parent_noderev;
@@ -359,7 +361,7 @@ make_entry(dag_node_t **child_p,
const char *parent_path,
const char *name,
svn_boolean_t is_dir,
- const char *txn_id,
+ const svn_fs_fs__id_part_t *txn_id,
apr_pool_t *pool)
{
const svn_fs_id_t *new_node_id;
@@ -432,7 +434,8 @@ svn_error_t *
svn_fs_fs__dag_dir_entry(svn_fs_dirent_t **dirent,
dag_node_t *node,
const char* name,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
node_revision_t *noderev;
SVN_ERR(get_node_revision(&noderev, node));
@@ -442,8 +445,8 @@ svn_fs_fs__dag_dir_entry(svn_fs_dirent_t
_("Can't get entries of non-directory"));
/* Get a dirent hash for this directory. */
- return svn_fs_fs__rep_contents_dir_entry(dirent, node->fs,
- noderev, name, pool, pool);
+ return svn_fs_fs__rep_contents_dir_entry(dirent, node->fs, noderev, name,
+ result_pool, scratch_pool);
}
@@ -452,7 +455,7 @@ svn_fs_fs__dag_set_entry(dag_node_t *nod
const char *entry_name,
const svn_fs_id_t *id,
svn_node_kind_t kind,
- const char *txn_id,
+ const svn_fs_fs__id_part_t *txn_id,
apr_pool_t *pool)
{
/* Check it's a directory. */
@@ -606,17 +609,31 @@ svn_fs_fs__dag_revision_root(dag_node_t
svn_revnum_t rev,
apr_pool_t *pool)
{
- svn_fs_id_t *root_id;
+ dag_node_t *new_node;
- SVN_ERR(svn_fs_fs__rev_get_root(&root_id, fs, rev, pool));
- return svn_fs_fs__dag_get_node(node_p, fs, root_id, pool);
+ /* Construct the node. */
+ new_node = apr_pcalloc(pool, sizeof(*new_node));
+ new_node->fs = fs;
+ SVN_ERR(svn_fs_fs__rev_get_root(&new_node->id, fs, rev, pool));
+
+ /* Grab the contents so we can inspect the node's kind and created path. */
+ new_node->node_pool = pool;
+
+ /* Initialize the KIND and CREATED_PATH attributes */
+ new_node->kind = svn_node_dir;
+ new_node->created_path = "/";
+ new_node->fresh_root_predecessor_id = NULL;
+
+ /* Return a fresh new node */
+ *node_p = new_node;
+ return SVN_NO_ERROR;
}
svn_error_t *
svn_fs_fs__dag_txn_root(dag_node_t **node_p,
svn_fs_t *fs,
- const char *txn_id,
+ const svn_fs_fs__id_part_t *txn_id,
apr_pool_t *pool)
{
const svn_fs_id_t *root_id, *ignored;
@@ -629,7 +646,7 @@ svn_fs_fs__dag_txn_root(dag_node_t **nod
svn_error_t *
svn_fs_fs__dag_txn_base_root(dag_node_t **node_p,
svn_fs_t *fs,
- const char *txn_id,
+ const svn_fs_fs__id_part_t *txn_id,
apr_pool_t *pool)
{
const svn_fs_id_t *base_root_id, *ignored;
@@ -644,8 +661,8 @@ svn_fs_fs__dag_clone_child(dag_node_t **
dag_node_t *parent,
const char *parent_path,
const char *name,
- const char *copy_id,
- const char *txn_id,
+ const svn_fs_fs__id_part_t *copy_id,
+ const svn_fs_fs__id_part_t *txn_id,
svn_boolean_t is_parent_copyroot,
apr_pool_t *pool)
{
@@ -718,7 +735,7 @@ svn_fs_fs__dag_clone_child(dag_node_t **
svn_error_t *
svn_fs_fs__dag_clone_root(dag_node_t **root_p,
svn_fs_t *fs,
- const char *txn_id,
+ const svn_fs_fs__id_part_t *txn_id,
apr_pool_t *pool)
{
const svn_fs_id_t *base_root_id, *root_id;
@@ -745,7 +762,7 @@ svn_fs_fs__dag_clone_root(dag_node_t **r
svn_error_t *
svn_fs_fs__dag_delete(dag_node_t *parent,
const char *name,
- const char *txn_id,
+ const svn_fs_fs__id_part_t *txn_id,
apr_pool_t *pool)
{
node_revision_t *parent_noderev;
@@ -869,7 +886,7 @@ svn_fs_fs__dag_make_file(dag_node_t **ch
dag_node_t *parent,
const char *parent_path,
const char *name,
- const char *txn_id,
+ const svn_fs_fs__id_part_t *txn_id,
apr_pool_t *pool)
{
/* Call our little helper function */
@@ -882,7 +899,7 @@ svn_fs_fs__dag_make_dir(dag_node_t **chi
dag_node_t *parent,
const char *parent_path,
const char *name,
- const char *txn_id,
+ const svn_fs_fs__id_part_t *txn_id,
apr_pool_t *pool)
{
/* Call our little helper function */
@@ -909,7 +926,7 @@ svn_fs_fs__dag_get_contents(svn_stream_t
/* Get a stream to the contents. */
SVN_ERR(svn_fs_fs__get_contents(&contents, file->fs,
- noderev, pool));
+ noderev->data_rep, pool));
*contents_p = contents;
@@ -1187,7 +1204,7 @@ svn_fs_fs__dag_copy(dag_node_t *to_node,
svn_boolean_t preserve_history,
svn_revnum_t from_rev,
const char *from_path,
- const char *txn_id,
+ const svn_fs_fs__id_part_t *txn_id,
apr_pool_t *pool)
{
const svn_fs_id_t *id;
@@ -1195,7 +1212,7 @@ svn_fs_fs__dag_copy(dag_node_t *to_node,
if (preserve_history)
{
node_revision_t *from_noderev, *to_noderev;
- const char *copy_id;
+ svn_fs_fs__id_part_t copy_id;
const svn_fs_id_t *src_id = svn_fs_fs__dag_get_id(from_node);
svn_fs_t *fs = svn_fs_fs__dag_get_fs(from_node);
@@ -1221,7 +1238,7 @@ svn_fs_fs__dag_copy(dag_node_t *to_node,
to_noderev->copyroot_path = NULL;
SVN_ERR(svn_fs_fs__create_successor(&id, fs, src_id, to_noderev,
- copy_id, txn_id, pool));
+ ©_id, txn_id, pool));
}
else /* don't preserve history */
Modified: subversion/trunk/subversion/libsvn_fs_fs/dag.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/dag.h?rev=1517479&r1=1517478&r2=1517479&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/dag.h (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/dag.h Mon Aug 26 09:45:36 2013
@@ -27,6 +27,8 @@
#include "svn_delta.h"
#include "private/svn_cache.h"
+#include "id.h"
+
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@@ -224,7 +226,7 @@ svn_error_t *svn_fs_fs__dag_revision_roo
for a transaction, call svn_fs_fs__dag_clone_root. */
svn_error_t *svn_fs_fs__dag_txn_root(dag_node_t **node_p,
svn_fs_t *fs,
- const char *txn_id,
+ const svn_fs_fs__id_part_t *txn_id,
apr_pool_t *pool);
@@ -232,7 +234,7 @@ svn_error_t *svn_fs_fs__dag_txn_root(dag
allocating from POOL. Allocate the node in TRAIL->pool. */
svn_error_t *svn_fs_fs__dag_txn_base_root(dag_node_t **node_p,
svn_fs_t *fs,
- const char *txn_id,
+ const svn_fs_fs__id_part_t *txn_id,
apr_pool_t *pool);
@@ -242,7 +244,7 @@ svn_error_t *svn_fs_fs__dag_txn_base_roo
root directory clone. Allocate *ROOT_P in POOL. */
svn_error_t *svn_fs_fs__dag_clone_root(dag_node_t **root_p,
svn_fs_t *fs,
- const char *txn_id,
+ const svn_fs_fs__id_part_t *txn_id,
apr_pool_t *pool);
@@ -272,14 +274,16 @@ svn_error_t *svn_fs_fs__dag_dir_entries(
/* Fetches the NODE's entries and returns a copy of the entry selected
by the key value given in NAME and set *DIRENT to a copy of that
- entry. If such entry was found, the copy will be allocated in POOL.
+ entry. If such entry was found, the copy will be allocated in
+ RESULT_POOL. Temporary data will be used in SCRATCH_POOL.
Otherwise, the *DIRENT will be set to NULL.
*/
/* ### This function is currently only called from dag.c. */
svn_error_t * svn_fs_fs__dag_dir_entry(svn_fs_dirent_t **dirent,
dag_node_t *node,
const char* name,
- apr_pool_t *pool);
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/* Set ENTRY_NAME in NODE to point to ID (with kind KIND), allocating
from POOL. NODE must be a mutable directory. ID can refer to a
@@ -294,7 +298,7 @@ svn_error_t *svn_fs_fs__dag_set_entry(da
const char *entry_name,
const svn_fs_id_t *id,
svn_node_kind_t kind,
- const char *txn_id,
+ const svn_fs_fs__id_part_t *txn_id,
apr_pool_t *pool);
@@ -321,8 +325,8 @@ svn_error_t *svn_fs_fs__dag_clone_child(
dag_node_t *parent,
const char *parent_path,
const char *name,
- const char *copy_id,
- const char *txn_id,
+ const svn_fs_fs__id_part_t *copy_id,
+ const svn_fs_fs__id_part_t *txn_id,
svn_boolean_t is_parent_copyroot,
apr_pool_t *pool);
@@ -341,7 +345,7 @@ svn_error_t *svn_fs_fs__dag_clone_child(
*/
svn_error_t *svn_fs_fs__dag_delete(dag_node_t *parent,
const char *name,
- const char *txn_id,
+ const svn_fs_fs__id_part_t *txn_id,
apr_pool_t *pool);
@@ -384,7 +388,7 @@ svn_error_t *svn_fs_fs__dag_make_dir(dag
dag_node_t *parent,
const char *parent_path,
const char *name,
- const char *txn_id,
+ const svn_fs_fs__id_part_t *txn_id,
apr_pool_t *pool);
@@ -495,7 +499,7 @@ svn_error_t *svn_fs_fs__dag_make_file(da
dag_node_t *parent,
const char *parent_path,
const char *name,
- const char *txn_id,
+ const svn_fs_fs__id_part_t *txn_id,
apr_pool_t *pool);
@@ -522,7 +526,7 @@ svn_error_t *svn_fs_fs__dag_copy(dag_nod
svn_boolean_t preserve_history,
svn_revnum_t from_rev,
const char *from_path,
- const char *txn_id,
+ const svn_fs_fs__id_part_t *txn_id,
apr_pool_t *pool);
Modified: subversion/trunk/subversion/libsvn_fs_fs/fs.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs.c?rev=1517479&r1=1517478&r2=1517479&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs.c Mon Aug 26 09:45:36 2013
@@ -37,8 +37,14 @@
#include "fs_fs.h"
#include "tree.h"
#include "lock.h"
+#include "hotcopy.h"
#include "id.h"
+#include "pack.h"
+#include "recovery.h"
#include "rep-cache.h"
+#include "revprops.h"
+#include "transaction.h"
+#include "verify.h"
#include "svn_private_config.h"
#include "private/svn_fs_util.h"
@@ -185,7 +191,7 @@ fs_info(const void **fsfs_info,
static fs_vtable_t fs_vtable = {
svn_fs_fs__youngest_rev,
svn_fs_fs__revision_prop,
- svn_fs_fs__revision_proplist,
+ svn_fs_fs__get_revision_proplist,
svn_fs_fs__change_rev_prop,
svn_fs_fs__set_uuid,
svn_fs_fs__revision_root,
Modified: subversion/trunk/subversion/libsvn_fs_fs/fs.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs.h?rev=1517479&r1=1517478&r2=1517479&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs.h (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs.h Mon Aug 26 09:45:36 2013
@@ -26,6 +26,8 @@
#include <apr_pools.h>
#include <apr_hash.h>
#include <apr_network_io.h>
+#include <apr_md5.h>
+#include <apr_sha1.h>
#include "svn_fs.h"
#include "svn_config.h"
@@ -36,6 +38,8 @@
#include "private/svn_mutex.h"
#include "private/svn_named_atomic.h"
+#include "id.h"
+
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@@ -157,13 +161,8 @@ typedef struct fs_fs_shared_txn_data_t
transaction. */
struct fs_fs_shared_txn_data_t *next;
- /* This transaction's ID. For repositories whose format is less
- than SVN_FS_FS__MIN_TXN_CURRENT_FORMAT, the ID is in the form
- <rev>-<uniqueifier>, where <uniqueifier> runs from 0-99999 (see
- create_txn_dir_pre_1_5() in fs_fs.c). For newer repositories,
- the form is <rev>-<200 digit base 36 number> (see
- create_txn_dir() in fs_fs.c). */
- char txn_id[SVN_FS__TXN_MAX_LEN+1];
+ /* ID of this transaction. */
+ svn_fs_fs__id_part_t txn_id;
/* Whether the transaction's prototype revision file is locked for
writing by any thread in this process (including the current
@@ -224,7 +223,7 @@ typedef struct fs_fs_dag_cache_t fs_fs_d
/* Key type for all caches that use revision + offset / counter as key.
NOTE: always initialize this using calloc() or '= {0};'! This is used
- as a cahe key and the padding bytes on 32 bit archs should be zero for
+ as a cache key and the padding bytes on 32 bit archs should be zero for
cache effectiveness. */
typedef struct pair_cache_key_t
{
@@ -233,6 +232,32 @@ typedef struct pair_cache_key_t
apr_int64_t second;
} pair_cache_key_t;
+/* Key type that identifies a representation / rep header. */
+typedef struct representation_cache_key_t
+{
+ /* Revision that contains the representation */
+ apr_uint32_t revision;
+
+ /* Packed or non-packed representation? */
+ svn_boolean_t is_packed;
+
+ /* Item offset of the representation */
+ apr_uint64_t offset;
+} representation_cache_key_t;
+
+/* Key type that identifies a txdelta window. */
+typedef struct window_cache_key_t
+{
+ /* Revision that contains the representation */
+ apr_uint32_t revision;
+
+ /* Window number within that representation */
+ apr_int32_t chunk_index;
+
+ /* Offset of the representation within REVISION */
+ apr_uint64_t offset;
+} window_cache_key_t;
+
/* Private (non-shared) FSFS-specific data for each svn_fs_t object.
Any caches in here may be NULL. */
typedef struct fs_fs_data_t
@@ -297,11 +322,11 @@ typedef struct fs_fs_data_t
respective pack file. */
svn_cache__t *packed_offset_cache;
- /* Cache for txdelta_window_t objects; the key is (revFilePath, offset) */
+ /* Cache for txdelta_window_t objects; the key is window_cache_key_t */
svn_cache__t *txdelta_window_cache;
/* Cache for combined windows as svn_stringbuf_t objects;
- the key is (revFilePath, offset) */
+ the key is window_cache_key_t */
svn_cache__t *combined_window_cache;
/* Cache for node_revision_t objects; the key is (revision, id offset) */
@@ -311,6 +336,10 @@ typedef struct fs_fs_data_t
is the revision */
svn_cache__t *changes_cache;
+ /* Cache for svn_fs_fs__rep_header_t objects; the key is a
+ (revision, is_packed, offset) set */
+ svn_cache__t *rep_header_cache;
+
/* Cache for svn_mergeinfo_t objects; the key is a combination of
revision, inheritance flags and path. */
svn_cache__t *mergeinfo_cache;
@@ -399,26 +428,26 @@ typedef struct transaction_t
* svn_fs_fs__rep_copy. */
typedef struct representation_t
{
- /* Checksums for the contents produced by this representation.
+ /* Checksums digests for the contents produced by this representation.
This checksum is for the contents the rep shows to consumers,
regardless of how the rep stores the data under the hood. It is
independent of the storage (fulltext, delta, whatever).
- If checksum is NULL, then for compatibility behave as though this
+ If has_sha1 is FALSE, then for compatibility behave as though this
checksum matches the expected checksum.
The md5 checksum is always filled, unless this is rep which was
retrieved from the rep-cache. The sha1 checksum is only computed on
- a write, for use with rep-sharing; it may be read from an existing
- representation, but otherwise it is NULL. */
- svn_checksum_t *md5_checksum;
- svn_checksum_t *sha1_checksum;
+ a write, for use with rep-sharing. */
+ svn_boolean_t has_sha1;
+ unsigned char sha1_digest[APR_SHA1_DIGESTSIZE];
+ unsigned char md5_digest[APR_MD5_DIGESTSIZE];
/* Revision where this representation is located. */
svn_revnum_t revision;
/* Offset into the revision file where it is located. */
- apr_off_t offset;
+ svn_filesize_t offset;
/* The size of the representation in bytes as seen in the revision
file. */
@@ -428,17 +457,21 @@ typedef struct representation_t
* the fulltext size is equal to representation size in the rev file, */
svn_filesize_t expanded_size;
- /* Is this representation a transaction? */
- const char *txn_id;
+ /* Is this a representation (still) within a transaction? */
+ svn_fs_fs__id_part_t txn_id;
/* For rep-sharing, we need a way of uniquifying node-revs which share the
same representation (see svn_fs_fs__noderev_same_rep_key() ). So, we
store the original txn of the node rev (not the rep!), along with some
- intra-node uniqification content.
-
- May be NULL, in which case, it is considered to match other NULL
- values.*/
- const char *uniquifier;
+ intra-node uniqification content. */
+ struct
+ {
+ /* unique context, i.e. txn ID, in which the noderev (!) got created */
+ svn_fs_fs__id_part_t noderev_txn_id;
+
+ /* unique value within that txn */
+ apr_uint64_t number;
+ } uniquifier;
} representation_t;
@@ -498,25 +531,10 @@ typedef struct node_revision_t
typedef struct change_t
{
/* Path of the change. */
- const char *path;
-
- /* Node revision ID of the change. */
- const svn_fs_id_t *noderev_id;
-
- /* The kind of change. */
- svn_fs_path_change_kind_t kind;
-
- /* Text or property mods? */
- svn_boolean_t text_mod;
- svn_boolean_t prop_mod;
-
- /* Node kind (possibly svn_node_unknown). */
- svn_node_kind_t node_kind;
-
- /* Copyfrom revision and path. */
- svn_revnum_t copyfrom_rev;
- const char * copyfrom_path;
+ svn_string_t path;
+ /* API compatible change description */
+ svn_fs_path_change2_t info;
} change_t;