svn_error_t * svn_fs_create(svn_fs_t **fs_p, const char *path, apr_hash_t *fs_config, apr_pool_t *pool) { svn_error_t *err; svn_error_t *err2; fs_library_vtable_t *vtable; const char *fs_type = svn_hash__get_cstring(fs_config, SVN_FS_CONFIG_FS_TYPE, DEFAULT_FS_TYPE); SVN_ERR(get_library_vtable(&vtable, fs_type, pool)); /* Create the FS directory and write out the fsap-name file. */ SVN_ERR(svn_io_dir_make_sgid(path, APR_OS_DEFAULT, pool)); SVN_ERR(write_fs_type(path, fs_type, pool)); /* Perform the actual creation. */ *fs_p = fs_new(fs_config, pool); SVN_ERR(acquire_fs_mutex()); err = vtable->create(*fs_p, path, pool, common_pool); err2 = release_fs_mutex(); if (err) { svn_error_clear(err2); return svn_error_trace(err); } return svn_error_trace(err2); }
svn_error_t * svn_fs_create_berkeley(svn_fs_t *fs, const char *path) { fs_library_vtable_t *vtable; SVN_ERR(get_library_vtable(&vtable, SVN_FS_TYPE_BDB, fs->pool)); /* Create the FS directory and write out the fsap-name file. */ SVN_ERR(svn_io_dir_make_sgid(path, APR_OS_DEFAULT, fs->pool)); SVN_ERR(write_fs_type(path, SVN_FS_TYPE_BDB, fs->pool)); /* Perform the actual creation. */ SVN_MUTEX__WITH_LOCK(common_pool_lock, vtable->create(fs, path, fs->pool, common_pool)); return SVN_NO_ERROR; }
svn_error_t * svn_fs_create(svn_fs_t **fs_p, const char *path, apr_hash_t *fs_config, apr_pool_t *pool) { fs_library_vtable_t *vtable; const char *fs_type = svn_hash__get_cstring(fs_config, SVN_FS_CONFIG_FS_TYPE, DEFAULT_FS_TYPE); SVN_ERR(get_library_vtable(&vtable, fs_type, pool)); /* Create the FS directory and write out the fsap-name file. */ SVN_ERR(svn_io_dir_make_sgid(path, APR_OS_DEFAULT, pool)); SVN_ERR(write_fs_type(path, fs_type, pool)); /* Perform the actual creation. */ *fs_p = fs_new(fs_config, pool); SVN_MUTEX__WITH_LOCK(common_pool_lock, vtable->create(*fs_p, path, pool, common_pool)); return SVN_NO_ERROR; }
svn_error_t * svn_fs_create_berkeley(svn_fs_t *fs, const char *path) { svn_error_t *err; svn_error_t *err2; fs_library_vtable_t *vtable; SVN_ERR(get_library_vtable(&vtable, SVN_FS_TYPE_BDB, fs->pool)); /* Create the FS directory and write out the fsap-name file. */ SVN_ERR(svn_io_dir_make_sgid(path, APR_OS_DEFAULT, fs->pool)); SVN_ERR(write_fs_type(path, SVN_FS_TYPE_BDB, fs->pool)); /* Perform the actual creation. */ SVN_ERR(acquire_fs_mutex()); err = vtable->create(fs, path, fs->pool, common_pool); err2 = release_fs_mutex(); if (err) { svn_error_clear(err2); return svn_error_trace(err); } return svn_error_trace(err2); }