Author: stefan2
Date: Tue Dec 16 15:38:47 2014
New Revision: 1645983
URL: http://svn.apache.org/r1645983
Log:
On the fsx-id branch: Remove redundant svn_fs_t parameter from a function.
All callers of svn_fs_x__put_node_revision always passed NODEREV->ID as ID.
* subversion/libsvn_fs_x/transaction.h
(svn_fs_x__put_node_revision): Remove ID parameter.
* subversion/libsvn_fs_x/transaction.c
(svn_fs_x__put_node_revision): Instead of the full ID, use the noderev's
ID part everywhere, including the error
message.
(create_new_txn_noderev_from_rev,
svn_fs_x__create_node,
svn_fs_x__set_entry,
rep_write_contents_close,
svn_fs_x__create_successor,
svn_fs_x__set_proplist): Update callers.
* subversion/libsvn_fs_x/dag.c
(svn_fs_x__dag_increment_mergeinfo_count,
svn_fs_x__dag_set_has_mergeinfo,
svn_fs_x__dag_update_ancestry): Same.
Modified:
subversion/branches/fsx-id/subversion/libsvn_fs_x/dag.c
subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.c
subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.h
Modified: subversion/branches/fsx-id/subversion/libsvn_fs_x/dag.c
URL:
http://svn.apache.org/viewvc/subversion/branches/fsx-id/subversion/libsvn_fs_x/dag.c?rev=1645983&r1=1645982&r2=1645983&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/dag.c (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/dag.c Tue Dec 16 15:38:47
2014
@@ -621,8 +621,7 @@ svn_fs_x__dag_increment_mergeinfo_count(
}
/* Flush it out. */
- return svn_fs_x__put_node_revision(node->fs, noderev->id,
- noderev, FALSE, pool);
+ return svn_fs_x__put_node_revision(node->fs, noderev, FALSE, pool);
}
svn_error_t *
@@ -648,8 +647,7 @@ svn_fs_x__dag_set_has_mergeinfo(dag_node
noderev->has_mergeinfo = has_mergeinfo;
/* Flush it out. */
- return svn_fs_x__put_node_revision(node->fs, noderev->id,
- noderev, FALSE, pool);
+ return svn_fs_x__put_node_revision(node->fs, noderev, FALSE, pool);
}
@@ -1395,6 +1393,6 @@ svn_fs_x__dag_update_ancestry(dag_node_t
if (target_noderev->predecessor_count != -1)
target_noderev->predecessor_count++;
- return svn_fs_x__put_node_revision(target->fs, target_noderev->id,
- target_noderev, FALSE, pool);
+ return svn_fs_x__put_node_revision(target->fs, target_noderev, FALSE,
+ pool);
}
Modified: subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.c
URL:
http://svn.apache.org/viewvc/subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.c?rev=1645983&r1=1645982&r2=1645983&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.c (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.c Tue Dec 16
15:38:47 2014
@@ -746,23 +746,22 @@ purge_shared_txn(svn_fs_t *fs,
svn_error_t *
svn_fs_x__put_node_revision(svn_fs_t *fs,
- const svn_fs_id_t *id,
node_revision_t *noderev,
svn_boolean_t fresh_txn_root,
apr_pool_t *pool)
{
apr_file_t *noderev_file;
- const svn_fs_x__noderev_id_t *noderev_id = svn_fs_x__id_noderev_id(id);
+ const svn_fs_x__noderev_id_t *id = &noderev->noderev_id;
noderev->is_fresh_txn_root = fresh_txn_root;
- if (! svn_fs_x__id_is_txn(id))
+ if (! svn_fs_x__is_txn(id->change_set))
return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
_("Attempted to write to non-transaction '%s'"),
- svn_fs_x__id_unparse(id, pool)->data);
+ svn_fs_x__id_part_unparse(id, pool)->data);
SVN_ERR(svn_io_file_open(&noderev_file,
- svn_fs_x__path_txn_node_rev(fs, noderev_id, pool),
+ svn_fs_x__path_txn_node_rev(fs, id, pool),
APR_WRITE | APR_CREATE | APR_TRUNCATE
| APR_BUFFERED, APR_OS_DEFAULT, pool));
@@ -1178,7 +1177,7 @@ create_new_txn_noderev_from_rev(svn_fs_t
noderev->id = svn_fs_x__id_txn_create_root(txn_id, pool);
noderev->noderev_id = *svn_fs_x__id_noderev_id(noderev->id);
- return svn_fs_x__put_node_revision(fs, noderev->id, noderev, TRUE, pool);
+ return svn_fs_x__put_node_revision(fs, noderev, TRUE, pool);
}
/* A structure used by get_and_increment_txn_key_body(). */
@@ -1648,7 +1647,7 @@ svn_fs_x__create_node(const svn_fs_id_t
noderev->node_id = node_id;
noderev->noderev_id = *svn_fs_x__id_noderev_id(id);
- SVN_ERR(svn_fs_x__put_node_revision(fs, noderev->id, noderev, FALSE, pool));
+ SVN_ERR(svn_fs_x__put_node_revision(fs, noderev, FALSE, pool));
*id_p = id;
@@ -1736,8 +1735,7 @@ svn_fs_x__set_entry(svn_fs_t *fs,
rep->id.change_set = svn_fs_x__change_set_by_txn(txn_id);
rep->id.number = SVN_FS_X__ITEM_INDEX_UNUSED;
parent_noderev->data_rep = rep;
- SVN_ERR(svn_fs_x__put_node_revision(fs, parent_noderev->id,
- parent_noderev, FALSE, pool));
+ SVN_ERR(svn_fs_x__put_node_revision(fs, parent_noderev, FALSE, pool));
}
else
{
@@ -2390,8 +2388,8 @@ rep_write_contents_close(void *baton)
apr_pool_cleanup_kill(b->scratch_pool, b, rep_write_cleanup);
/* Write out the new node-rev information. */
- SVN_ERR(svn_fs_x__put_node_revision(b->fs, b->noderev->id, b->noderev,
- FALSE, b->scratch_pool));
+ SVN_ERR(svn_fs_x__put_node_revision(b->fs, b->noderev, FALSE,
+ b->scratch_pool));
if (!old_rep)
{
svn_fs_x__p2l_entry_t entry;
@@ -2491,8 +2489,7 @@ svn_fs_x__create_successor(const svn_fs_
= svn_fs_x__get_revnum(new_noderev->noderev_id.change_set);
}
- SVN_ERR(svn_fs_x__put_node_revision(fs, new_noderev->id, new_noderev, FALSE,
- pool));
+ SVN_ERR(svn_fs_x__put_node_revision(fs, new_noderev, FALSE, pool));
*new_id_p = id;
@@ -2528,8 +2525,7 @@ svn_fs_x__set_proplist(svn_fs_t *fs,
noderev->prop_rep->id.change_set = id->change_set;
SVN_ERR(allocate_item_index(&noderev->prop_rep->id.number, fs,
txn_id, pool));
- SVN_ERR(svn_fs_x__put_node_revision(fs, noderev->id, noderev, FALSE,
- pool));
+ SVN_ERR(svn_fs_x__put_node_revision(fs, noderev, FALSE, pool));
}
return SVN_NO_ERROR;
Modified: subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.h
URL:
http://svn.apache.org/viewvc/subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.h?rev=1645983&r1=1645982&r2=1645983&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.h (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.h Tue Dec 16
15:38:47 2014
@@ -72,12 +72,11 @@ svn_fs_x__with_all_locks(svn_fs_t *fs,
void *baton,
apr_pool_t *pool);
-/* Store NODEREV as the node-revision for the node whose id is ID in
- FS, after setting its is_fresh_txn_root to FRESH_TXN_ROOT. Do any
- necessary temporary allocation in POOL. */
+/* Store NODEREV as the node-revision in the transaction defined by NODEREV's
+ ID within FS, after setting its is_fresh_txn_root to FRESH_TXN_ROOT. Do
+ any necessary temporary allocation in POOL. */
svn_error_t *
svn_fs_x__put_node_revision(svn_fs_t *fs,
- const svn_fs_id_t *id,
node_revision_t *noderev,
svn_boolean_t fresh_txn_root,
apr_pool_t *pool);