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

Re: svn commit: r1764676 - /subversion/trunk/subversion/libsvn_fs_fs/pack.c

From: Ivan Zhakov <ivan_at_visualsvn.com>
Date: Thu, 13 Oct 2016 16:36:34 +0200

On 13 October 2016 at 15:49, <stefan2_at_apache.org> wrote:
> Author: stefan2
> Date: Thu Oct 13 13:49:47 2016
> New Revision: 1764676
>
> URL: http://svn.apache.org/viewvc?rev=1764676&view=rev
> Log:
> Make the FSFS pack no longer depend on a working file trunc() operation.
>
> * subversion/libsvn_fs_fs/pack.c
> (reset_pack_context): Instead of emptying the temporary files, close,
> auto-delete and re-create them.
>
> Modified:
> subversion/trunk/subversion/libsvn_fs_fs/pack.c
>
> Modified: subversion/trunk/subversion/libsvn_fs_fs/pack.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/pack.c?rev=1764676&r1=1764675&r2=1764676&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_fs_fs/pack.c (original)
> +++ subversion/trunk/subversion/libsvn_fs_fs/pack.c Thu Oct 13 13:49:47 2016
> @@ -341,20 +341,38 @@ static svn_error_t *
> reset_pack_context(pack_context_t *context,
> apr_pool_t *pool)
> {
> + const char *temp_dir;
> +
> apr_array_clear(context->changes);
> - SVN_ERR(svn_io_file_trunc(context->changes_file, 0, pool));
> + SVN_ERR(svn_io_file_close(context->changes_file, pool));
> apr_array_clear(context->file_props);
> - SVN_ERR(svn_io_file_trunc(context->file_props_file, 0, pool));
> + SVN_ERR(svn_io_file_close(context->file_props_file, pool));
> apr_array_clear(context->dir_props);
> - SVN_ERR(svn_io_file_trunc(context->dir_props_file, 0, pool));
> + SVN_ERR(svn_io_file_close(context->dir_props_file, pool));
>
> apr_array_clear(context->rev_offsets);
> apr_array_clear(context->path_order);
> apr_array_clear(context->references);
> apr_array_clear(context->reps);
> - SVN_ERR(svn_io_file_trunc(context->reps_file, 0, pool));
> + SVN_ERR(svn_io_file_close(context->reps_file, pool));
>
> svn_pool_clear(context->info_pool);
> +
> + /* The new temporary files must live at least as long as any other info
> + * object in CONTEXT. */
> + SVN_ERR(svn_io_temp_dir(&temp_dir, pool));
> + SVN_ERR(svn_io_open_unique_file3(&context->changes_file, NULL, temp_dir,
> + svn_io_file_del_on_close,
> + context->info_pool, pool));
> + SVN_ERR(svn_io_open_unique_file3(&context->file_props_file, NULL, temp_dir,
> + svn_io_file_del_on_close,
> + context->info_pool, pool));
> + SVN_ERR(svn_io_open_unique_file3(&context->dir_props_file, NULL, temp_dir,
> + svn_io_file_del_on_close,
> + context->info_pool, pool));
> + SVN_ERR(svn_io_open_unique_file3(&context->reps_file, NULL, temp_dir,
> + svn_io_file_del_on_close,
> + context->info_pool, pool));
Probably we should update code in initialize_pack_context() to use
CONTEX->INFO_POOL when opening these files initially?

-- 
Ivan Zhakov
Received on 2016-10-13 16:36:58 CEST

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