/[Apache-SVN]
ViewVC logotype

Revision 1506545


Jump to revision: Previous Next
Author: stefan2
Date: Wed Jul 24 13:24:44 2013 UTC (11 years, 5 months ago)
Changed paths: 19
Log Message:
On the fsfs-improvements branch:  Finally switch to a new FSFS ID API.

This replaces the previous string-based API with one that represents
IDs as quadruples of <revision,sub-id> pairs of integers.  Thus, it
now matches the implicit usage of the node_id, branch_id, txn_id and
rev_offset parts of those IDs.

The patch does four things.  First, it replaces the current API in
id.*.  Second, it must use the new svn_fs_fs__id_part_t * instead of
const char * in all FSFS code.  In some places we have to add a level
of indirection as key parts can now be put on stack instead of being
pool-allocated but we always pass them along through pointers.

Third, structs using a txn ID will use the new data type as well -
requiring more code to be updated.  Lastly, we have to update code
that (de-)serializes IDs or handles ID assignment and increments.

* subversion/include/svn_error_codes.h
  (SVN_ERR_FS_MALFORMED_TXN_ID): new error code

* subversion/libsvn_fs_fs/id.h
  (svn_fs_fs__id_part_t): declare type for ID elements
  (svn_fs_fs__id_txn_parse,
   svn_fs_fs__id_rev_offset,
   svn_fs_fs__id_part_compare): declare new API functions
  (svn_fs_fs__id_part_eq,
   svn_fs_fs__id_txn_used,
   svn_fs_fs__id_txn_reset,
   svn_fs_fs__id_txn_unparse,
   svn_fs_fs__id_node_id,
   svn_fs_fs__id_copy_id,
   svn_fs_fs__id_rev,
   svn_fs_fs__id_compare,
   svn_fs_fs__id_txn_create): change signatures

* subversion/libsvn_fs_fs/id.c
  (id_private_t): replace by ...
  (fs_fs__id_t): ... this one; declare it such that we can just cast
                 between svn_fs_id_t and our internal type
  (part_parse,
   txn_id_parse): new external string-rep -> internal rep conversion utils
  (svn_fs_fs__id_part_is_root): 
  (svn_fs_fs__id_part_eq, 
   svn_fs_fs__id_txn_used, 
   svn_fs_fs__id_txn_reset,
   svn_fs_fs__id_txn_unparse): update signatures and code
  (svn_fs_fs__id_txn_parse): implement new API function
  (svn_fs_fs__id_node_id,
   svn_fs_fs__id_copy_id,
   svn_fs_fs__id_txn_id,
   svn_fs_fs__id_rev,
   svn_fs_fs__id_offset,
   svn_fs_fs__id_is_txn,
   svn_fs_fs__id_eq): update signature and reimplement trivially
  (svn_fs_fs__id_part_compare): implement new API function
  (svn_fs_fs__id_unparse,
   svn_fs_fs__id_check_related,
   svn_fs_fs__id_txn_create_root,
   svn_fs_fs__id_txn_create,
   svn_fs_fs__id_rev_create,
   svn_fs_fs__id_copy,
   svn_fs_fs__id_parse): update signature and reimplement
  (serialize_id_private,
   deserialize_id_private): drop
  (svn_fs_fs__id_serialize,
   svn_fs_fs__id_deserialize): greatly simplify

* subversion/libsvn_fs_fs/fs.h
  (fs_fs_shared_txn_data_t,
   representation_t): use the new ID part type for TXN IDs

* subversion/libsvn_fs_fs/cached_data.c
  (open_and_seek_transaction): add indirection

* subversion/libsvn_fs_fs/dag.h
  (svn_fs_fs__dag_txn_root,
   svn_fs_fs__dag_clone_root,
   svn_fs_fs__dag_set_entry, 
   svn_fs_fs__dag_clone_child,
   svn_fs_fs__dag_delete,
   svn_fs_fs__dag_make_dir,
   svn_fs_fs__dag_make_file,
   svn_fs_fs__dag_copy): use new ID part type in signature

* subversion/libsvn_fs_fs/dag.c
  (set_entry, 
   make_entry,
   svn_fs_fs__dag_set_entry,
   svn_fs_fs__dag_txn_root,
   svn_fs_fs__dag_txn_base_root,
   svn_fs_fs__dag_clone_child,
   svn_fs_fs__dag_clone_root,
   svn_fs_fs__dag_delete,
   svn_fs_fs__dag_make_file, 
   svn_fs_fs__dag_make_dir): use new ID part type in signature
  (svn_fs_fs__dag_copy): use new ID part type in signature and code

* subversion/libsvn_fs_fs/fs_fs.h
  (svn_fs_fs__set_node_origin,
   svn_fs_fs__get_node_origin): use new ID part type in signature

* subversion/libsvn_fs_fs/fs_fs.c
  (svn_fs_fs__set_node_origin): use new ID part type in signature
  (svn_fs_fs__get_node_origin,
   set_node_origins_for_file): ditto; convert string <-> ID part
                               Note, these are old-style IDs with rev:=0

* subversion/libsvn_fs_fs/hotcopy.c
  (hotcopy_update_current): replace the ID part types with ints
                            Note, these are old-style IDs with rev:=0

* subversion/libsvn_fs_fs/low_level.c
  (read_rep_offsets): add indirection

* subversion/libsvn_fs_fs/recovery.h
  (svn_fs_fs__find_max_ids): replace the ID part types with ints
                             Note, these are old-style IDs with rev:=0

* subversion/libsvn_fs_fs/recovery.c
  (recover_find_max_ids,
   svn_fs_fs__find_max_ids): update / simplify using new ID API
  (recover_body): ditto; we don't need the root node id here anymore

* subversion/libsvn_fs_fs/temp_serializer.c
  (serialize_representation,
   deserialize_representation): no sub-struct handling for id parts needed

* subversion/libsvn_fs_fs/transaction.h
  (svn_fs_fs__txn_get_id,
   svn_fs_fs__txn_changes_fetch,
   svn_fs_fs__get_txn,
   svn_fs_fs__reserve_copy_id,
   svn_fs_fs__create_node,
   svn_fs_fs__set_entry,
   svn_fs_fs__add_change,
   svn_fs_fs__create_successor,
   svn_fs_fs__get_txn_ids): use new ID part type in signature

* subversion/libsvn_fs_fs/transaction.c
  (fs_txn_data_t,
   unlock_proto_rev_baton,
   get_writable_proto_rev_baton,
   get_and_increment_txn_key_baton,
   path_txn_sha1,
   path_txn_changes,
   path_txn_props,
   path_txn_next_ids,
   purge_shared_txn,
   svn_fs_fs__txn_changes_fetch,
   svn_fs_fs__get_txn,
   svn_fs_fs__add_change,
   svn_fs_fs__create_successor,
   write_final_changed_path_info,
   verify_locks,
   svn_fs_fs__get_txn_ids,
   svn_fs_fs__txn_get_id,
   free_shared_txn,
   get_txn_proplist,
   get_shared_txn,
   unlock_proto_rev_body,
   get_writable_proto_rev_body,
   unlock_proto_rev,
   unlock_proto_rev_list_locked,
   get_writable_proto_rev,
   svn_fs_fs__set_entry,
   purge_shared_txn_body,
   commit_body,
   create_new_txn_noderev_from_rev,
   svn_fs_fs__create_txn,
   svn_fs_fs__change_txn_props,
   get_shared_rep,
   rep_write_contents_close,
   svn_fs_fs__create_node,
   svn_fs_fs__set_proplist,
   svn_fs_fs__open_txn): update part ID types, their assignment
                         and indirection level
  (get_and_increment_txn_key_body): trivial increment; update parser & writer
  (create_txn_dir,
   create_txn_dir_pre_1_5): update signature and txn ID initialization
  (write_next_ids): update signature and IDs serialization
  (read_next_ids): update signature and IDs parsing
  (get_new_txn_node_id,
   svn_fs_fs__reserve_copy_id,
   write_final_current): update signature, ID init and increment code
  (svn_fs_fs__purge_txn): convert svn_fs API parameter into internal ID type,
                          update parameter indirection
  (set_uniquifier): need to convert uniquifier from int -> string
  (get_next_revision_ids): update signature and parser
  (get_final_id): update signature and switch implementation to ints
  (write_final_rev): update signature, local variable type, ID initialization
                     and parameter indirection

* subversion/libsvn_fs_fs/tree.c
  (fs_txn_root_data_t): replace txn id string with proper part ID
  (root_txn_id): update signature; update implementation
  (get_copy_inheritance,
   fs_change_node_prop,
   merge_changes,
   fs_make_dir,
   fs_delete_node,
   copy_helper,
   fs_make_file,
   apply_textdelta,
   apply_text): update local variable types
  (make_path_mutable): ditto; update assignment
  (add_change,
   merge): update signature
  (fs_node_origin_rev): simplify using the new ID API guarantees
  (make_txn_root): update signature and struct member initialization
  (svn_fs_fs__verify_root): update parameter indirection

* subversion/libsvn_fs_fs/util.h
  (svn_fs_fs__path_txn_dir,
   svn_fs_fs__path_txn_proto_rev,
   svn_fs_fs__path_txn_proto_rev_lock,
   svn_fs_fs__path_node_origin): use new ID part type in signature
   svn_fs_fs__write_current): use int counters in signature

* subversion/libsvn_fs_fs/util.c
  (combine_txn_id_string): update signature and convert id->string
  (svn_fs_fs__path_txn_dir,
   svn_fs_fs__path_txn_proto_rev,
   svn_fs_fs__path_txn_proto_rev_lock): update signature
  (svn_fs_fs__path_txn_node_rev,
   svn_fs_fs__path_node_origin,
   svn_fs_fs__write_current): update signature; convert int -> base36

Changed paths

Path Details
Directorysubversion/branches/fsfs-improvements/subversion/include/svn_error_codes.h modified , text changed
Directorysubversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/cached_data.c modified , text changed
Directorysubversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/dag.c modified , text changed
Directorysubversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/dag.h modified , text changed
Directorysubversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/fs.h modified , text changed
Directorysubversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/fs_fs.c modified , text changed
Directorysubversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/fs_fs.h modified , text changed
Directorysubversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/hotcopy.c modified , text changed
Directorysubversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/id.c modified , text changed
Directorysubversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/id.h modified , text changed
Directorysubversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/low_level.c modified , text changed
Directorysubversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/recovery.c modified , text changed
Directorysubversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/recovery.h modified , text changed
Directorysubversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/temp_serializer.c modified , text changed
Directorysubversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c modified , text changed
Directorysubversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.h modified , text changed
Directorysubversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/tree.c modified , text changed
Directorysubversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/util.c modified , text changed
Directorysubversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/util.h modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26