aboutsummaryrefslogtreecommitdiffstats
path: root/subversion/libsvn_fs_fs/fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'subversion/libsvn_fs_fs/fs.c')
-rw-r--r--subversion/libsvn_fs_fs/fs.c84
1 files changed, 82 insertions, 2 deletions
diff --git a/subversion/libsvn_fs_fs/fs.c b/subversion/libsvn_fs_fs/fs.c
index 508ecdbaba33..5174da2e4941 100644
--- a/subversion/libsvn_fs_fs/fs.c
+++ b/subversion/libsvn_fs_fs/fs.c
@@ -47,6 +47,7 @@
#include "verify.h"
#include "svn_private_config.h"
#include "private/svn_fs_util.h"
+#include "private/svn_fs_fs_private.h"
#include "../libsvn_fs/fs-loader.h"
@@ -254,6 +255,83 @@ fs_set_uuid(svn_fs_t *fs,
}
+static svn_error_t *
+fs_ioctl(svn_fs_t *fs, svn_fs_ioctl_code_t ctlcode,
+ void *input_void, void **output_p,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ if (strcmp(ctlcode.fs_type, SVN_FS_TYPE_FSFS) == 0)
+ {
+ if (ctlcode.code == SVN_FS_FS__IOCTL_GET_STATS.code)
+ {
+ svn_fs_fs__ioctl_get_stats_input_t *input = input_void;
+ svn_fs_fs__ioctl_get_stats_output_t *output;
+
+ output = apr_pcalloc(result_pool, sizeof(*output));
+ SVN_ERR(svn_fs_fs__get_stats(&output->stats, fs,
+ input->progress_func,
+ input->progress_baton,
+ cancel_func, cancel_baton,
+ result_pool, scratch_pool));
+ *output_p = output;
+ return SVN_NO_ERROR;
+ }
+ else if (ctlcode.code == SVN_FS_FS__IOCTL_DUMP_INDEX.code)
+ {
+ svn_fs_fs__ioctl_dump_index_input_t *input = input_void;
+
+ SVN_ERR(svn_fs_fs__dump_index(fs, input->revision,
+ input->callback_func,
+ input->callback_baton,
+ cancel_func, cancel_baton,
+ scratch_pool));
+ *output_p = NULL;
+ return SVN_NO_ERROR;
+ }
+ else if (ctlcode.code == SVN_FS_FS__IOCTL_LOAD_INDEX.code)
+ {
+ svn_fs_fs__ioctl_load_index_input_t *input = input_void;
+
+ SVN_ERR(svn_fs_fs__load_index(fs, input->revision, input->entries,
+ scratch_pool));
+ *output_p = NULL;
+ return SVN_NO_ERROR;
+ }
+ else if (ctlcode.code == SVN_FS_FS__IOCTL_REVISION_SIZE.code)
+ {
+ svn_fs_fs__ioctl_revision_size_input_t *input = input_void;
+ svn_fs_fs__ioctl_revision_size_output_t *output
+ = apr_pcalloc(result_pool, sizeof(*output));
+
+ SVN_ERR(svn_fs_fs__revision_size(&output->rev_size,
+ fs, input->revision,
+ scratch_pool));
+ *output_p = output;
+ return SVN_NO_ERROR;
+ }
+ else if (ctlcode.code == SVN_FS_FS__IOCTL_BUILD_REP_CACHE.code)
+ {
+ svn_fs_fs__ioctl_build_rep_cache_input_t *input = input_void;
+
+ SVN_ERR(svn_fs_fs__build_rep_cache(fs,
+ input->start_rev,
+ input->end_rev,
+ input->progress_func,
+ input->progress_baton,
+ cancel_func,
+ cancel_baton,
+ scratch_pool));
+
+ *output_p = NULL;
+ return SVN_NO_ERROR;
+ }
+ }
+
+ return svn_error_create(SVN_ERR_FS_UNRECOGNIZED_IOCTL_CODE, NULL, NULL);
+}
/* The vtable associated with a specific open filesystem. */
static fs_vtable_t fs_vtable = {
@@ -279,7 +357,8 @@ static fs_vtable_t fs_vtable = {
fs_info,
svn_fs_fs__verify_root,
fs_freeze,
- fs_set_errcall
+ fs_set_errcall,
+ fs_ioctl
};
@@ -602,7 +681,8 @@ static fs_library_vtable_t library_vtable = {
fs_logfiles,
NULL /* parse_id */,
fs_set_svn_fs_open,
- fs_info_dup
+ fs_info_dup,
+ NULL /* ioctl */
};
svn_error_t *