]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/subversion/subversion/libsvn_fs_fs/fs_fs.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / subversion / subversion / libsvn_fs_fs / fs_fs.h
1 /* fs_fs.h : interface to the native filesystem layer
2  *
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
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
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
19  *    under the License.
20  * ====================================================================
21  */
22
23 #ifndef SVN_LIBSVN_FS__FS_FS_H
24 #define SVN_LIBSVN_FS__FS_FS_H
25
26 #include "fs.h"
27
28 /* Open the fsfs filesystem pointed to by PATH and associate it with
29    filesystem object FS.  Use POOL for temporary allocations.
30
31    ### Some parts of *FS must have been initialized beforehand; some parts
32        (including FS->path) are initialized by this function. */
33 svn_error_t *svn_fs_fs__open(svn_fs_t *fs,
34                              const char *path,
35                              apr_pool_t *pool);
36
37 /* Upgrade the fsfs filesystem FS.  Use POOL for temporary allocations. */
38 svn_error_t *svn_fs_fs__upgrade(svn_fs_t *fs,
39                                 apr_pool_t *pool);
40
41 /* Verify metadata in fsfs filesystem FS.  Limit the checks to revisions
42  * START to END where possible.  Indicate progress via the optional
43  * NOTIFY_FUNC callback using NOTIFY_BATON.  The optional CANCEL_FUNC
44  * will periodically be called with CANCEL_BATON to allow for preemption.
45  * Use POOL for temporary allocations. */
46 svn_error_t *svn_fs_fs__verify(svn_fs_t *fs,
47                                svn_revnum_t start,
48                                svn_revnum_t end,
49                                svn_fs_progress_notify_func_t notify_func,
50                                void *notify_baton,
51                                svn_cancel_func_t cancel_func,
52                                void *cancel_baton,
53                                apr_pool_t *pool);
54
55 /* Copy the fsfs filesystem SRC_FS at SRC_PATH into a new copy DST_FS at
56  * DST_PATH. If INCREMENTAL is TRUE, do not re-copy data which already
57  * exists in DST_FS. Use POOL for temporary allocations. */
58 svn_error_t * svn_fs_fs__hotcopy(svn_fs_t *src_fs,
59                                  svn_fs_t *dst_fs,
60                                  const char *src_path,
61                                  const char *dst_path,
62                                  svn_boolean_t incremental,
63                                  svn_cancel_func_t cancel_func,
64                                  void *cancel_baton,
65                                  apr_pool_t *pool);
66
67 /* Recover the fsfs associated with filesystem FS.
68    Use optional CANCEL_FUNC/CANCEL_BATON for cancellation support.
69    Use POOL for temporary allocations. */
70 svn_error_t *svn_fs_fs__recover(svn_fs_t *fs,
71                                 svn_cancel_func_t cancel_func,
72                                 void *cancel_baton,
73                                 apr_pool_t *pool);
74
75 /* Set *NODEREV_P to the node-revision for the node ID in FS.  Do any
76    allocations in POOL. */
77 svn_error_t *svn_fs_fs__get_node_revision(node_revision_t **noderev_p,
78                                           svn_fs_t *fs,
79                                           const svn_fs_id_t *id,
80                                           apr_pool_t *pool);
81
82 /* Store NODEREV as the node-revision for the node whose id is ID in
83    FS, after setting its is_fresh_txn_root to FRESH_TXN_ROOT.  Do any
84    necessary temporary allocation in POOL. */
85 svn_error_t *svn_fs_fs__put_node_revision(svn_fs_t *fs,
86                                           const svn_fs_id_t *id,
87                                           node_revision_t *noderev,
88                                           svn_boolean_t fresh_txn_root,
89                                           apr_pool_t *pool);
90
91 /* Write the node-revision NODEREV into the stream OUTFILE, compatible with
92    filesystem format FORMAT.  Only write mergeinfo-related metadata if
93    INCLUDE_MERGEINFO is true.  Temporary allocations are from POOL. */
94 /* ### Currently used only by fs_fs.c */
95 svn_error_t *
96 svn_fs_fs__write_noderev(svn_stream_t *outfile,
97                          node_revision_t *noderev,
98                          int format,
99                          svn_boolean_t include_mergeinfo,
100                          apr_pool_t *pool);
101
102 /* Read a node-revision from STREAM. Set *NODEREV to the new structure,
103    allocated in POOL. */
104 /* ### Currently used only by fs_fs.c */
105 svn_error_t *
106 svn_fs_fs__read_noderev(node_revision_t **noderev,
107                         svn_stream_t *stream,
108                         apr_pool_t *pool);
109
110
111 /* Set *YOUNGEST to the youngest revision in filesystem FS.  Do any
112    temporary allocation in POOL. */
113 svn_error_t *svn_fs_fs__youngest_rev(svn_revnum_t *youngest,
114                                      svn_fs_t *fs,
115                                      apr_pool_t *pool);
116
117 /* Return an error iff REV does not exist in FS. */
118 svn_error_t *
119 svn_fs_fs__revision_exists(svn_revnum_t rev,
120                            svn_fs_t *fs,
121                            apr_pool_t *pool);
122
123 /* Set *ROOT_ID to the node-id for the root of revision REV in
124    filesystem FS.  Do any allocations in POOL. */
125 svn_error_t *svn_fs_fs__rev_get_root(svn_fs_id_t **root_id,
126                                      svn_fs_t *fs,
127                                      svn_revnum_t rev,
128                                      apr_pool_t *pool);
129
130 /* Set *ENTRIES to an apr_hash_t of dirent structs that contain the
131    directory entries of node-revision NODEREV in filesystem FS.  The
132    returned table (and its keys and values) is allocated in POOL,
133    which is also used for temporary allocations. */
134 svn_error_t *svn_fs_fs__rep_contents_dir(apr_hash_t **entries,
135                                          svn_fs_t *fs,
136                                          node_revision_t *noderev,
137                                          apr_pool_t *pool);
138
139 /* Set *DIRENT to the entry identified by NAME in the directory given
140    by NODEREV in filesystem FS.  If no such entry exits, *DIRENT will
141    be NULL. The returned object is allocated in RESULT_POOL; SCRATCH_POOL
142    used for temporary allocations. */
143 svn_error_t *
144 svn_fs_fs__rep_contents_dir_entry(svn_fs_dirent_t **dirent,
145                                   svn_fs_t *fs,
146                                   node_revision_t *noderev,
147                                   const char *name,
148                                   apr_pool_t *result_pool,
149                                   apr_pool_t *scratch_pool);
150
151 /* Set *CONTENTS to be a readable svn_stream_t that receives the text
152    representation of node-revision NODEREV as seen in filesystem FS.
153    Use POOL for temporary allocations. */
154 svn_error_t *svn_fs_fs__get_contents(svn_stream_t **contents,
155                                      svn_fs_t *fs,
156                                      node_revision_t *noderev,
157                                      apr_pool_t *pool);
158
159 /* Attempt to fetch the text representation of node-revision NODEREV as
160    seen in filesystem FS and pass it along with the BATON to the PROCESSOR.
161    Set *SUCCESS only of the data could be provided and the processing
162    had been called.
163    Use POOL for all allocations.
164  */
165 svn_error_t *
166 svn_fs_fs__try_process_file_contents(svn_boolean_t *success,
167                                      svn_fs_t *fs,
168                                      node_revision_t *noderev,
169                                      svn_fs_process_contents_func_t processor,
170                                      void* baton,
171                                      apr_pool_t *pool);
172
173 /* Set *STREAM_P to a delta stream turning the contents of the file SOURCE into
174    the contents of the file TARGET, allocated in POOL.
175    If SOURCE is null, the empty string will be used. */
176 svn_error_t *svn_fs_fs__get_file_delta_stream(svn_txdelta_stream_t **stream_p,
177                                               svn_fs_t *fs,
178                                               node_revision_t *source,
179                                               node_revision_t *target,
180                                               apr_pool_t *pool);
181
182 /* Set *PROPLIST to be an apr_hash_t containing the property list of
183    node-revision NODEREV as seen in filesystem FS.  Use POOL for
184    temporary allocations. */
185 svn_error_t *svn_fs_fs__get_proplist(apr_hash_t **proplist,
186                                      svn_fs_t *fs,
187                                      node_revision_t *noderev,
188                                      apr_pool_t *pool);
189
190 /* Set *PROPLIST to be an apr_hash_t containing the property list of
191    revision REV as seen in filesystem FS.  Use POOL for temporary
192    allocations. */
193 svn_error_t *svn_fs_fs__revision_proplist(apr_hash_t **proplist,
194                                           svn_fs_t *fs,
195                                           svn_revnum_t rev,
196                                           apr_pool_t *pool);
197
198 /* Set *LENGTH to the be fulltext length of the node revision
199    specified by NODEREV.  Use POOL for temporary allocations. */
200 svn_error_t *svn_fs_fs__file_length(svn_filesize_t *length,
201                                     node_revision_t *noderev,
202                                     apr_pool_t *pool);
203
204 /* Return TRUE if the representation keys in A and B both point to the
205    same representation, else return FALSE. */
206 svn_boolean_t svn_fs_fs__noderev_same_rep_key(representation_t *a,
207                                               representation_t *b);
208
209
210 /* Return a copy of the representation REP allocated from POOL. */
211 representation_t *svn_fs_fs__rep_copy(representation_t *rep,
212                                       apr_pool_t *pool);
213
214
215 /* Return the recorded checksum of type KIND for the text representation
216    of NODREV into CHECKSUM, allocating from POOL.  If no stored checksum is
217    available, put all NULL into CHECKSUM. */
218 svn_error_t *svn_fs_fs__file_checksum(svn_checksum_t **checksum,
219                                       node_revision_t *noderev,
220                                       svn_checksum_kind_t kind,
221                                       apr_pool_t *pool);
222
223 /* Find the paths which were changed in revision REV of filesystem FS
224    and store them in *CHANGED_PATHS_P.  Cached copyfrom information
225    will be stored in *COPYFROM_CACHE.  Get any temporary allocations
226    from POOL. */
227 svn_error_t *svn_fs_fs__paths_changed(apr_hash_t **changed_paths_p,
228                                       svn_fs_t *fs,
229                                       svn_revnum_t rev,
230                                       apr_hash_t *copyfrom_cache,
231                                       apr_pool_t *pool);
232
233 /* Create a new transaction in filesystem FS, based on revision REV,
234    and store it in *TXN_P.  Allocate all necessary variables from
235    POOL. */
236 svn_error_t *svn_fs_fs__create_txn(svn_fs_txn_t **txn_p,
237                                    svn_fs_t *fs,
238                                    svn_revnum_t rev,
239                                    apr_pool_t *pool);
240
241 /* Set the transaction property NAME to the value VALUE in transaction
242    TXN.  Perform temporary allocations from POOL. */
243 svn_error_t *svn_fs_fs__change_txn_prop(svn_fs_txn_t *txn,
244                                         const char *name,
245                                         const svn_string_t *value,
246                                         apr_pool_t *pool);
247
248 /* Change transaction properties in transaction TXN based on PROPS.
249    Perform temporary allocations from POOL. */
250 svn_error_t *svn_fs_fs__change_txn_props(svn_fs_txn_t *txn,
251                                          const apr_array_header_t *props,
252                                          apr_pool_t *pool);
253
254 /* Return whether or not the given FS supports mergeinfo metadata. */
255 svn_boolean_t svn_fs_fs__fs_supports_mergeinfo(svn_fs_t *fs);
256
257 /* Store a transaction record in *TXN_P for the transaction identified
258    by TXN_ID in filesystem FS.  Allocate everything from POOL. */
259 svn_error_t *svn_fs_fs__get_txn(transaction_t **txn_p,
260                                 svn_fs_t *fs,
261                                 const char *txn_id,
262                                 apr_pool_t *pool);
263
264 /* Abort the existing transaction TXN, performing any temporary
265    allocations in POOL. */
266 svn_error_t *svn_fs_fs__abort_txn(svn_fs_txn_t *txn, apr_pool_t *pool);
267
268 /* Create an entirely new mutable node in the filesystem FS, whose
269    node-revision is NODEREV.  Set *ID_P to the new node revision's ID.
270    Use POOL for any temporary allocation.  COPY_ID is the copy_id to
271    use in the node revision ID.  TXN_ID is the Subversion transaction
272    under which this occurs. */
273 svn_error_t *svn_fs_fs__create_node(const svn_fs_id_t **id_p,
274                                     svn_fs_t *fs,
275                                     node_revision_t *noderev,
276                                     const char *copy_id,
277                                     const char *txn_id,
278                                     apr_pool_t *pool);
279
280 /* Remove all references to the transaction TXN_ID from filesystem FS.
281    Temporary allocations are from POOL. */
282 svn_error_t *svn_fs_fs__purge_txn(svn_fs_t *fs,
283                                   const char *txn_id,
284                                   apr_pool_t *pool);
285
286 /* Add or set in filesystem FS, transaction TXN_ID, in directory
287    PARENT_NODEREV a directory entry for NAME pointing to ID of type
288    KIND.  Allocations are done in POOL. */
289 svn_error_t *svn_fs_fs__set_entry(svn_fs_t *fs,
290                                   const char *txn_id,
291                                   node_revision_t *parent_noderev,
292                                   const char *name,
293                                   const svn_fs_id_t *id,
294                                   svn_node_kind_t kind,
295                                   apr_pool_t *pool);
296
297 /* Add a change to the changes record for filesystem FS in transaction
298    TXN_ID.  Mark path PATH, having node-id ID, as changed according to
299    the type in CHANGE_KIND.  If the text representation was changed
300    set TEXT_MOD to TRUE, and likewise for PROP_MOD.  If this change
301    was the result of a copy, set COPYFROM_REV and COPYFROM_PATH to the
302    revision and path of the copy source, otherwise they should be set
303    to SVN_INVALID_REVNUM and NULL.  Perform any temporary allocations
304    from POOL. */
305 svn_error_t *svn_fs_fs__add_change(svn_fs_t *fs,
306                                    const char *txn_id,
307                                    const char *path,
308                                    const svn_fs_id_t *id,
309                                    svn_fs_path_change_kind_t change_kind,
310                                    svn_boolean_t text_mod,
311                                    svn_boolean_t prop_mod,
312                                    svn_node_kind_t node_kind,
313                                    svn_revnum_t copyfrom_rev,
314                                    const char *copyfrom_path,
315                                    apr_pool_t *pool);
316
317 /* Return a writable stream in *STREAM that allows storing the text
318    representation of node-revision NODEREV in filesystem FS.
319    Allocations are from POOL. */
320 svn_error_t *svn_fs_fs__set_contents(svn_stream_t **stream,
321                                      svn_fs_t *fs,
322                                      node_revision_t *noderev,
323                                      apr_pool_t *pool);
324
325 /* Create a node revision in FS which is an immediate successor of
326    OLD_ID, whose contents are NEW_NR.  Set *NEW_ID_P to the new node
327    revision's ID.  Use POOL for any temporary allocation.
328
329    COPY_ID, if non-NULL, is a key into the `copies' table, and
330    indicates that this new node is being created as the result of a
331    copy operation, and specifically which operation that was.  If
332    COPY_ID is NULL, then re-use the copy ID from the predecessor node.
333
334    TXN_ID is the Subversion transaction under which this occurs.
335
336    After this call, the deltification code assumes that the new node's
337    contents will change frequently, and will avoid representing other
338    nodes as deltas against this node's contents.  */
339 svn_error_t *svn_fs_fs__create_successor(const svn_fs_id_t **new_id_p,
340                                          svn_fs_t *fs,
341                                          const svn_fs_id_t *old_idp,
342                                          node_revision_t *new_noderev,
343                                          const char *copy_id,
344                                          const char *txn_id,
345                                          apr_pool_t *pool);
346
347 /* Write a new property list PROPLIST for node-revision NODEREV in
348    filesystem FS.  Perform any temporary allocations in POOL. */
349 svn_error_t *svn_fs_fs__set_proplist(svn_fs_t *fs,
350                                      node_revision_t *noderev,
351                                      apr_hash_t *proplist,
352                                      apr_pool_t *pool);
353
354 /* Commit the transaction TXN in filesystem FS and return its new
355    revision number in *REV.  If the transaction is out of date, return
356    the error SVN_ERR_FS_TXN_OUT_OF_DATE.  Use POOL for temporary
357    allocations. */
358 svn_error_t *svn_fs_fs__commit(svn_revnum_t *new_rev_p,
359                                svn_fs_t *fs,
360                                svn_fs_txn_t *txn,
361                                apr_pool_t *pool);
362
363 /* Return the next available copy_id in *COPY_ID for the transaction
364    TXN_ID in filesystem FS.  Allocate space in POOL. */
365 svn_error_t *svn_fs_fs__reserve_copy_id(const char **copy_id,
366                                         svn_fs_t *fs,
367                                         const char *txn_id,
368                                         apr_pool_t *pool);
369
370 /* Create a fs_fs fileysystem referenced by FS at path PATH.  Get any
371    temporary allocations from POOL.
372
373    ### Some parts of *FS must have been initialized beforehand; some parts
374        (including FS->path) are initialized by this function. */
375 svn_error_t *svn_fs_fs__create(svn_fs_t *fs,
376                                const char *path,
377                                apr_pool_t *pool);
378
379 /* Set the uuid of repository FS to UUID, if UUID is not NULL;
380    otherwise, set the uuid of FS to a newly generated UUID.  Perform
381    temporary allocations in POOL. */
382 svn_error_t *svn_fs_fs__set_uuid(svn_fs_t *fs,
383                                  const char *uuid,
384                                  apr_pool_t *pool);
385
386 /* Set *NAMES_P to an array of names which are all the active
387    transactions in filesystem FS.  Allocate the array from POOL. */
388 svn_error_t *svn_fs_fs__list_transactions(apr_array_header_t **names_p,
389                                           svn_fs_t *fs,
390                                           apr_pool_t *pool);
391
392 /* Open the transaction named NAME in filesystem FS.  Set *TXN_P to
393  * the transaction. If there is no such transaction, return
394 ` * SVN_ERR_FS_NO_SUCH_TRANSACTION.  Allocate the new transaction in
395  * POOL. */
396 svn_error_t *svn_fs_fs__open_txn(svn_fs_txn_t **txn_p,
397                                  svn_fs_t *fs,
398                                  const char *name,
399                                  apr_pool_t *pool);
400
401 /* Return the property list from transaction TXN and store it in
402    *PROPLIST.  Allocate the property list from POOL. */
403 svn_error_t *svn_fs_fs__txn_proplist(apr_hash_t **proplist,
404                                      svn_fs_txn_t *txn,
405                                      apr_pool_t *pool);
406
407 /* Delete the mutable node-revision referenced by ID, along with any
408    mutable props or directory contents associated with it.  Perform
409    temporary allocations in POOL. */
410 svn_error_t *svn_fs_fs__delete_node_revision(svn_fs_t *fs,
411                                              const svn_fs_id_t *id,
412                                              apr_pool_t *pool);
413
414
415 /* Find the paths which were changed in transaction TXN_ID of
416    filesystem FS and store them in *CHANGED_PATHS_P.
417    Get any temporary allocations from POOL. */
418 svn_error_t *svn_fs_fs__txn_changes_fetch(apr_hash_t **changes,
419                                           svn_fs_t *fs,
420                                           const char *txn_id,
421                                           apr_pool_t *pool);
422
423
424 /* Set *PATH to the path of REV in FS, whether in a pack file or not.
425    Allocate *PATH in POOL.
426
427    Note: If the caller does not have the write lock on FS, then the path is
428    not guaranteed to be correct or to remain correct after the function
429    returns, because the revision might become packed before or after this
430    call.  If a file exists at that path, then it is correct; if not, then
431    the caller should call update_min_unpacked_rev() and re-try once. */
432 svn_error_t *
433 svn_fs_fs__path_rev_absolute(const char **path,
434                              svn_fs_t *fs,
435                              svn_revnum_t rev,
436                              apr_pool_t *pool);
437
438 /* Return the path to the 'current' file in FS.
439    Perform allocation in POOL. */
440 const char *
441 svn_fs_fs__path_current(svn_fs_t *fs, apr_pool_t *pool);
442
443 /* Obtain a write lock on the filesystem FS in a subpool of POOL, call
444    BODY with BATON and that subpool, destroy the subpool (releasing the write
445    lock) and return what BODY returned. */
446 svn_error_t *
447 svn_fs_fs__with_write_lock(svn_fs_t *fs,
448                            svn_error_t *(*body)(void *baton,
449                                                 apr_pool_t *pool),
450                            void *baton,
451                            apr_pool_t *pool);
452
453 /* Find the value of the property named PROPNAME in transaction TXN.
454    Return the contents in *VALUE_P.  The contents will be allocated
455    from POOL. */
456 svn_error_t *svn_fs_fs__revision_prop(svn_string_t **value_p, svn_fs_t *fs,
457                                       svn_revnum_t rev,
458                                       const char *propname,
459                                       apr_pool_t *pool);
460
461 /* Change, add, or delete a property on a revision REV in filesystem
462    FS.  NAME gives the name of the property, and value, if non-NULL,
463    gives the new contents of the property.  If value is NULL, then the
464    property will be deleted.  If OLD_VALUE_P is not NULL, do nothing unless the
465    preexisting value is *OLD_VALUE_P.  Do any temporary allocation in POOL.  */
466 svn_error_t *svn_fs_fs__change_rev_prop(svn_fs_t *fs, svn_revnum_t rev,
467                                         const char *name,
468                                         const svn_string_t *const *old_value_p,
469                                         const svn_string_t *value,
470                                         apr_pool_t *pool);
471
472 /* Retrieve information about the Subversion transaction SVN_TXN from
473    the `transactions' table of FS, allocating from POOL.  Set
474    *ROOT_ID_P to the ID of the transaction's root directory.  Set
475    *BASE_ROOT_ID_P to the ID of the root directory of the
476    transaction's base revision.
477
478    If there is no such transaction, SVN_ERR_FS_NO_SUCH_TRANSACTION is
479    the error returned.
480
481    Returns SVN_ERR_FS_TRANSACTION_NOT_MUTABLE if TXN_NAME refers to a
482    transaction that has already been committed.
483
484    Allocate *ROOT_ID_P and *BASE_ROOT_ID_P in POOL.  */
485 svn_error_t *svn_fs_fs__get_txn_ids(const svn_fs_id_t **root_id_p,
486                                     const svn_fs_id_t **base_root_id_p,
487                                     svn_fs_t *fs,
488                                     const char *txn_name,
489                                     apr_pool_t *pool);
490
491 /* Begin a new transaction in filesystem FS, based on existing
492    revision REV.  The new transaction is returned in *TXN_P.  Allocate
493    the new transaction structure from POOL. */
494 svn_error_t *svn_fs_fs__begin_txn(svn_fs_txn_t **txn_p, svn_fs_t *fs,
495                                   svn_revnum_t rev, apr_uint32_t flags,
496                                   apr_pool_t *pool);
497
498 /* Find the value of the property named PROPNAME in transaction TXN.
499    Return the contents in *VALUE_P.  The contents will be allocated
500    from POOL. */
501 svn_error_t *svn_fs_fs__txn_prop(svn_string_t **value_p, svn_fs_txn_t *txn,
502                                  const char *propname, apr_pool_t *pool);
503
504 /* If directory PATH does not exist, create it and give it the same
505    permissions as FS_PATH.*/
506 svn_error_t *svn_fs_fs__ensure_dir_exists(const char *path,
507                                           const char *fs_path,
508                                           apr_pool_t *pool);
509
510 /* Update the node origin index for FS, recording the mapping from
511    NODE_ID to NODE_REV_ID.  Use POOL for any temporary allocations.
512
513    Because this is just an "optional" cache, this function does not
514    return an error if the underlying storage is readonly; it still
515    returns an error for other error conditions.
516  */
517 svn_error_t *
518 svn_fs_fs__set_node_origin(svn_fs_t *fs,
519                            const char *node_id,
520                            const svn_fs_id_t *node_rev_id,
521                            apr_pool_t *pool);
522
523 /* Set *ORIGIN_ID to the node revision ID from which the history of
524    all nodes in FS whose "Node ID" is NODE_ID springs, as determined
525    by a look in the index.  ORIGIN_ID needs to be parsed in an
526    FS-backend-specific way.  Use POOL for allocations.
527
528    If there is no entry for NODE_ID in the cache, return NULL
529    in *ORIGIN_ID. */
530 svn_error_t *
531 svn_fs_fs__get_node_origin(const svn_fs_id_t **origin_id,
532                            svn_fs_t *fs,
533                            const char *node_id,
534                            apr_pool_t *pool);
535
536
537 /* Initialize all session-local caches in FS according to the global
538    cache settings. Use POOL for allocations.
539
540    Please note that it is permissible for this function to set some
541    or all of these caches to NULL, regardless of any setting. */
542 svn_error_t *
543 svn_fs_fs__initialize_caches(svn_fs_t *fs, apr_pool_t *pool);
544
545 /* Initialize all transaction-local caches in FS according to the global
546    cache settings and make TXN_ID part of their key space. Use POOL for
547    allocations.
548
549    Please note that it is permissible for this function to set some or all
550    of these caches to NULL, regardless of any setting. */
551 svn_error_t *
552 svn_fs_fs__initialize_txn_caches(svn_fs_t *fs,
553                                  const char *txn_id,
554                                  apr_pool_t *pool);
555
556 /* Resets the svn_cache__t structures local to the current transaction in FS.
557    Calling it more than once per txn or from outside any txn is allowed. */
558 void
559 svn_fs_fs__reset_txn_caches(svn_fs_t *fs);
560
561 /* Possibly pack the repository at PATH.  This just take full shards, and
562    combines all the revision files into a single one, with a manifest header.
563    Use optional CANCEL_FUNC/CANCEL_BATON for cancellation support.
564
565    Existing filesystem references need not change.  */
566 svn_error_t *
567 svn_fs_fs__pack(svn_fs_t *fs,
568                 svn_fs_pack_notify_t notify_func,
569                 void *notify_baton,
570                 svn_cancel_func_t cancel_func,
571                 void *cancel_baton,
572                 apr_pool_t *pool);
573
574
575 #endif