You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2011/04/16 14:49:40 UTC

svn commit: r1093981 - in /subversion/trunk/subversion/libsvn_fs_fs: fs.h fs_fs.c

Author: stefan2
Date: Sat Apr 16 12:49:40 2011
New Revision: 1093981

URL: http://svn.apache.org/viewvc?rev=1093981&view=rev
Log:
This is r1088382 done right: expanded_size is not given for
node properties and possibly other structures. In that case,
the item stream size equals the stored data size.

* subversion/libsvn_fs_fs/fs.h
  (representation_t): clarify the usage of expanded_size
* subversion/libsvn_fs_fs/fs_fs.c
  (rep_read_get_baton, read_representation): fall back to
  the the size member if expanded_size has not been given

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/fs.h
    subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/fs.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs.h?rev=1093981&r1=1093980&r2=1093981&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs.h (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs.h Sat Apr 16 12:49:40 2011
@@ -323,7 +323,8 @@ typedef struct representation_t
      file. */
   svn_filesize_t size;
 
-  /* The size of the fulltext of the representation. */
+  /* The size of the fulltext of the representation. If this is 0,
+   * the fulltext size is equal to representation size in the rev file, */
   svn_filesize_t expanded_size;
 
   /* Is this representation a transaction? */

Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=1093981&r1=1093980&r2=1093981&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Sat Apr 16 12:49:40 2011
@@ -3286,7 +3286,7 @@ rep_read_get_baton(struct rep_read_baton
   b->md5_checksum_ctx = svn_checksum_ctx_create(svn_checksum_md5, pool);
   b->checksum_finalized = FALSE;
   b->md5_checksum = svn_checksum_dup(rep->md5_checksum, pool);
-  b->len = rep->expanded_size;
+  b->len = rep->expanded_size ? rep->expanded_size : rep->size;
   b->off = 0;
   b->fulltext_cache_key = fulltext_cache_key;
   b->pool = svn_pool_create(pool);
@@ -3294,7 +3294,7 @@ rep_read_get_baton(struct rep_read_baton
 
   if (fulltext_cache_key)
     b->current_fulltext = svn_stringbuf_create_ensure
-                            ((apr_size_t)rep->expanded_size,
+                            ((apr_size_t)b->len,
                              b->filehandle_pool);
   else
     b->current_fulltext = NULL;
@@ -3755,10 +3755,11 @@ read_representation(svn_stream_t **conte
     {
       fs_fs_data_t *ffd = fs->fsap_data;
       const char *fulltext_key = NULL;
+      apr_size_t len = rep->expanded_size ? rep->expanded_size : rep->size;
       struct rep_read_baton *rb;
 
       if (ffd->fulltext_cache && SVN_IS_VALID_REVNUM(rep->revision)
-          && fulltext_size_is_cachable(ffd, rep->expanded_size))
+          && fulltext_size_is_cachable(ffd, len))
         {
           svn_string_t *fulltext;
           svn_boolean_t is_cached;