[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r29113 - in branches/svnadmin-upgrade/subversion: libsvn_fs libsvn_fs_base libsvn_fs_fs

From: David Glasser <glasser_at_davidglasser.net>
Date: Thu, 31 Jan 2008 15:35:07 -0800

On Jan 31, 2008 1:03 PM, <cmpilato_at_tigris.org> wrote:
> Author: cmpilato
> Date: Thu Jan 31 13:03:36 2008
> New Revision: 29113
>
> Log:
> On the 'svnadmin-upgrade' branch, only allow FSFS upgrading if the
> caller holds a write lock on the repository.
>
> ### Does this complete the work required for Subversion 1.5? ###

Modulo my minor quibbles below, I think so. (Though I haven't
actually run it yet.)

> * subversion/libsvn_fs/fs-loader.h
> (fs_library_vtable_t): Add 'common_pool' parameter to 'upgrade_fs' member.
>
> * subversion/libsvn_fs/fs-loader.c
> (svn_fs_upgrade): Update call to FS vtable's upgrade_fs() function.
>
> * subversion/libsvn_fs_fs/fs_fs.h
> (svn_fs_fs__upgrade): Lose 'path' parameter for an 'fs' instead.
>
> * subversion/libsvn_fs_fs/fs_fs.c
> (upgrade_body): New; now holds all the real upgrade-y stuff that
> used to live in svn_fs_fs__upgrade.
> (svn_fs_fs__upgrade): Lose 'path' parameter for an 'fs' instead.
> Now just a thin wrapper around a call to the svn_fs_fs__with_write_lock()
> function and, ultimately, upgrade_body().
>
> * subversion/libsvn_fs_fs/fs.c
> (fs_upgrade): New function.
> (library_vtable): Plug 'fs_upgrade' in for the 'upgrade_fs' vtable
> entry (instead of svn_fs_fs__upgrade().
>
> * subversion/libsvn_fs_base/fs.c
> (base_upgrade): Add 'fs' and 'common_pool' parameters (ignored).
>
> Suggested by: glasser

> Modified: branches/svnadmin-upgrade/subversion/libsvn_fs_fs/fs.c
> URL: http://svn.collab.net/viewvc/svn/branches/svnadmin-upgrade/subversion/libsvn_fs_fs/fs.c?pathrev=29113&r1=29112&r2=29113
> ==============================================================================
> --- branches/svnadmin-upgrade/subversion/libsvn_fs_fs/fs.c (original)
> +++ branches/svnadmin-upgrade/subversion/libsvn_fs_fs/fs.c Thu Jan 31 13:03:36 2008
> @@ -236,6 +236,21 @@
>
>
>
> +/* This implements the fs_library_vtable_t.uprade_fs() API. */

"upgrade_fs"

> +static svn_error_t *
> +fs_upgrade(svn_fs_t *fs, const char *path, apr_pool_t *pool,
> + apr_pool_t *common_pool)
> +{
> + SVN_ERR(svn_fs__check_fs(fs, FALSE));
> + initialize_fs_struct(fs);
> + SVN_ERR(svn_fs_fs__open(fs, path, pool));
> + SVN_ERR(fs_serialized_init(fs, common_pool, pool));
> + return svn_fs_fs__upgrade(fs, pool);
> +}
> +
> +
> +
> +
> /* This implements the fs_library_vtable_t.hotcopy() API. Copy a
> possibly live Subversion filesystem from SRC_PATH to DEST_PATH.
> The CLEAN_LOGS argument is ignored and included for Subversion
> @@ -301,7 +316,7 @@
> fs_create,
> fs_open,
> fs_open_for_recovery,
> - svn_fs_fs__upgrade,
> + fs_upgrade,
> fs_delete_fs,
> fs_hotcopy,
> fs_get_description,
>
> Modified: branches/svnadmin-upgrade/subversion/libsvn_fs_fs/fs_fs.c
> URL: http://svn.collab.net/viewvc/svn/branches/svnadmin-upgrade/subversion/libsvn_fs_fs/fs_fs.c?pathrev=29113&r1=29112&r2=29113
> ==============================================================================
> --- branches/svnadmin-upgrade/subversion/libsvn_fs_fs/fs_fs.c (original)
> +++ branches/svnadmin-upgrade/subversion/libsvn_fs_fs/fs_fs.c Thu Jan 31 13:03:36 2008
> @@ -1013,15 +1013,12 @@
> }
>
>
> -svn_error_t *
> -svn_fs_fs__upgrade(const char *path, apr_pool_t *pool)
> +static svn_error_t *
> +upgrade_body(void *baton, apr_pool_t *pool)
> {
> + svn_fs_t *fs = baton;
> int format, max_files_per_dir;
> - const char *format_path = svn_path_join(path, PATH_FORMAT, pool);
> -
> - /* We need to actually do real upgrade work here before claiming
> - it's done! */
> - return svn_error_create(SVN_ERR_FS_UNSUPPORTED_UPGRADE, NULL, NULL);
> + const char *format_path = path_format(fs, pool);
>
> /* Read the FS format number and max-files-per-dir setting. */
> SVN_ERR(read_format(&format, &max_files_per_dir, format_path, pool));
> @@ -1034,20 +1031,19 @@
> file', make that file and its corresponding lock file. */
> if (format < SVN_FS_FS__MIN_TXN_CURRENT_FORMAT)
> {
> - SVN_ERR(svn_io_file_create(svn_path_join(path, PATH_TXN_CURRENT, pool),
> - "0\n", pool));
> - SVN_ERR(svn_io_file_create(svn_path_join(path, PATH_TXN_CURRENT_LOCK,
> - pool),
> - "", pool));
> + SVN_ERR(svn_io_file_create(path_txn_current(fs, pool), "0\n", pool));
> + SVN_ERR(svn_io_file_create(path_txn_current_lock(fs, pool), "", pool));
> }
>
> /* If our filesystem predates the existance of the 'txn-protorevs'
> dir, make that directory. */
> if (format < SVN_FS_FS__MIN_PROTOREVS_DIR_FORMAT)
> - SVN_ERR(svn_io_make_dir_recursively(svn_path_join(path,
> - PATH_TXN_PROTOS_DIR,
> - pool),
> - pool));
> + {
> + /* We don't use path_txn_proto_rev() here because it expects
> + we've already bumped our format. */

Slightly misleading comment: you don't use path_txn_proto_rev because
it doesn't actually tell you what you need (it takes a specific txn as
argument).

> + SVN_ERR(svn_io_make_dir_recursively
> + (svn_path_join(fs->path, PATH_TXN_PROTOS_DIR, pool), pool));
> + }
>
> /* Bump the format file. We pass 0 for the max_files_per_dir here
> so we don't have to fuss with sharding directories ourselves. */
> @@ -1058,6 +1054,

-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-02-01 00:35:19 CET

This is an archived mail posted to the Subversion Dev mailing list.