diff options
Diffstat (limited to 'subversion/libsvn_fs_x/fs.h')
-rw-r--r-- | subversion/libsvn_fs_x/fs.h | 123 |
1 files changed, 62 insertions, 61 deletions
diff --git a/subversion/libsvn_fs_x/fs.h b/subversion/libsvn_fs_x/fs.h index afb4b2a63bf35..7c7a7715567f9 100644 --- a/subversion/libsvn_fs_x/fs.h +++ b/subversion/libsvn_fs_x/fs.h @@ -1,4 +1,4 @@ -/* fs.h : interface to Subversion filesystem, private to libsvn_fs +/* fs.h : interface to Subversion filesystem * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -20,8 +20,8 @@ * ==================================================================== */ -#ifndef SVN_LIBSVN_FS_X_H -#define SVN_LIBSVN_FS_X_H +#ifndef SVN_LIBSVN_FS_X_FS_H +#define SVN_LIBSVN_FS_X_FS_H #include <apr_pools.h> #include <apr_hash.h> @@ -37,7 +37,7 @@ #include "private/svn_sqlite.h" #include "private/svn_mutex.h" -#include "id.h" +#include "rev_file.h" #ifdef __cplusplus extern "C" { @@ -53,12 +53,11 @@ extern "C" { #define PATH_FORMAT "format" /* Contains format number */ #define PATH_UUID "uuid" /* Contains UUID */ #define PATH_CURRENT "current" /* Youngest revision */ +#define PATH_NEXT "next" /* Revision begin written. */ #define PATH_LOCK_FILE "write-lock" /* Revision lock file */ #define PATH_PACK_LOCK_FILE "pack-lock" /* Pack lock file */ #define PATH_REVS_DIR "revs" /* Directory of revisions */ -#define PATH_REVPROPS_DIR "revprops" /* Directory of revprops */ #define PATH_TXNS_DIR "transactions" /* Directory of transactions */ -#define PATH_NODE_ORIGINS_DIR "node-origins" /* Lazy node-origin cache */ #define PATH_TXN_PROTOS_DIR "txn-protorevs" /* Directory of proto-revs */ #define PATH_TXN_CURRENT "txn-current" /* File with next txn key */ #define PATH_TXN_CURRENT_LOCK "txn-current-lock" /* Lock for txn-current */ @@ -81,8 +80,6 @@ extern "C" { /* Names of special files and file extensions for transactions */ #define PATH_CHANGES "changes" /* Records changes made so far */ #define PATH_TXN_PROPS "props" /* Transaction properties */ -#define PATH_TXN_PROPS_FINAL "props-final" /* Final transaction properties - before moving to revprops */ #define PATH_NEXT_IDS "next-ids" /* Next temporary ID assignments */ #define PATH_PREFIX_NODE "node." /* Prefix for node filename */ #define PATH_EXT_TXN ".txn" /* Extension of txn dir */ @@ -124,7 +121,11 @@ extern "C" { Note: If you bump this, please update the switch statement in svn_fs_x__create() as well. */ -#define SVN_FS_X__FORMAT_NUMBER 1 +#define SVN_FS_X__FORMAT_NUMBER 2 + +/* Latest experimental format number. Experimental formats are only + compatible with themselves. */ +#define SVN_FS_X__EXPERIMENTAL_FORMAT_NUMBER 2 /* On most operating systems apr implements file locks per process, not per file. On Windows apr implements the locking as per file handle @@ -136,6 +137,11 @@ extern "C" { #define SVN_FS_X__USE_LOCK_MUTEX 0 #endif +/* Maximum number of changes we deliver per request when listing the + changed paths for a given revision. Anything > 0 will do. + At 100..300 bytes per entry, this limits the allocation to ~30kB. */ +#define SVN_FS_X__CHANGES_BLOCK_SIZE 100 + /* Private FSX-specific data shared between all svn_txn_t objects that relate to a particular transaction in a filesystem (as identified by transaction id and filesystem UUID). Objects of this type are @@ -179,11 +185,15 @@ typedef struct svn_fs_x__shared_data_t declaration here. Any subset may be acquired and held at any given time but their relative acquisition order must not change. - (lock 'txn-current' before 'pack' before 'write' before 'txn-list') */ + (lock 'pack' before 'write' before 'txn-current' before 'txn-list') */ /* A lock for intra-process synchronization when accessing the TXNS list. */ svn_mutex__t *txn_list_lock; + /* A lock for intra-process synchronization when locking the + txn-current file. */ + svn_mutex__t *txn_current_lock; + /* A lock for intra-process synchronization when grabbing the repository write lock. */ svn_mutex__t *fs_write_lock; @@ -192,10 +202,6 @@ typedef struct svn_fs_x__shared_data_t repository pack operation lock. */ svn_mutex__t *fs_pack_lock; - /* A lock for intra-process synchronization when locking the - txn-current file. */ - svn_mutex__t *txn_current_lock; - /* The common pool, under which this object is allocated, subpools of which are used to allocate the transaction objects. */ apr_pool_t *common_pool; @@ -281,13 +287,9 @@ typedef struct svn_fs_x__data_t e.g. memcached may be ignored as caching is an optional feature. */ svn_boolean_t fail_stop; - /* Caches native dag_node_t* instances and acts as a 1st level cache */ + /* Caches native dag_node_t* instances */ svn_fs_x__dag_cache_t *dag_node_cache; - /* DAG node cache for immutable nodes. Maps (revision, fspath) - to (dag_node_t *). This is the 2nd level cache for DAG nodes. */ - svn_cache__t *rev_node_cache; - /* A cache of the contents of immutable directories; maps from unparsed FS ID to a apr_hash_t * mapping (const char *) dirent names to (svn_fs_x__dirent_t *). */ @@ -297,9 +299,8 @@ typedef struct svn_fs_x__data_t rep key (revision/offset) to svn_stringbuf_t. */ svn_cache__t *fulltext_cache; - /* Access object to the revprop "generation". Will be NULL until - the first access. May be also get closed and set to NULL again. */ - apr_file_t *revprop_generation_file; + /* Revprop generation number. Will be -1 if it has to reread from disk. */ + apr_int64_t revprop_generation; /* Revision property cache. Maps from (rev,generation) to apr_hash_t. */ svn_cache__t *revprop_cache; @@ -307,12 +308,6 @@ typedef struct svn_fs_x__data_t /* Node properties cache. Maps from rep key to apr_hash_t. */ svn_cache__t *properties_cache; - /* Pack manifest cache; a cache mapping (svn_revnum_t) shard number to - a manifest; and a manifest is a mapping from (svn_revnum_t) revision - number offset within a shard to (apr_off_t) byte-offset in the - respective pack file. */ - svn_cache__t *packed_offset_cache; - /* Cache for txdelta_window_t objects; * the key is svn_fs_x__window_cache_key_t */ svn_cache__t *txdelta_window_cache; @@ -329,8 +324,8 @@ typedef struct svn_fs_x__data_t the key is a (pack file revision, file offset) pair */ svn_cache__t *noderevs_container_cache; - /* Cache for change lists as APR arrays of svn_fs_x__change_t * objects; - the key is the revision */ + /* Cache for change lists n blocks as svn_fs_x__changes_list_t * objects; + the key is the (revision, first-element-in-block) pair. */ svn_cache__t *changes_cache; /* Cache for change_list_t containers; @@ -345,15 +340,6 @@ typedef struct svn_fs_x__data_t (revision, item index) pair */ 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; - - /* Cache for presence of svn_mergeinfo_t on a noderev; the key is a - combination of revision, inheritance flags and path; value is "1" - if the node has mergeinfo, "0" if it doesn't. */ - svn_cache__t *mergeinfo_existence_cache; - /* Cache for l2p_header_t objects; the key is (revision, is-packed). Will be NULL for pre-format7 repos */ svn_cache__t *l2p_header_cache; @@ -417,19 +403,19 @@ typedef struct svn_fs_x__data_t or dump / load cycles). */ const char *instance_id; + /* Ensure that all filesystem changes are written to disk. */ + svn_boolean_t flush_to_disk; + /* Pointer to svn_fs_open. */ svn_error_t *(*svn_fs_open_)(svn_fs_t **, const char *, apr_hash_t *, apr_pool_t *, apr_pool_t *); + } svn_fs_x__data_t; /*** Filesystem Transaction ***/ typedef struct svn_fs_x__transaction_t { - /* property list (const char * name, svn_string_t * value). - may be NULL if there are no properties. */ - apr_hash_t *proplist; - /* revision upon which this txn is base. (unfinished only) */ svn_revnum_t base_rev; @@ -503,7 +489,8 @@ typedef struct svn_fs_x__noderev_t /* node kind */ svn_node_kind_t kind; - /* number of predecessors this node revision has (recursively). */ + /* Number of predecessors this node revision has (recursively). + A difference from the BDB backend is that it cannot be -1. */ int predecessor_count; /* representation key for this node's properties. may be NULL if @@ -543,32 +530,46 @@ typedef struct svn_fs_x__dirent_t /*** Change ***/ -typedef struct svn_fs_x__change_t +typedef svn_fs_path_change3_t svn_fs_x__change_t; + +/*** Context for reading changed paths lists iteratively. */ +typedef struct svn_fs_x__changes_context_t { - /* Path of the change. */ - svn_string_t path; + /* Repository to fetch from. */ + svn_fs_t *fs; - /* node revision id of changed path */ - svn_fs_x__id_t noderev_id; + /* Revision that we read from. */ + svn_revnum_t revision; - /* See svn_fs_path_change2_t for a description for the remaining elements. - */ - svn_fs_path_change_kind_t change_kind; + /* Revision file object to use when needed. */ + svn_fs_x__revision_file_t *revision_file; - svn_boolean_t text_mod; - svn_boolean_t prop_mod; - svn_node_kind_t node_kind; + /* Index of the next change to fetch. */ + int next; - svn_boolean_t copyfrom_known; - svn_revnum_t copyfrom_rev; - const char *copyfrom_path; + /* Offset, within the changed paths list on disk, of the next change to + fetch. */ + apr_off_t next_offset; + + /* Has the end of the list been reached? */ + svn_boolean_t eol; + +} svn_fs_x__changes_context_t; + +/*** Directory (only used at the cache interface) ***/ +typedef struct svn_fs_x__dir_data_t +{ + /* Contents, i.e. all directory entries, sorted by name. */ + apr_array_header_t *entries; - svn_tristate_t mergeinfo_mod; -} svn_fs_x__change_t; + /* SVN_INVALID_FILESIZE for committed data, otherwise the length of the + * in-txn on-disk representation of that directory. */ + svn_filesize_t txn_filesize; +} svn_fs_x__dir_data_t; #ifdef __cplusplus } #endif /* __cplusplus */ -#endif /* SVN_LIBSVN_FS_X_H */ +#endif /* SVN_LIBSVN_FS_X_FS_H */ |