subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1662939 - in /subversion/branches/fsx-1.10/subversion/libsvn_fs_x: cached_data.c pack.c rev_file.c rev_file.h
Date Sat, 28 Feb 2015 13:36:53 GMT
Author: stefan2
Date: Sat Feb 28 13:36:53 2015
New Revision: 1662939

URL: http://svn.apache.org/r1662939
Log:
On the fsx-1.10 branch:
Add an access function for svn_fs_x__revision_file_t's stream element.
Make all callers use that instead of accessing the struct directly.

* subversion/libsvn_fs_x/rev_file.h
  (svn_fs_x__rev_file_stream): Declare new access function.

* subversion/libsvn_fs_x/rev_file.c
  (svn_fs_x__rev_file_stream): Implement it.

* subversion/libsvn_fs_x/cached_data.c
  (create_rep_state_body,
   read_delta_window,
   cache_windows,
   read_rep_header): Use the new access function.

* subversion/libsvn_fs_x/pack.c
  (copy_rep_to_temp,
   copy_node_to_temp): Same.

Modified:
    subversion/branches/fsx-1.10/subversion/libsvn_fs_x/cached_data.c
    subversion/branches/fsx-1.10/subversion/libsvn_fs_x/pack.c
    subversion/branches/fsx-1.10/subversion/libsvn_fs_x/rev_file.c
    subversion/branches/fsx-1.10/subversion/libsvn_fs_x/rev_file.h

Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/cached_data.c?rev=1662939&r1=1662938&r2=1662939&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/cached_data.c (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/cached_data.c Sat Feb 28 13:36:53
2015
@@ -639,6 +639,8 @@ create_rep_state_body(rep_state_t **rep_
   /* read rep header, if necessary */
   if (!is_cached)
     {
+      svn_stream_t *stream;
+
       /* we will need the on-disk location for non-txn reps */
       apr_off_t offset;
       svn_boolean_t in_container = TRUE;
@@ -693,7 +695,8 @@ create_rep_state_body(rep_state_t **rep_
           SVN_ERR(svn_fs_x__rev_file_seek(rs->sfile->rfile, NULL, offset));
         }
 
-      SVN_ERR(svn_fs_x__read_rep_header(&rh, rs->sfile->rfile->stream,
+      SVN_ERR(svn_fs_x__rev_file_stream(&stream, rs->sfile->rfile));
+      SVN_ERR(svn_fs_x__read_rep_header(&rh, stream,
                                         result_pool, scratch_pool));
       SVN_ERR(svn_fs_x__rev_file_offset(&rs->start, rs->sfile->rfile));
 
@@ -1323,6 +1326,7 @@ read_delta_window(svn_txdelta_window_t *
   apr_off_t start_offset;
   apr_off_t end_offset;
   apr_pool_t *iterpool;
+  svn_stream_t *stream;
   svn_fs_x__revision_file_t *file;
 
   SVN_ERR_ASSERT(rs->chunk_index <= this_chunk);
@@ -1389,7 +1393,8 @@ read_delta_window(svn_txdelta_window_t *
   svn_pool_destroy(iterpool);
 
   /* Actually read the next window. */
-  SVN_ERR(svn_txdelta_read_svndiff_window(nwin, file->stream, rs->ver,
+  SVN_ERR(svn_fs_x__rev_file_stream(&stream, file));
+  SVN_ERR(svn_txdelta_read_svndiff_window(nwin, stream, rs->ver,
                                           result_pool));
   SVN_ERR(svn_fs_x__rev_file_offset(&end_offset, file));
   rs->current = end_offset - rs->start;
@@ -1651,16 +1656,17 @@ cache_windows(svn_filesize_t *fulltext_l
       else
         {
           svn_txdelta_window_t *window;
+          svn_fs_x__revision_file_t *file = rs->sfile->rfile;
+          svn_stream_t *stream;
           apr_off_t start_offset = rs->start + rs->current;
           apr_off_t end_offset;
           apr_off_t block_start;
 
           /* navigate to & read the current window */
-          SVN_ERR(svn_fs_x__rev_file_seek(rs->sfile->rfile, &block_start,
-                                          start_offset));
-          SVN_ERR(svn_txdelta_read_svndiff_window(&window,
-                                                  rs->sfile->rfile->stream,
-                                                  rs->ver, iterpool));
+          SVN_ERR(svn_fs_x__rev_file_stream(&stream, file));
+          SVN_ERR(svn_fs_x__rev_file_seek(file, &block_start, start_offset));
+          SVN_ERR(svn_txdelta_read_svndiff_window(&window, stream, rs->ver,
+                                                  iterpool));
 
           /* aggregate expanded window size */
           *fulltext_len += window->tview_len;
@@ -1700,6 +1706,7 @@ read_rep_header(svn_fs_x__rep_header_t *
                 apr_pool_t *pool)
 {
   svn_fs_x__data_t *ffd = fs->fsap_data;
+  svn_stream_t *stream;
   svn_boolean_t is_cached = FALSE;
   
   if (ffd->rep_header_cache)
@@ -1710,7 +1717,8 @@ read_rep_header(svn_fs_x__rep_header_t *
         return SVN_NO_ERROR;
     }
 
-  SVN_ERR(svn_fs_x__read_rep_header(rep_header, file->stream, pool, pool));
+  SVN_ERR(svn_fs_x__rev_file_stream(&stream, file));
+  SVN_ERR(svn_fs_x__read_rep_header(rep_header, stream, pool, pool));
 
   if (ffd->rep_header_cache)
     SVN_ERR(svn_cache__set(ffd->rep_header_cache, key, *rep_header, pool));

Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/pack.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/pack.c?rev=1662939&r1=1662938&r2=1662939&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/pack.c (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/pack.c Sat Feb 28 13:36:53 2015
@@ -567,6 +567,7 @@ copy_rep_to_temp(pack_context_t *context
                  apr_pool_t *scratch_pool)
 {
   svn_fs_x__rep_header_t *rep_header;
+  svn_stream_t *stream;
   apr_off_t source_offset = entry->offset;
 
   /* create a copy of ENTRY, make it point to the copy destination and
@@ -577,7 +578,8 @@ copy_rep_to_temp(pack_context_t *context
   add_item_rep_mapping(context, entry);
 
   /* read & parse the representation header */
-  SVN_ERR(svn_fs_x__read_rep_header(&rep_header, rev_file->stream,
+  SVN_ERR(svn_fs_x__rev_file_stream(&stream, rev_file));
+  SVN_ERR(svn_fs_x__read_rep_header(&rep_header, stream,
                                     scratch_pool, scratch_pool));
 
   /* if the representation is a delta against some other rep, link the two */
@@ -685,11 +687,13 @@ copy_node_to_temp(pack_context_t *contex
   path_order_t *path_order = apr_pcalloc(context->info_pool,
                                          sizeof(*path_order));
   svn_fs_x__noderev_t *noderev;
+  svn_stream_t *stream;
   const char *sort_path;
   apr_off_t source_offset = entry->offset;
 
   /* read & parse noderev */
-  SVN_ERR(svn_fs_x__read_noderev(&noderev, rev_file->stream, scratch_pool,
+  SVN_ERR(svn_fs_x__rev_file_stream(&stream, rev_file));
+  SVN_ERR(svn_fs_x__read_noderev(&noderev, stream, scratch_pool,
                                  scratch_pool));
 
   /* create a copy of ENTRY, make it point to the copy destination and

Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/rev_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/rev_file.c?rev=1662939&r1=1662938&r2=1662939&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/rev_file.c (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/rev_file.c Sat Feb 28 13:36:53 2015
@@ -318,6 +318,14 @@ svn_fs_x__rev_file_name(const char **fil
 }
 
 svn_error_t *
+svn_fs_x__rev_file_stream(svn_stream_t **stream,
+                          svn_fs_x__revision_file_t *file)
+{
+  *stream = file->stream;
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
 svn_fs_x__rev_file_l2p_index(svn_fs_x__packed_number_stream_t **stream,
                              svn_fs_x__revision_file_t *file)
 {

Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/rev_file.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/rev_file.h?rev=1662939&r1=1662938&r2=1662939&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/rev_file.h (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/rev_file.h Sat Feb 28 13:36:53 2015
@@ -145,6 +145,12 @@ svn_fs_x__rev_file_name(const char **fil
                         svn_fs_x__revision_file_t *file,
                         apr_pool_t *result_pool);
 
+/* Set *STREAM to the shared stream object of FILE.
+ */
+svn_error_t *
+svn_fs_x__rev_file_stream(svn_stream_t **stream,
+                          svn_fs_x__revision_file_t *file);
+
 /* Set *STREAM to the shared L2P data stream of FILE.  Initializes the
  * stream on demand.
  */



Mime
View raw message