subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kot...@apache.org
Subject svn commit: r1759405 - in /subversion/trunk/subversion/libsvn_fs_fs: pack.c revprops.c
Date Tue, 06 Sep 2016 10:36:57 GMT
Author: kotkov
Date: Tue Sep  6 10:36:56 2016
New Revision: 1759405

URL: http://svn.apache.org/viewvc?rev=1759405&view=rev
Log:
In fsfs pack, use unbuffered file streams in a couple of places when we
only need to copy the contents using svn_stream_copy3().

The svn_stream_copy3() function uses 16 KB chunks, so passing the data
through the internal 4 KB APR file buffers is unnecessary in these cases.

* subversion/libsvn_fs_fs/pack.c
  (pack_phys_addressed): Use an unbuffered file stream.

* subversion/libsvn_fs_fs/revprops.c
  (svn_fs_fs__copy_revprops): Same.

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/pack.c
    subversion/trunk/subversion/libsvn_fs_fs/revprops.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=1759405&r1=1759404&r2=1759405&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/pack.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/pack.c Tue Sep  6 10:36:56 2016
@@ -1732,6 +1732,7 @@ pack_phys_addressed(const char *pack_fil
       svn_stream_t *rev_stream;
       const char *path;
       apr_off_t offset;
+      apr_file_t *rev_file;
 
       svn_pool_clear(iterpool);
 
@@ -1745,8 +1746,12 @@ pack_phys_addressed(const char *pack_fil
       SVN_ERR(svn_stream_printf(manifest_stream, iterpool,
                                 "%" APR_OFF_T_FMT "\n", offset));
 
-      /* Copy all the bits from the rev file to the end of the pack file. */
-      SVN_ERR(svn_stream_open_readonly(&rev_stream, path, iterpool, iterpool));
+      /* Copy all the bits from the rev file to the end of the pack file.
+       * Use unbuffered apr_file_t since we're going to write using 16kb
+       * chunks. */
+      SVN_ERR(svn_io_file_open(&rev_file, path, APR_READ, APR_OS_DEFAULT,
+                               iterpool));
+      rev_stream = svn_stream_from_aprfile2(rev_file, FALSE, iterpool);
       SVN_ERR(svn_stream_copy3(rev_stream,
                                svn_stream_from_aprfile2(pack_file, TRUE,
                                                         iterpool),

Modified: subversion/trunk/subversion/libsvn_fs_fs/revprops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/revprops.c?rev=1759405&r1=1759404&r2=1759405&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/revprops.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/revprops.c Tue Sep  6 10:36:56 2016
@@ -1286,6 +1286,7 @@ svn_fs_fs__copy_revprops(const char *pac
     {
       const char *path;
       svn_stream_t *stream;
+      apr_file_t *file;
 
       svn_pool_clear(iterpool);
 
@@ -1294,8 +1295,11 @@ svn_fs_fs__copy_revprops(const char *pac
                              iterpool);
 
       /* Copy all the bits from the non-packed revprop file to the end of
-       * the pack file. */
-      SVN_ERR(svn_stream_open_readonly(&stream, path, iterpool, iterpool));
+       * the pack file.  Use unbuffered apr_file_t since we're going to
+       * write using 16kb chunks. */
+      SVN_ERR(svn_io_file_open(&file, path, APR_READ, APR_OS_DEFAULT,
+                               iterpool));
+      stream = svn_stream_from_aprfile2(file, FALSE, iterpool);
       SVN_ERR(svn_stream_copy3(stream, pack_stream,
                                cancel_func, cancel_baton, iterpool));
     }



Mime
View raw message