1 /* revprops.h --- everything needed to handle revprops in FSX
3 * ====================================================================
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
20 * ====================================================================
23 #ifndef SVN_LIBSVN_FS_X_REVPROPS_H
24 #define SVN_LIBSVN_FS_X_REVPROPS_H
28 #include "batch_fsync.h"
32 #endif /* __cplusplus */
34 /* Auto-create / replace the revprop generation file in FS with its
35 * initial contents. In any case, FS will not hold an open handle to
36 * it after this function succeeds.
38 * Use SCRATCH_POOL for temporary allocations.
41 svn_fs_x__reset_revprop_generation_file(svn_fs_t *fs,
42 apr_pool_t *scratch_pool);
44 /* Invalidate the cached revprop generation value in FS->FSAP_DATA.
45 * This enforces a re-read upon the next revprop read. */
47 svn_fs_x__invalidate_revprop_generation(svn_fs_t *fs);
49 /* Utility function serializing PROPLIST into FILE and adding the checksum.
50 * Use SCRATCH_POOL for temporary allocations.
52 * Call this only when creating initial revprop file contents.
53 * For modifications use svn_fs_x__set_revision_proplist.
56 svn_fs_x__write_non_packed_revprops(apr_file_t *file,
58 apr_pool_t *scratch_pool);
60 /* Read the revprops for revision REV in FS and return them in *PROPLIST_P.
61 * If BYPASS_CACHE is set, don't consult the disks but always read from disk.
62 * If REFRESH is set, update the revprop generation info; otherwise access
63 * potentially outdated cache data directly.
65 * Allocate the *PROPLIST_P in RESULT_POOL and use SCRATCH_POOL for temporary
69 svn_fs_x__get_revision_proplist(apr_hash_t **proplist_p,
72 svn_boolean_t bypass_cache,
73 svn_boolean_t refresh,
74 apr_pool_t *result_pool,
75 apr_pool_t *scratch_pool);
77 /* Set the revision property list of revision REV in filesystem FS to
78 PROPLIST. Use SCRATCH_POOL for temporary allocations. */
80 svn_fs_x__set_revision_proplist(svn_fs_t *fs,
83 apr_pool_t *scratch_pool);
86 /* Return TRUE, if for REVISION in FS, we can find the revprop pack file.
87 * Use SCRATCH_POOL for temporary allocations.
88 * Set *MISSING, if the reason is a missing manifest or pack file.
91 svn_fs_x__packed_revprop_available(svn_boolean_t *missing,
93 svn_revnum_t revision,
94 apr_pool_t *scratch_pool);
97 /****** Packing FSX shards *********/
99 /* For the revprop SHARD at SHARD_PATH with exactly MAX_FILES_PER_DIR
100 * revprop files in it, create a packed shared at PACK_FILE_DIR in
101 * filesystem FS. Schedule necessary fsync calls in BATCH.
103 * COMPRESSION_LEVEL defines how well the resulting pack file shall be
104 * compressed or whether is shall be compressed at all. Individual pack
105 * file containing more than one revision will be limited to a size of
106 * MAX_PACK_SIZE bytes before compression.
108 * CANCEL_FUNC and CANCEL_BATON are used in the usual way. Temporary
109 * allocations are done in SCRATCH_POOL.
112 svn_fs_x__pack_revprops_shard(svn_fs_t *fs,
113 const char *pack_file_dir,
114 const char *shard_path,
116 int max_files_per_dir,
117 apr_int64_t max_pack_size,
118 int compression_level,
119 svn_fs_x__batch_fsync_t *batch,
120 svn_cancel_func_t cancel_func,
122 apr_pool_t *scratch_pool);
126 #endif /* __cplusplus */
128 #endif /* SVN_LIBSVN_FS_X_REVPROPS_H */