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__REVPROPS_H
24 #define SVN_LIBSVN_FS__REVPROPS_H
30 #endif /* __cplusplus */
32 /* Auto-create / replace the revprop generation file in FS with its
33 * initial contents. In any case, FS will not hold an open handle to
34 * it after this function succeeds.
36 * Use SCRATCH_POOL for temporary allocations.
39 svn_fs_x__reset_revprop_generation_file(svn_fs_t *fs,
40 apr_pool_t *scratch_pool);
42 /* In the filesystem FS, pack all revprop shards up to min_unpacked_rev.
44 * NOTE: Keep the old non-packed shards around until after the format bump.
45 * Otherwise, re-running upgrade will drop the packed revprop shard but
46 * have no unpacked data anymore. Call upgrade_cleanup_pack_revprops after
49 * NOTIFY_FUNC and NOTIFY_BATON as well as CANCEL_FUNC and CANCEL_BATON are
50 * used in the usual way. Temporary allocations are done in SCRATCH_POOL.
53 svn_fs_x__upgrade_pack_revprops(svn_fs_t *fs,
54 svn_fs_upgrade_notify_t notify_func,
56 svn_cancel_func_t cancel_func,
58 apr_pool_t *scratch_pool);
60 /* In the filesystem FS, remove all non-packed revprop shards up to
61 * min_unpacked_rev. Temporary allocations are done in SCRATCH_POOL.
63 * NOTIFY_FUNC and NOTIFY_BATON as well as CANCEL_FUNC and CANCEL_BATON are
64 * used in the usual way. Cancellation is supported in the sense that we
65 * will cleanly abort the operation. However, there will be remnant shards
66 * that must be removed manually.
68 * See upgrade_pack_revprops for more info.
71 svn_fs_x__upgrade_cleanup_pack_revprops(svn_fs_t *fs,
72 svn_fs_upgrade_notify_t notify_func,
74 svn_cancel_func_t cancel_func,
76 apr_pool_t *scratch_pool);
78 /* Read the revprops for revision REV in FS and return them in *PROPLIST_P.
79 * If BYPASS_CACHE is set, don't consult the disks but always read from disk.
81 * Allocate the *PROPLIST_P in RESULT_POOL and use SCRATCH_POOL for temporary
85 svn_fs_x__get_revision_proplist(apr_hash_t **proplist_p,
88 svn_boolean_t bypass_cache,
89 apr_pool_t *result_pool,
90 apr_pool_t *scratch_pool);
92 /* Set the revision property list of revision REV in filesystem FS to
93 PROPLIST. Use SCRATCH_POOL for temporary allocations. */
95 svn_fs_x__set_revision_proplist(svn_fs_t *fs,
98 apr_pool_t *scratch_pool);
101 /* Return TRUE, if for REVISION in FS, we can find the revprop pack file.
102 * Use SCRATCH_POOL for temporary allocations.
103 * Set *MISSING, if the reason is a missing manifest or pack file.
106 svn_fs_x__packed_revprop_available(svn_boolean_t *missing,
108 svn_revnum_t revision,
109 apr_pool_t *scratch_pool);
112 /****** Packing FSX shards *********/
114 /* Copy revprop files for revisions [START_REV, END_REV) from SHARD_PATH
115 * to the pack file at PACK_FILE_NAME in PACK_FILE_DIR.
117 * The file sizes have already been determined and written to SIZES.
118 * Please note that this function will be executed while the filesystem
119 * has been locked and that revprops files will therefore not be modified
120 * while the pack is in progress.
122 * COMPRESSION_LEVEL defines how well the resulting pack file shall be
123 * compressed or whether is shall be compressed at all. TOTAL_SIZE is
124 * a hint on which initial buffer size we should use to hold the pack file
127 * CANCEL_FUNC and CANCEL_BATON are used as usual. Temporary allocations
128 * are done in SCRATCH_POOL.
131 svn_fs_x__copy_revprops(const char *pack_file_dir,
132 const char *pack_filename,
133 const char *shard_path,
134 svn_revnum_t start_rev,
135 svn_revnum_t end_rev,
136 apr_array_header_t *sizes,
137 apr_size_t total_size,
138 int compression_level,
139 svn_cancel_func_t cancel_func,
141 apr_pool_t *scratch_pool);
143 /* For the revprop SHARD at SHARD_PATH with exactly MAX_FILES_PER_DIR
144 * revprop files in it, create a packed shared at PACK_FILE_DIR.
146 * COMPRESSION_LEVEL defines how well the resulting pack file shall be
147 * compressed or whether is shall be compressed at all. Individual pack
148 * file containing more than one revision will be limited to a size of
149 * MAX_PACK_SIZE bytes before compression.
151 * CANCEL_FUNC and CANCEL_BATON are used in the usual way. Temporary
152 * allocations are done in SCRATCH_POOL.
155 svn_fs_x__pack_revprops_shard(const char *pack_file_dir,
156 const char *shard_path,
158 int max_files_per_dir,
159 apr_off_t max_pack_size,
160 int compression_level,
161 svn_cancel_func_t cancel_func,
163 apr_pool_t *scratch_pool);
165 /* Delete the non-packed revprop SHARD at SHARD_PATH with exactly
166 * MAX_FILES_PER_DIR revprop files in it. If this is shard 0, keep the
167 * revprop file for revision 0.
169 * CANCEL_FUNC and CANCEL_BATON are used in the usual way. Temporary
170 * allocations are done in SCRATCH_POOL.
173 svn_fs_x__delete_revprops_shard(const char *shard_path,
175 int max_files_per_dir,
176 svn_cancel_func_t cancel_func,
178 apr_pool_t *scratch_pool);
182 #endif /* __cplusplus */
184 #endif /* SVN_LIBSVN_FS__REVPROPS_H */