1 /* revprops.h --- everything needed to handle revprops in FSFS
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 * ====================================================================
25 /* In the filesystem FS, pack all revprop shards up to min_unpacked_rev.
27 * NOTE: Keep the old non-packed shards around until after the format bump.
28 * Otherwise, re-running upgrade will drop the packed revprop shard but
29 * have no unpacked data anymore. Call upgrade_cleanup_pack_revprops after
32 * NOTIFY_FUNC and NOTIFY_BATON as well as CANCEL_FUNC and CANCEL_BATON are
33 * used in the usual way. Temporary allocations are done in SCRATCH_POOL.
36 svn_fs_fs__upgrade_pack_revprops(svn_fs_t *fs,
37 svn_fs_upgrade_notify_t notify_func,
39 svn_cancel_func_t cancel_func,
41 apr_pool_t *scratch_pool);
43 /* In the filesystem FS, remove all non-packed revprop shards up to
44 * min_unpacked_rev. Temporary allocations are done in SCRATCH_POOL.
46 * NOTIFY_FUNC and NOTIFY_BATON as well as CANCEL_FUNC and CANCEL_BATON are
47 * used in the usual way. Cancellation is supported in the sense that we
48 * will cleanly abort the operation. However, there will be remnant shards
49 * that must be removed manually.
51 * See upgrade_pack_revprops for more info.
54 svn_fs_fs__upgrade_cleanup_pack_revprops(svn_fs_t *fs,
55 svn_fs_upgrade_notify_t notify_func,
57 svn_cancel_func_t cancel_func,
59 apr_pool_t *scratch_pool);
61 /* Invalidate the revprop cache in FS. */
63 svn_fs_fs__reset_revprop_cache(svn_fs_t *fs);
65 /* Set *PROPS_SIZE_P to the size in bytes on disk of the revprops for
66 * revision REV in FS. The size excludes indexes.
69 svn_fs_fs__get_revision_props_size(apr_off_t *props_size_p,
72 apr_pool_t *scratch_pool);
74 /* Read the revprops for revision REV in FS and return them in *PROPERTIES_P.
75 * If REFRESH is set, clear the revprop cache before accessing the data.
77 * The result will be allocated in RESULT_POOL; SCRATCH_POOL is used for
81 svn_fs_fs__get_revision_proplist(apr_hash_t **proplist_p,
84 svn_boolean_t refresh,
85 apr_pool_t *result_pool,
86 apr_pool_t *scratch_pool);
88 /* Set the revision property list of revision REV in filesystem FS to
89 PROPLIST. Use POOL for temporary allocations. */
91 svn_fs_fs__set_revision_proplist(svn_fs_t *fs,
97 /* Return TRUE, if for REVISION in FS, we can find the revprop pack file.
98 * Use POOL for temporary allocations.
99 * Set *MISSING, if the reason is a missing manifest or pack file.
102 svn_fs_fs__packed_revprop_available(svn_boolean_t *missing,
104 svn_revnum_t revision,
108 /****** Packing FSFS shards *********/
110 /* Copy revprop files for revisions [START_REV, END_REV) from SHARD_PATH
111 * to the pack file at PACK_FILE_NAME in PACK_FILE_DIR.
113 * The file sizes have already been determined and written to SIZES.
114 * Please note that this function will be executed while the filesystem
115 * has been locked and that revprops files will therefore not be modified
116 * while the pack is in progress.
118 * COMPRESSION_LEVEL defines how well the resulting pack file shall be
119 * compressed or whether is shall be compressed at all. TOTAL_SIZE is
120 * a hint on which initial buffer size we should use to hold the pack file
123 * If FLUSH_TO_DISK is non-zero, do not return until the data has actually
124 * been written on the disk. CANCEL_FUNC and CANCEL_BATON are used as usual.
125 * Temporary allocations are done in SCRATCH_POOL.
128 svn_fs_fs__copy_revprops(const char *pack_file_dir,
129 const char *pack_filename,
130 const char *shard_path,
131 svn_revnum_t start_rev,
132 svn_revnum_t end_rev,
133 apr_array_header_t *sizes,
134 apr_size_t total_size,
135 int compression_level,
136 svn_boolean_t flush_to_disk,
137 svn_cancel_func_t cancel_func,
139 apr_pool_t *scratch_pool);
141 /* In the filesystem FS, pack all revprop shards up to min_unpacked_rev.
143 * NOTE: Keep the old non-packed shards around until after the format bump.
144 * Otherwise, re-running upgrade will drop the packed revprop shard but
145 * have no unpacked data anymore. Call upgrade_cleanup_pack_revprops after
148 * If FLUSH_TO_DISK is non-zero, do not return until the data has actually
149 * been written on the disk. CANCEL_FUNC and CANCEL_BATON areused in the
150 * usual way. Temporary allocations are done in SCRATCH_POOL.
153 svn_fs_fs__pack_revprops_shard(const char *pack_file_dir,
154 const char *shard_path,
156 int max_files_per_dir,
157 apr_int64_t max_pack_size,
158 int compression_level,
159 svn_boolean_t flush_to_disk,
160 svn_cancel_func_t cancel_func,
162 apr_pool_t *scratch_pool);
164 /* In the filesystem FS, remove all non-packed revprop shards up to
165 * min_unpacked_rev. Temporary allocations are done in SCRATCH_POOL.
167 * NOTIFY_FUNC and NOTIFY_BATON as well as CANCEL_FUNC and CANCEL_BATON are
168 * used in the usual way. Cancellation is supported in the sense that we
169 * will cleanly abort the operation. However, there will be remnant shards
170 * that must be removed manually.
172 * See upgrade_pack_revprops for more info.
175 svn_fs_fs__delete_revprops_shard(const char *shard_path,
177 int max_files_per_dir,
178 svn_cancel_func_t cancel_func,
180 apr_pool_t *scratch_pool);