Checkout
stefan2
committed
on 11 Feb 14
For TXN IDs in FSX, use a single integer instead of a two-part struct.
This allows for packing the TXN ID into the same struct that holds
th… Show more
For TXN IDs in FSX, use a single integer instead of a two-part struct.

This allows for packing the TXN ID into the same struct that holds

the revision info for committed data.

Most of this commit is code churn replacing (pointers to) structs with

the new integer value.  Similarly, NULL values cannot be used anymore

and must be replaced by the new SVN_FS_X__INVALID_TXN_ID constant.

* subversion/libsvn_fs_x/id.h

 (svn_fs_x__txn_id_t): Define the new data type for TXN IDs.

 (SVN_FS_X__INVALID_TXN_ID): Define the corresponding NULL constant.

 (svn_fs_x__id_txn_parse,

  svn_fs_x__id_txn_unparse): Drop.  These will be replaced by new

                             private API functions in utils.h

 (svn_fs_x__id_txn_used,

  svn_fs_x__id_txn_reset,

  svn_fs_x__txn_id_t svn_fs_x__id_txn_id,

  svn_fs_x__id_txn_create_root,

  svn_fs_x__id_txn_create): Switch TXN_ID type in these APIs

                            from struct to integer type.

* subversion/libsvn_fs_x/id.c

 (fs_x__id_t): Use the new data type to store the TXN_ID member.

 (txn_id_parse): Simplify calling the new utils API function.

 (svn_fs_x__id_txn_used,

  svn_fs_x__id_txn_reset): Update function signature and "no value" handling.

 (svn_fs_x__id_txn_parse,

  svn_fs_x__id_txn_unparse): Drop.

 (svn_fs_x__id_txn_id,

  svn_fs_x__id_is_txn): Update function signatures and TXN_ID references.

 (svn_fs_x__id_unparse): Update serializer to write the TXN_ID as a single

                         value instead of a value pair.

 (svn_fs_x__id_eq): The struct has become smaller.

 (svn_fs_x__id_check_related): TXN_ID-based checks are now simple.

 (svn_fs_x__id_txn_create_root,

  svn_fs_id_t *svn_fs_x__id_create_root): Update function signatures and

                                          TXN_ID references.

 (svn_fs_x__id_create_root,

  svn_fs_x__id_rev_create,

  svn_fs_x__id_parse): Update TXN_ID references and "no value" handling.

* subversion/libsvn_fs_x/util.h

 (svn_fs_x__txn_name,

  svn_fs_x__txn_by_name): Declare new utility API functions that

                          convert TXN IDs from / to string.

 (svn_fs_x__path_txn_dir,

  svn_fs_x__path_txn_sha1,

  svn_fs_x__path_txn_changes,

  svn_fs_x__path_l2p_proto_index,

  svn_fs_x__path_p2l_proto_index,

  svn_fs_x__path_txn_props,

  svn_fs_x__path_txn_props_final,

  svn_fs_x__path_txn_next_ids,

  svn_fs_x__path_txn_item_index,

  svn_fs_x__path_txn_proto_rev,

  svn_fs_x__path_txn_proto_rev_lock): Switch TXN_ID type in these APIs

                                      from struct to integer type.

* subversion/libsvn_fs_x/util.c

 (svn_fs_x__txn_name,

  svn_fs_x__txn_by_name): Implement these new conversion functions using

                          out base36 converters.

 (combine_txn_id_string): Call the new TXN_ID -> string conversion API.

 (svn_fs_x__path_txn_dir,

  svn_fs_x__path_txn_sha1,

  svn_fs_x__path_txn_changes,

  svn_fs_x__path_l2p_proto_index,

  svn_fs_x__path_p2l_proto_index,

  svn_fs_x__path_txn_props,

  svn_fs_x__path_txn_props_final,

  svn_fs_x__path_txn_next_ids,

  svn_fs_x__path_txn_item_index,

  svn_fs_x__path_txn_proto_rev,

  svn_fs_x__path_txn_proto_rev_lock): Switch TXN_ID types in function

                                      signatures.

* subversion/libsvn_fs_x/cached_data.c

 (open_and_seek_revision,

  open_and_seek_transaction,

  open_and_seek_representation,

  get_node_revision_body,

  svn_fs_x__get_mergeinfo_count,

  create_rep_state_body,

  build_rep_list,

  auto_set_start_offset,

  get_dir_contents,

  svn_fs_x__get_proplist,

  svn_fs_x__get_changes,

  block_read): Update function callers to use numbers instead of

               pointers for txn_ids.

* subversion/libsvn_fs_x/verify.c

 (compare_l2p_to_p2l_index,

  compare_p2l_to_l2p_index): Ditto.

* subversion/libsvn_fs_x/changes.c

 (binary_change_t): Document mapping of TXN_IDs onto ID part structs.

 (append_change,

  svn_fs_x__changes_get_list,

  svn_fs_x__changes_get_list_func): Change storage and retrieval of

                                    TXN IDs accordingly.

* subversion/libsvn_fs_x/dag.h

 (svn_fs_x__dag_set_entry,

  svn_fs_x__dag_txn_root,

  svn_fs_x__dag_txn_base_root,

  svn_fs_x__dag_clone_child,

  svn_fs_x__dag_clone_root,

  svn_fs_x__dag_delete,

  svn_fs_x__dag_make_file,

  svn_fs_x__dag_make_dir,

  svn_fs_x__dag_copy):

  svn_fs_x__path_txn_proto_rev_lock): Switch TXN_ID type in these APIs

                                      from struct to integer type.

* subversion/libsvn_fs_x/dag.c

 (set_entry,

  make_entry,

  svn_fs_x__dag_set_entry,

  svn_fs_x__dag_txn_root,

  svn_fs_x__dag_txn_base_root,

  svn_fs_x__dag_clone_child,

  svn_fs_x__dag_clone_root,

  svn_fs_x__dag_delete,

  svn_fs_x__dag_make_file,

  svn_fs_x__dag_make_dir,

  svn_fs_x__dag_copy):

  svn_fs_x__path_txn_proto_rev_lock): Switch TXN_ID types in function

                                      signatures; they are all pass-

                                      through values.

* subversion/libsvn_fs_x/fs.h

 (fs_x_shared_txn_data_t,

  representation_t): Use the new TXN_ID type instead of the old structs.

* subversion/libsvn_fs_x/index.h

 (svn_fs_x__item_offset): Switch TXN_ID type from struct to integer type.

* subversion/libsvn_fs_x/index.c

 (l2p_proto_index_lookup): Switch TXN_ID type in function signature; it is

                           a simple pass-through value.

 (svn_fs_x__item_offset): Switch TXN_ID type in function signature and

                          update "no value" handling.

* subversion/libsvn_fs_x/low_level.c

 (svn_fs_x__parse_representation,

  read_rep_offsets,

  svn_fs_x__unparse_representation,

  svn_fs_x__unparse_representation): Adapt to TXN ID API changes.

* subversion/libsvn_fs_x/noderevs.c

 (shared_representation_t): Use the new data type for the TXN ID member.

 (svn_fs_x__write_noderevs_container,

  svn_fs_x__read_noderevs_container): Simplify as we only need to write

                                      and read single values instead of

                                      structs for TXN IDs.

* subversion/libsvn_fs_x/transaction.h

 (svn_fs_x__txn_get_id,

  svn_fs_x__txn_changes_fetch,

  svn_fs_x__get_txn,

  svn_fs_x__reserve_copy_id,

  svn_fs_x__create_node,

  svn_fs_x__set_entry,

  svn_fs_x__add_change,

  svn_fs_x__create_successor,

  svn_fs_x__get_txn_ids): Switch TXN_ID type from struct to integer type.

* subversion/libsvn_fs_x/transaction.c

 (fs_txn_data_t): Use the new data type for the TXN ID member.

 (svn_fs_x__txn_get_id): Update signature and TXN_ID reference.

 (get_shared_txn,

  free_shared_txn): Update signature, TXN_ID references and comparison.

 (unlock_proto_rev_baton): Use the new data type for the TXN ID member.

 (unlock_proto_rev_body): Update references to TXN_ID and use the new

                          utlis API to convert TXN_IDs into strings.

 (unlock_proto_rev,

  unlock_proto_rev_list_locked): Update signature and TXN_ID reference.

 (get_writable_proto_rev_baton): Use the new data type for the TXN ID member.

 (get_writable_proto_rev_body): Update references to TXN_ID and use the new

                                utlis API to convert TXN_IDs into strings.

 (get_writable_proto_rev): Update signature and TXN_ID reference.

 (purge_shared_txn_body,

  purge_shared_txn): Switch baton from struct to pointer the new TXN_ID.

 (store_sha1_rep_mapping):  Update TXN_ID reference.

 (svn_fs_x__txn_changes_fetch,

  create_new_txn_noderev_from_rev): Update signatures.

 (create_txn_dir): Update signatures as well as TXN_ID references and

                   use the new utlis API to convert a TXN_ID into string.

 (svn_fs_x__create_txn): Update TXN_ID references.

 (get_txn_proplist): Use new TXN_ID type in signature and update

                     TXN_ID value check.

 (change_txn_props): Update TXN_ID references.

 (svn_fs_x__get_txn,

  write_next_ids,

  read_next_ids,

  get_new_txn_node_id,

  svn_fs_x__reserve_copy_id,

  svn_fs_x__create_node): Use new TXN_ID type in signature - pass-through

                          parameters only.

 (svn_fs_x__purge_txn): Update TXN_ID references and types and use the new

                        utlis API to convert TXN_IDs into strings.

 (set_uniquifier): Update TXN_ID reference.

 (svn_fs_x__set_entry): Update signature and TXN_ID references.

 (svn_fs_x__add_change,

  store_l2p_index_entry,

  store_p2l_index_entry,

  allocate_item_index,

  svn_fs_x__create_successor,

  write_hash_delta_rep): Use new TXN_ID type in signature --

                         they are pass-through parameters only.

 (get_shared_rep,

  rep_write_contents_close,

  svn_fs_x__set_proplist): Update TXN_ID references.

 (write_hash_delta_rep): Use new TXN_ID type in signature --

                         they are pass-through parameters only

 (write_final_rev): Use the new TXN_ID type internally and udapte

                    all TXN_ID references.

 (write_final_changed_path_info,

  verify_locks): Use new TXN_ID type in signature.

 (verify_moves): Switch the signature to using the full TXN object

                 and get the base revision from that since TXN_IDs

                 don't provide this info anymore.

 (write_final_revprop): Use new TXN_ID type in signature and adapt

                        to signature changes in called functions.

 (svn_fs_x__open_txn,

  svn_fs_x__delete_node_revision): Update references to TXN_IDs.

 (svn_fs_x__get_txn_ids): Use new TXN_ID type in signature.

* subversion/libsvn_fs_x/tree.c

 (fs_txn_root_data_t): Use the new data type for the TXN_ID member.

 (make_txn_root): Use new TXN_ID type in signature.

 (svn_fs_x__txn_id_t): Same and update TXN_ID reference.

 (add_change,

  merge): Use new TXN_ID type in signature.

 (make_path_mutable,

  x_change_node_prop,

  x_make_dir,

  x_delete_node): Use the correct TXN_ID type internally.

 (copy_helper): Same and use the root objects to access the TXN

                base revision because the TXN_ID does no longer

                provide that information.

 (x_make_file,

  apply_textdelta,

  apply_text): Use the correct TXN_ID type internally.

 (make_txn_root): Update TXN_ID type in signature, update TXN_ID

                  references and call the new string conversion API. Show less