Reimplement fsfs private operations required by `svnfsfs` (stats, dump index, load index) as "ioctls".
Technically we achieve this by introducing the new svn_fs_ioctl() API that adds a generic way of performing backend-specific I/O operations.
This change serves two purposes:
- It allows us to properly expose FS-specific details and invoke FS-specific operations everywhere without necessarily promoting them into a proper public API (the ioctl code itself may be made either public or private, depending on the requirements).
- It solves a potential dependency/linking problem where tools like `svnfsfs` work through the libsvn_fs's loader, but also have to load and call private APIs from libsvn_fs_fs thus ignoring the loader. The latter part may potentially cause issues with the global shared state, etc. With the patch, all such operations always go through the FS loader.
* subversion/include/svn_error_codes.h (SVN_ERR_FS_UNRECOGNIZED_IOCTL_CODE): New error code.
* subversion/include/private/svn_fs_fs_private.h (svn_fs_fs__get_stats, svn_fs_fs__dump_index, svn_fs_fs__load_index): These functions are now implemented as... (SVN_FS_FS__IOCTL_GET_STATS, SVN_FS_FS__IOCTL_DUMP_INDEX, SVN_FS_FS__IOCTL_LOAD_INDEX): ...these new ioctls, which ... (svn_fs_fs__ioctl_get_stats_input_t, svn_fs_fs__ioctl_get_stats_output_t, svn_fs_fs__ioctl_dump_index_input_t, svn_fs_fs__ioctl_load_index_input_t): ...use these new structures.
* subversion/libsvn_fs/fs-loader.h (fs_library_vtable_t.ioctl, fs_vtable_t.ioctl): New vtable members.
* subversion/libsvn_fs/fs-loader.c (svn_fs_ioctl): Implement the new API by forwarding it to an appropriate vtable member.
* subversion/libsvn_fs_fs/fs_fs.h (svn_fs_fs__get_stats, svn_fs_fs__dump_index, svn_fs_fs__load_index): These functions are now declared here.
* subversion/libsvn_fs_fs/fs.c (): Include `svn_fs_fs_private.h`. (fs_ioctl): Implement the ioctl dispatcher for three current fsfs-specific operations. (fs_vtable): Initialize the `ioctl` field. (library_vtable): Initialize the `ioctl` field to NULL.
First step towards making svn_ra_get_mergeinfo streamy instead of using unbound amounts of memory.
The server-side implementation of svn_ra_get_mergeinfo does not scale well as it collects all m/i into a catalog first before sending the data over the wire. Using callbacks to process the mergeinfo immediately at the point it was found will fix this issue.
In this first step, we switch the FS API layer to using callbacks.
* subversion/include/svn_fs.h (svn_fs_mergeinfo_receiver_t): Declare new callback. (svn_fs_get_mergeinfo3, svn_fs_get_mergeinfo2): Bump API.
* subversion/libsvn_fs/deprecated.c (mergeinfo_receiver, svn_fs_get_mergeinfo2): Implement the old API in terms of the new one.
* subversion/libsvn_fs/fs-loader.h (root_vtable_t): Adapt the FS Vtable to mirror the API change.
* subversion/libsvn_fs/fs-loader.c (svn_fs_get_mergeinfo3): The bumped API replaces ... (svn_fs_get_mergeinfo2): ... this old one.
* subversion/libsvn_fs_fs/tree.c (crawl_directory_dag_for_mergeinfo): Invoke the receiver callback instead of accumulating the result. No more need for the RESULT_POOL, either. (add_descendant_mergeinfo): Pass new signature through. (get_mergeinfos_for_paths): Invoke the receiver callback instead of accumulating the result. No more need for the RESULT_POOL, either. (fs_get_mergeinfo): Pass new signature through.
* subversion/libsvn_fs_x/tree.c (crawl_directory_dag_for_mergeinfo, add_descendant_mergeinfo, get_mergeinfos_for_paths, x_get_mergeinfo): Same changes as for FSFS.
* subversion/libsvn_fs_base/tree.c (get_mergeinfo_data_and_entries_baton, txn_body_get_mergeinfo_data_and_entries, crawl_directory_for_mergeinfo, get_mergeinfos_for_paths): Invoke the receiver callback instead of accumulating the result. No more need for the RESULT_POOL, either. (base_get_mergeinfo): Pass new signature through.