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/01/11 21:22:31 UTC

svn commit: r1650960 [2/2] - in /subversion/trunk/subversion/libsvn_fs_x: transaction.c transaction.h

Modified: subversion/trunk/subversion/libsvn_fs_x/transaction.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/transaction.h?rev=1650960&r1=1650959&r2=1650960&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/transaction.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/transaction.h Sun Jan 11 20:22:30 2015
@@ -30,65 +30,66 @@
 svn_fs_x__txn_id_t
 svn_fs_x__txn_get_id(svn_fs_txn_t *txn);
 
-/* Obtain a write lock on the filesystem FS in a subpool of POOL, call
-   BODY with BATON and that subpool, destroy the subpool (releasing the write
-   lock) and return what BODY returned. */
+/* Obtain a write lock on the filesystem FS in a subpool of SCRATCH_POOL,
+   call BODY with BATON and that subpool, destroy the subpool (releasing the
+   write lock) and return what BODY returned. */
 svn_error_t *
 svn_fs_x__with_write_lock(svn_fs_t *fs,
                           svn_error_t *(*body)(void *baton,
-                                               apr_pool_t *pool),
+                                               apr_pool_t *scratch_pool),
                           void *baton,
-                          apr_pool_t *pool);
+                          apr_pool_t *scratch_pool);
 
-/* Obtain a pack operation lock on the filesystem FS in a subpool of POOL,
-   call BODY with BATON and that subpool, destroy the subpool (releasing the
-   write lock) and return what BODY returned. */
+/* Obtain a pack operation lock on the filesystem FS in a subpool of
+   SCRATCH_POOL, call BODY with BATON and that subpool, destroy the subpool
+   (releasing the write lock) and return what BODY returned. */
 svn_error_t *
 svn_fs_x__with_pack_lock(svn_fs_t *fs,
                          svn_error_t *(*body)(void *baton,
-                                              apr_pool_t *pool),
+                                              apr_pool_t *scratch_pool),
                          void *baton,
-                         apr_pool_t *pool);
+                         apr_pool_t *scratch_pool);
 
-/* Run BODY (with BATON and POOL) while the txn-current file
-   of FS is locked. */
+/* Obtain the txn-current file lock on the filesystem FS in a subpool of
+   SCRATCH_POOL, call BODY with BATON and that subpool, destroy the subpool
+   (releasing the write lock) and return what BODY returned. */
 svn_error_t *
 svn_fs_x__with_txn_current_lock(svn_fs_t *fs,
                                 svn_error_t *(*body)(void *baton,
-                                                     apr_pool_t *pool),
+                                                   apr_pool_t *scratch_pool),
                                 void *baton,
-                                apr_pool_t *pool);
+                                apr_pool_t *scratch_pool);
 
-/* Obtain all locks on the filesystem FS in a subpool of POOL, call BODY
-   with BATON and that subpool, destroy the subpool (releasing the locks)
-   and return what BODY returned.
+/* Obtain all locks on the filesystem FS in a subpool of SCRATCH_POOL,
+   call BODY with BATON and that subpool, destroy the subpool (releasing
+   the locks) and return what BODY returned.
 
    This combines svn_fs_fs__with_write_lock, svn_fs_fs__with_pack_lock,
    and svn_fs_fs__with_txn_current_lock, ensuring correct lock ordering. */
 svn_error_t *
 svn_fs_x__with_all_locks(svn_fs_t *fs,
                          svn_error_t *(*body)(void *baton,
-                                              apr_pool_t *pool),
+                                              apr_pool_t *scratch_pool),
                          void *baton,
-                         apr_pool_t *pool);
+                         apr_pool_t *scratch_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. */
+   any necessary temporary allocation in SCRATCH_POOL. */
 svn_error_t *
 svn_fs_x__put_node_revision(svn_fs_t *fs,
                             svn_fs_x__noderev_t *noderev,
                             svn_boolean_t fresh_txn_root,
-                            apr_pool_t *pool);
+                            apr_pool_t *scratch_pool);
 
 /* Find the paths which were changed in transaction TXN_ID of
    filesystem FS and store them in *CHANGED_PATHS_P.
-   Get any temporary allocations from POOL. */
+   Get any temporary allocations from SCRATCH_POOL. */
 svn_error_t *
 svn_fs_x__txn_changes_fetch(apr_hash_t **changed_paths_p,
                             svn_fs_t *fs,
                             svn_fs_x__txn_id_t txn_id,
-                            apr_pool_t *pool);
+                            apr_pool_t *scratch_pool);
 
 /* Create a new transaction in filesystem FS, based on revision REV,
    and store it in *TXN_P.  Allocate all necessary variables from
@@ -100,19 +101,19 @@ svn_fs_x__create_txn(svn_fs_txn_t **txn_
                      apr_pool_t *pool);
 
 /* Set the transaction property NAME to the value VALUE in transaction
-   TXN.  Perform temporary allocations from POOL. */
+   TXN.  Perform temporary allocations from SCRATCH_POOL. */
 svn_error_t *
 svn_fs_x__change_txn_prop(svn_fs_txn_t *txn,
                           const char *name,
                           const svn_string_t *value,
-                          apr_pool_t *pool);
+                          apr_pool_t *scratch_pool);
 
 /* Change transaction properties in transaction TXN based on PROPS.
-   Perform temporary allocations from POOL. */
+   Perform temporary allocations from SCRATCH_POOL. */
 svn_error_t *
 svn_fs_x__change_txn_props(svn_fs_txn_t *txn,
                            const apr_array_header_t *props,
-                           apr_pool_t *pool);
+                           apr_pool_t *scratch_pool);
 
 /* Store a transaction record in *TXN_P for the transaction identified
    by TXN_ID in filesystem FS.  Allocate everything from POOL. */
@@ -123,12 +124,12 @@ svn_fs_x__get_txn(svn_fs_x__transaction_
                   apr_pool_t *pool);
 
 /* Return the next available copy_id in *COPY_ID for the transaction
-   TXN_ID in filesystem FS.  Allocate space in POOL. */
+   TXN_ID in filesystem FS.  Allocate temporaries in SCRATCH_POOL. */
 svn_error_t *
 svn_fs_x__reserve_copy_id(svn_fs_x__id_t *copy_id_p,
                           svn_fs_t *fs,
                           svn_fs_x__txn_id_t txn_id,
-                          apr_pool_t *pool);
+                          apr_pool_t *scratch_pool);
 
 /* Create an entirely new mutable node in the filesystem FS, whose
    node-revision is NODEREV.  COPY_ID is the copy_id to use in the
@@ -139,24 +140,24 @@ svn_fs_x__create_node(svn_fs_t *fs,
                       svn_fs_x__noderev_t *noderev,
                       const svn_fs_x__id_t *copy_id,
                       svn_fs_x__txn_id_t txn_id,
-                      apr_pool_t *pool);
+                      apr_pool_t *scratch_pool);
 
 /* Remove all references to the transaction TXN_ID from filesystem FS.
-   Temporary allocations are from POOL. */
+   Temporary allocations are from SCRATCH_POOL. */
 svn_error_t *
 svn_fs_x__purge_txn(svn_fs_t *fs,
                     const char *txn_id,
-                    apr_pool_t *pool);
+                    apr_pool_t *scratch_pool);
 
 /* Abort the existing transaction TXN, performing any temporary
-   allocations in POOL. */
+   allocations in SCRATCH_POOL. */
 svn_error_t *
 svn_fs_x__abort_txn(svn_fs_txn_t *txn,
-                    apr_pool_t *pool);
+                    apr_pool_t *scratch_pool);
 
 /* Add or set in filesystem FS, transaction TXN_ID, in directory
    PARENT_NODEREV a directory entry for NAME pointing to ID of type
-   KIND.  Allocations are done in POOL. */
+   KIND.  Temporary allocations are done in SCRATCH_POOL. */
 svn_error_t *
 svn_fs_x__set_entry(svn_fs_t *fs,
                     svn_fs_x__txn_id_t txn_id,
@@ -164,7 +165,7 @@ svn_fs_x__set_entry(svn_fs_t *fs,
                     const char *name,
                     const svn_fs_x__id_t *id,
                     svn_node_kind_t kind,
-                    apr_pool_t *pool);
+                    apr_pool_t *scratch_pool);
 
 /* Add a change to the changes record for filesystem FS in transaction
    TXN_ID.  Mark path PATH, having noderev-id ID, as changed according to
@@ -173,7 +174,7 @@ svn_fs_x__set_entry(svn_fs_t *fs,
    If this change was the result of a copy, set COPYFROM_REV and
    COPYFROM_PATH to the revision and path of the copy source, otherwise
    they should be set to SVN_INVALID_REVNUM and NULL.  Perform any
-   temporary allocations from POOL. */
+   temporary allocations from SCRATCH_POOL. */
 svn_error_t *
 svn_fs_x__add_change(svn_fs_t *fs,
                      svn_fs_x__txn_id_t txn_id,
@@ -186,7 +187,7 @@ svn_fs_x__add_change(svn_fs_t *fs,
                      svn_node_kind_t node_kind,
                      svn_revnum_t copyfrom_rev,
                      const char *copyfrom_path,
-                     apr_pool_t *pool);
+                     apr_pool_t *scratch_pool);
 
 /* Return a writable stream in *STREAM that allows storing the text
    representation of node-revision NODEREV in filesystem FS.
@@ -198,7 +199,7 @@ svn_fs_x__set_contents(svn_stream_t **st
                        apr_pool_t *pool);
 
 /* Create a node revision in FS which is an immediate successor of
-   NEW_NODEREV's predecessor.  Use POOL for any temporary allocation.
+   NEW_NODEREV's predecessor.  Use SCRATCH_POOL for any temporary allocation.
 
    COPY_ID, is a key into the `copies' table, and
    indicates that this new node is being created as the result of a
@@ -214,37 +215,37 @@ svn_fs_x__create_successor(svn_fs_t *fs,
                            svn_fs_x__noderev_t *new_noderev,
                            const svn_fs_x__id_t *copy_id,
                            svn_fs_x__txn_id_t txn_id,
-                           apr_pool_t *pool);
+                           apr_pool_t *scratch_pool);
 
 /* Write a new property list PROPLIST for node-revision NODEREV in
-   filesystem FS.  Perform any temporary allocations in POOL. */
+   filesystem FS.  Perform any temporary allocations in SCRATCH_POOL. */
 svn_error_t *
 svn_fs_x__set_proplist(svn_fs_t *fs,
                        svn_fs_x__noderev_t *noderev,
                        apr_hash_t *proplist,
-                       apr_pool_t *pool);
+                       apr_pool_t *scratch_pool);
 
 /* Append the L2P and P2L indexes given by their proto index file names
  * L2P_PROTO_INDEX and P2L_PROTO_INDEX to the revision / pack FILE.
  * The latter contains revision(s) starting at REVISION in FS.
- * Use POOL for temporary allocations.  */
+ * Use SCRATCH_POOL for temporary allocations.  */
 svn_error_t *
 svn_fs_x__add_index_data(svn_fs_t *fs,
                          apr_file_t *file,
                          const char *l2p_proto_index,
                          const char *p2l_proto_index,
                          svn_revnum_t revision,
-                         apr_pool_t *pool);
+                         apr_pool_t *scratch_pool);
 
 /* Commit the transaction TXN in filesystem FS and return its new
    revision number in *REV.  If the transaction is out of date, return
-   the error SVN_ERR_FS_TXN_OUT_OF_DATE. Use POOL for temporary
+   the error SVN_ERR_FS_TXN_OUT_OF_DATE. Use SCRATCH_POOL for temporary
    allocations. */
 svn_error_t *
 svn_fs_x__commit(svn_revnum_t *new_rev_p,
                  svn_fs_t *fs,
                  svn_fs_txn_t *txn,
-                 apr_pool_t *pool);
+                 apr_pool_t *scratch_pool);
 
 /* Set *NAMES_P to an array of names which are all the active
    transactions in filesystem FS.  Allocate the array from POOL. */
@@ -272,29 +273,26 @@ svn_fs_x__txn_proplist(apr_hash_t **tabl
 
 /* Delete the mutable node-revision referenced by ID, along with any
    mutable props or directory contents associated with it.  Perform
-   temporary allocations in POOL. */
+   temporary allocations in SCRATCH_POOL. */
 svn_error_t *
 svn_fs_x__delete_node_revision(svn_fs_t *fs,
                                const svn_fs_x__id_t *id,
-                               apr_pool_t *pool);
+                               apr_pool_t *scratch_pool);
 
-/* Retrieve information about the Subversion transaction SVN_TXN from
-   the `transactions' table of FS, allocating from POOL.  Set
-   *BASE_ROOT_ID_P to the ID of the root directory of the
-   transaction's base revision.
+/* Retrieve information about the Subversion transaction TXN_ID from
+   the `transactions' table of FS, using SCRATCH_POOL for temporary
+   allocations.  Set *RENUM to the transaction's base revision.
 
    If there is no such transaction, SVN_ERR_FS_NO_SUCH_TRANSACTION is
    the error returned.
 
    Returns SVN_ERR_FS_TRANSACTION_NOT_MUTABLE if TXN_NAME refers to a
-   transaction that has already been committed.
-
-   Allocate *ROOT_ID_P and *BASE_ROOT_ID_P in POOL.  */
+   transaction that has already been committed.  */
 svn_error_t *
 svn_fs_x__get_base_rev(svn_revnum_t *revnum,
                        svn_fs_t *fs,
                        svn_fs_x__txn_id_t txn_id,
-                       apr_pool_t *pool);
+                       apr_pool_t *scratch_pool);
 
 /* Find the value of the property named PROPNAME in transaction TXN.
    Return the contents in *VALUE_P.  The contents will be allocated