subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1595603 - in /subversion/trunk/subversion/libsvn_fs_x: ./ cached_data.c caching.c fs.c fs_x.c fs_x.h
Date Sun, 18 May 2014 12:06:49 GMT
Author: stefan2
Date: Sun May 18 12:06:48 2014
New Revision: 1595603

URL: http://svn.apache.org/r1595603
Log:
Sync'ing FSX with FSFS:
Merge r1532193,1534158,1588651 from /subversion/libsvn_fs_fs into
subversion/libsvn_fs_x. Conflicts were due naming differences between
FSX and FSFS.

These are small, local patches concerning pool handling, consistency
and documentation.

Modified:
    subversion/trunk/subversion/libsvn_fs_x/   (props changed)
    subversion/trunk/subversion/libsvn_fs_x/cached_data.c
    subversion/trunk/subversion/libsvn_fs_x/caching.c
    subversion/trunk/subversion/libsvn_fs_x/fs.c
    subversion/trunk/subversion/libsvn_fs_x/fs_x.c
    subversion/trunk/subversion/libsvn_fs_x/fs_x.h

Propchange: subversion/trunk/subversion/libsvn_fs_x/
------------------------------------------------------------------------------
  Merged /subversion/trunk/subversion/libsvn_fs_fs:r1532193,1534158,1588651

Modified: subversion/trunk/subversion/libsvn_fs_x/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/cached_data.c?rev=1595603&r1=1595602&r2=1595603&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/cached_data.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/cached_data.c Sun May 18 12:06:48 2014
@@ -2470,8 +2470,7 @@ get_dir_contents(apr_array_header_t **en
        */
       apr_pool_t *text_pool = svn_pool_create(scratch_pool);
       apr_size_t len = noderev->data_rep->expanded_size;
-      svn_stringbuf_t *text = svn_stringbuf_create_ensure(len, text_pool);
-      text->len = len;
+      svn_stringbuf_t *text;
 
       /* The representation is immutable.  Read it normally. */
       SVN_ERR(svn_fs_x__get_contents(&contents, fs, noderev->data_rep,

Modified: subversion/trunk/subversion/libsvn_fs_x/caching.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/caching.c?rev=1595603&r1=1595602&r2=1595603&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/caching.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/caching.c Sun May 18 12:06:48 2014
@@ -397,11 +397,16 @@ svn_fs_x__initialize_caches(svn_fs_t *fs
 #ifdef SVN_DEBUG_CACHE_DUMP_STATS
 
   /* schedule printing the global access statistics upon pool cleanup,
+<<<<<<< .working
     * i.e. end of FSX session.
     */
+=======
+   * i.e. when the repo instance gets closed / cleaned up.
+   */
+>>>>>>> .merge-right.r1588651
   if (membuffer)
-    apr_pool_cleanup_register(pool,
-                              pool,
+    apr_pool_cleanup_register(fs->pool,
+                              fs->pool,
                               dump_global_cache_statistics,
                               apr_pool_cleanup_null);
 #endif

Modified: subversion/trunk/subversion/libsvn_fs_x/fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/fs.c?rev=1595603&r1=1595602&r2=1595603&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/fs.c Sun May 18 12:06:48 2014
@@ -56,6 +56,9 @@
 
 
 
+/* Initialize the part of FS that requires global serialization across all
+   instances.  The caller is responsible of ensuring that serialization.
+   Use COMMON_POOL for process-wide and POOL for temporary allocations. */
 static svn_error_t *
 x_serialized_init(svn_fs_t *fs, apr_pool_t *common_pool, apr_pool_t *pool)
 {
@@ -273,15 +276,19 @@ x_open(svn_fs_t *fs,
        apr_pool_t *pool,
        apr_pool_t *common_pool)
 {
+  apr_pool_t *subpool = svn_pool_create(pool);
+
   SVN_ERR(svn_fs__check_fs(fs, FALSE));
 
   SVN_ERR(initialize_fs_struct(fs));
 
-  SVN_ERR(svn_fs_x__open(fs, path, pool));
+  SVN_ERR(svn_fs_x__open(fs, path, subpool));
 
-  SVN_ERR(svn_fs_x__initialize_caches(fs, pool));
+  SVN_ERR(svn_fs_x__initialize_caches(fs, subpool));
   SVN_MUTEX__WITH_LOCK(common_pool_lock,
-                       x_serialized_init(fs, common_pool, pool));
+                       x_serialized_init(fs, common_pool, subpool));
+
+  svn_pool_destroy(subpool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_fs_x/fs_x.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/fs_x.c?rev=1595603&r1=1595602&r2=1595603&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/fs_x.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/fs_x.c Sun May 18 12:06:48 2014
@@ -84,6 +84,23 @@ check_format_file_buffer_numeric(const c
                                              pool);
 }
 
+/* Return the error SVN_ERR_FS_UNSUPPORTED_FORMAT if FS's format
+   number is not the same as a format number supported by this
+   Subversion. */
+static svn_error_t *
+check_format(int format)
+{
+  /* Put blacklisted versions here. */
+
+  /* We support all formats from 1-current simultaneously */
+  if (1 <= format && format <= SVN_FS_X__FORMAT_NUMBER)
+    return SVN_NO_ERROR;
+
+  return svn_error_createf(SVN_ERR_FS_UNSUPPORTED_FORMAT, NULL,
+     _("Expected FS format between '1' and '%d'; found format '%d'"),
+     SVN_FS_X__FORMAT_NUMBER, format);
+}
+
 static svn_error_t *
 read_format(int *pformat, int *max_files_per_dir,
             const char *path, apr_pool_t *pool)
@@ -108,6 +125,9 @@ read_format(int *pformat, int *max_files
   SVN_ERR(check_format_file_buffer_numeric(buf->data, 0, path, pool));
   SVN_ERR(svn_cstring_atoi(pformat, buf->data));
 
+  /* Check that we support this format at all */
+  SVN_ERR(check_format(*pformat));
+
   /* Read any options. */
   SVN_ERR(svn_stream_readline(stream, &buf, "\n", &eos, pool));
   if (!eos && strncmp(buf->data, "layout sharded ", 15) == 0)
@@ -162,21 +182,6 @@ svn_fs_x__write_format(svn_fs_t *fs,
   return svn_io_set_file_read_only(path, FALSE, pool);
 }
 
-/* Return the error SVN_ERR_FS_UNSUPPORTED_FORMAT if FS's format
-   number is not the same as a format number supported by this
-   Subversion. */
-static svn_error_t *
-check_format(int format)
-{
-  /* We support all formats from 1-current simultaneously */
-  if (1 <= format && format <= SVN_FS_X__FORMAT_NUMBER)
-    return SVN_NO_ERROR;
-
-  return svn_error_createf(SVN_ERR_FS_UNSUPPORTED_FORMAT, NULL,
-     _("Expected FS format between '1' and '%d'; found format '%d'"),
-     SVN_FS_X__FORMAT_NUMBER, format);
-}
-
 /* Find the youngest revision in a repository at path FS_PATH and
    return it in *YOUNGEST_P.  Perform temporary allocations in
    POOL. */
@@ -452,7 +457,6 @@ svn_fs_x__open(svn_fs_t *fs, const char 
   /* Read the FS format number. */
   SVN_ERR(read_format(&format, &max_files_per_dir,
                       svn_fs_x__path_format(fs, pool), pool));
-  SVN_ERR(check_format(format));
 
   /* Now we've got a format number no matter what. */
   ffd->format = format;
@@ -498,7 +502,6 @@ upgrade_body(void *baton, apr_pool_t *po
 
   /* Read the FS format number and max-files-per-dir setting. */
   SVN_ERR(read_format(&format, &max_files_per_dir, format_path, pool));
-  SVN_ERR(check_format(format));
 
   /* If we're already up-to-date, there's nothing else to be done here. */
   if (format == SVN_FS_X__FORMAT_NUMBER)

Modified: subversion/trunk/subversion/libsvn_fs_x/fs_x.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/fs_x.h?rev=1595603&r1=1595602&r2=1595603&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/fs_x.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/fs_x.h Sun May 18 12:06:48 2014
@@ -191,7 +191,7 @@ svn_error_t *svn_fs_x__ensure_dir_exists
                                          apr_pool_t *pool);
 
 /* Initialize all session-local caches in FS according to the global
-   cache settings. Use POOL for allocations.
+   cache settings. Use POOL for temporary allocations.
 
    Please note that it is permissible for this function to set some
    or all of these caches to NULL, regardless of any setting. */



Mime
View raw message