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

Re: svn commit: r1483999 - /subversion/trunk/subversion/libsvn_subr/io.c

From: Ivan Zhakov <ivan_at_visualsvn.com>
Date: Sat, 18 May 2013 02:01:51 +0400

On Sat, May 18, 2013 at 1:33 AM, <rhuijben_at_apache.org> wrote:
> Author: rhuijben
> Date: Fri May 17 21:33:09 2013
> New Revision: 1483999
>
> URL: http://svn.apache.org/r1483999
> Log:
> * subversion/libsvn_subr/io.c
> (svn_io_file_flush_to_disk): Add note.
> (svn_io_write_unique): Differentiate file flush behavior on whether the file
> is temporary or not.
>
> Modified:
> subversion/trunk/subversion/libsvn_subr/io.c
>
> Modified: subversion/trunk/subversion/libsvn_subr/io.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/io.c?rev=1483999&r1=1483998&r2=1483999&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_subr/io.c (original)
> +++ subversion/trunk/subversion/libsvn_subr/io.c Fri May 17 21:33:09 2013
> @@ -2091,6 +2091,10 @@ svn_error_t *svn_io_file_flush_to_disk(a
> {
> apr_os_file_t filehand;
>
> + /* ### In apr 1.4+ we could delegate most of this function to
> + apr_file_sync(). The only major difference is that this doesn't
> + contain the retry loop for EINTR on linux. */
> +
> /* First make sure that any user-space buffered data is flushed. */
> SVN_ERR(do_io_file_wrapper_cleanup(file, apr_file_flush(file),
> N_("Can't flush file '%s'"),
> @@ -3483,7 +3487,15 @@ svn_io_write_unique(const char **tmp_pat
> err = svn_io_file_write_full(new_file, buf, nbytes, NULL, pool);
>
> if (!err)
> - err = svn_io_file_flush_to_disk(new_file, pool);
> + {
> + /* svn_io_file_flush_to_disk() can be very expensive, so use the
> + cheaper standard flush if the file is created as temporary file
> + anyway */
> + if (delete_when == svn_io_file_del_none)
> + err = svn_io_file_flush_to_disk(new_file, pool);
> + else
> + err = svn_io_file_flush(new_file, pool);
> + }
Using delete_when for differentiate flush behavior is looks very
strange. Why you didn't add separate boolean argument for this?

-- 
Ivan Zhakov
CTO | VisualSVN | http://www.visualsvn.com
Received on 2013-05-18 00:02:41 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.