diff options
Diffstat (limited to 'subversion/libsvn_fs_fs/fs.h')
-rw-r--r-- | subversion/libsvn_fs_fs/fs.h | 117 |
1 files changed, 104 insertions, 13 deletions
diff --git a/subversion/libsvn_fs_fs/fs.h b/subversion/libsvn_fs_fs/fs.h index c75eafbd5c09d..d11d923d9b057 100644 --- a/subversion/libsvn_fs_fs/fs.h +++ b/subversion/libsvn_fs_fs/fs.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" { @@ -82,8 +82,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 */ @@ -119,6 +117,8 @@ extern "C" { #define CONFIG_OPTION_P2L_PAGE_SIZE "p2l-page-size" #define CONFIG_SECTION_DEBUG "debug" #define CONFIG_OPTION_PACK_AFTER_COMMIT "pack-after-commit" +#define CONFIG_OPTION_VERIFY_BEFORE_COMMIT "verify-before-commit" +#define CONFIG_OPTION_COMPRESSION "compression" /* The format number of this filesystem. This is independent of the repository format number, and @@ -127,7 +127,7 @@ extern "C" { Note: If you bump this, please update the switch statement in svn_fs_fs__create() as well. */ -#define SVN_FS_FS__FORMAT_NUMBER 7 +#define SVN_FS_FS__FORMAT_NUMBER 8 /* The minimum format number that supports svndiff version 1. */ #define SVN_FS_FS__MIN_SVNDIFF1_FORMAT 2 @@ -163,6 +163,9 @@ extern "C" { * issues with very old servers, restrict those options to the 1.6+ format*/ #define SVN_FS_FS__MIN_DELTIFICATION_FORMAT 4 +/* The minimum format number that supports a configuration file (fsfs.conf) */ +#define SVN_FS_FS__MIN_CONFIG_FILE 4 + /* The 1.7-dev format, never released, that packed revprops into SQLite revprops.db . */ #define SVN_FS_FS__PACKED_REVPROP_SQLITE_DEV_FORMAT 5 @@ -182,8 +185,20 @@ extern "C" { /* Minimum format number that supports per-instance filesystem IDs. */ #define SVN_FS_FS__MIN_INSTANCE_ID_FORMAT 7 -/* The minimum format number that supports a configuration file (fsfs.conf) */ -#define SVN_FS_FS__MIN_CONFIG_FILE 4 +/* The minimum format number that supports svndiff version 2. */ +#define SVN_FS_FS__MIN_SVNDIFF2_FORMAT 8 + +/* The minimum format number that supports the special notation ("-") + for optional values that are not present in the representation strings, + such as SHA1 or the uniquifier. For example: + + 15 0 563 7809 28ef320a82e7bd11eebdf3502d69e608 - 14-g/_5 + */ +#define SVN_FS_FS__MIN_REP_STRING_OPTIONAL_VALUES_FORMAT 8 + + /* The minimum format number that supports V2 schema of the rep-cache.db + database. */ +#define SVN_FS_FS__MIN_REP_CACHE_SCHEMA_V2_FORMAT 8 /* On most operating systems apr implements file locks per process, not per file. On Windows apr implements the locking as per file handle @@ -195,6 +210,11 @@ extern "C" { #define SVN_FS_FS__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_FS__CHANGES_BLOCK_SIZE 100 + /* Private FSFS-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 @@ -291,6 +311,13 @@ typedef struct window_cache_key_t apr_uint64_t item_index; } window_cache_key_t; +typedef enum compression_type_t +{ + compression_type_none, + compression_type_zlib, + compression_type_lz4 +} compression_type_t; + /* Private (non-shared) FSFS-specific data for each svn_fs_t object. Any caches in here may be NULL. */ typedef struct fs_fs_data_t @@ -353,6 +380,15 @@ typedef struct fs_fs_data_t rep key (revision/offset) to svn_stringbuf_t. */ svn_cache__t *fulltext_cache; + /* The current prefix to be used for revprop cache entries. + If this is 0, a new unique prefix must be chosen. */ + apr_uint64_t revprop_prefix; + + /* Revision property cache. Maps from (rev,prefix) to apr_hash_t. + Unparsed svn_string_t representations of the serialized hash + will be written to the cache but the getter returns apr_hash_t. */ + svn_cache__t *revprop_cache; + /* Node properties cache. Maps from rep key to apr_hash_t. */ svn_cache__t *properties_cache; @@ -376,8 +412,8 @@ typedef struct fs_fs_data_t /* Cache for node_revision_t objects; the key is (revision, item_index) */ svn_cache__t *node_revision_cache; - /* Cache for change lists as APR arrays of change_t * objects; the key - is the revision */ + /* Cache for change lists n blocks as svn_fs_fs__changes_list_t * objects; + the key is the (revision, first-element-in-block) pair. */ svn_cache__t *changes_cache; /* Cache for svn_fs_fs__rep_header_t objects; the key is a @@ -457,18 +493,27 @@ typedef struct fs_fs_data_t * deltification history after which skip deltas will be used. */ apr_int64_t max_linear_deltification; - /* Compression level to use with txdelta storage format in new revs. */ + /* Compression type to use with txdelta storage format in new revs. */ + compression_type_t delta_compression_type; + + /* Compression level (currently, only used with compression_type_zlib). */ int delta_compression_level; /* Pack after every commit. */ svn_boolean_t pack_after_commit; + /* Verify each new revision before commit. */ + svn_boolean_t verify_before_commit; + /* Per-instance filesystem ID, which provides an additional level of uniqueness for filesystems that share the same UUID, but should still be distinguishable (e.g. backups produced by svn_fs_hotcopy() 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 *); @@ -515,7 +560,7 @@ typedef struct representation_t /* Revision where this representation is located. */ svn_revnum_t revision; - /* Item index with the the revision. */ + /* Item index with the revision. */ apr_uint64_t item_index; /* The size of the representation in bytes as seen in the revision @@ -523,7 +568,14 @@ typedef struct representation_t svn_filesize_t size; /* The size of the fulltext of the representation. If this is 0, - * the fulltext size is equal to representation size in the rev file, */ + * for a plain rep, the real fulltext size is equal to the SIZE field. + * For a delta rep, this field is always the real fulltext size. + * + * Note that svn_fs_fs__fixup_expanded_size() checks for these special + * cases and ensures that this field contains the actual value. We call + * it early after reading a representation struct, so most code does not + * have to worry about it. + */ svn_filesize_t expanded_size; /* Is this a representation (still) within a transaction? */ @@ -568,8 +620,8 @@ typedef struct node_revision_t svn_revnum_t copyroot_rev; const char *copyroot_path; - /* number of predecessors this node revision has (recursively), or - -1 if not known (for backward compatibility). */ + /* 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 @@ -606,6 +658,45 @@ typedef struct change_t svn_fs_path_change2_t info; } change_t; + +/*** Context for reading changed paths lists iteratively. */ +typedef struct svn_fs_fs__changes_context_t +{ + /* Repository to fetch from. */ + svn_fs_t *fs; + + /* Revision that we read from. */ + svn_revnum_t revision; + + /* Revision file object to use when needed. NULL until the first access. */ + svn_fs_fs__revision_file_t *revision_file; + + /* Pool to create REVISION_FILE in. */ + apr_pool_t *rev_file_pool; + + /* Index of the next change to fetch. */ + apr_size_t next; + + /* 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_fs__changes_context_t; + +/*** Directory (only used at the cache interface) ***/ +typedef struct svn_fs_fs__dir_data_t +{ + /* Contents, i.e. all directory entries, sorted by name. */ + apr_array_header_t *entries; + + /* 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_fs__dir_data_t; + #ifdef __cplusplus } |