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.
Restore the 1.8 behavior of svn_fs_contents_changed() and _props_changed() API. Switch all calling sites of the new API, svn_fs_contents_different() and _props_different(), back to using the old functions.
There are no user-visible problems associated with the old code. The new API doesn't improve any real use cases in the current code, but is causing problems:
- We could experience same problems originating from other callers of the new API, because the low level behavior change associated with switching to it propagates up to higher levels like svn_repos or svn_ra and alters the behavior of many different callers like svn_ra_get_file_revs2() or the update reporter. Third-party API callers could not be ready for it as well, because public API functions like svn_ra_get_file_revs2() didn't receive an erratum or a bump.
* subversion/libsvn_fs_base/dag.c (svn_fs_base__things_different): Compare the uniquifiers, as we did in 1.8.
* subversion/libsvn_fs_base/fs.h (node_revision_t.data_key_uniquifier): Remove the comment about not using this field.
* subversion/libsvn_fs_fs/fs_fs.c (svn_fs_fs__noderev_same_rep_key): Reintroduce this helper function. (svn_fs_fs__file_text_rep_equal, svn_fs_fs__prop_rep_equal): Always assume the strict mode in these helpers.
* subversion/libsvn_fs_fs/fs_fs.h (svn_fs_fs__noderev_same_rep_key): Declare this re-added helper. (svn_fs_fs__file_text_rep_equal, svn_fs_fs__prop_rep_equal): Update the docstrings for these helper functions.
* subversion/libsvn_fs_fs/dag.c (svn_fs_fs__dag_things_different): Preserve the current comparison behavior in strict mode. Restore the 1.8 way of comparing the representation keys in non-strict mode.
* subversion/libsvn_fs_fs/tree.c (merge): Restore the 1.8 way of comparing property lists.
* subversion/libsvn_fs_fs/fs.h (representation_t.uniquifier): Remove the comment about not using this field.
* subversion/libsvn_repos/delta.c (delta_proplists): Switch back to using svn_fs_props_changed(). (svn_repos__compare_files): Restore this function to its 1.8 state. (delta_files): Restore the 1.8 way of comparing files.
* subversion/libsvn_repos/dump.c (dump_node): Switch back to using svn_fs_contents_changed() and svn_fs_props_changed().
* subversion/libsvn_repos/reporter.c (delta_proplists): Switch back to using svn_fs_props_changed().
* subversion/libsvn_repos/rev_hunt.c (send_path_revision): Switch back to using svn_fs_contents_changed(). Remove the no longer necessary hack for svn blame -g with older clients.
* subversion/include/svn_ra.h (svn_ra_get_file_revs2): Update @note in the docstring.
* subversion/include/svn_repos.h (svn_repos_get_file_revs2): Update @note in the docstring.
* subversion/tests/cmdline/svnadmin_tests.py (dump_no_op_change): No longer fails with fsfs and bdb.