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 2016/01/23 12:56:47 UTC

svn commit: r1726390 - in /subversion/branches/parallel-put/subversion/libsvn_fs_base: fs.c fs.h

Author: stefan2
Date: Sat Jan 23 11:56:47 2016
New Revision: 1726390

URL: http://svn.apache.org/viewvc?rev=1726390&view=rev
Log:
On the parallel-put branch:
Enable concurrent txns in BDB.  They basically work out-of-the box,
we simply need to provide the API.

* subversion/libsvn_fs_base/fs.h
  (base_fs_data_t): Add a config flag to remember whether the user wants
                    concurrent txns or not.  We only need that for
                    consistent API behavior; nothing with BDB uses it.

* subversion/libsvn_fs_base/fs.c
  (base_supports_concurrent_writes): Implement new FS API.
  (fs_vtable): Update.
  (open_databases): Remember whether to concurrent puts have been enabled.

Modified:
    subversion/branches/parallel-put/subversion/libsvn_fs_base/fs.c
    subversion/branches/parallel-put/subversion/libsvn_fs_base/fs.h

Modified: subversion/branches/parallel-put/subversion/libsvn_fs_base/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/libsvn_fs_base/fs.c?rev=1726390&r1=1726389&r2=1726390&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/libsvn_fs_base/fs.c (original)
+++ subversion/branches/parallel-put/subversion/libsvn_fs_base/fs.c Sat Jan 23 11:56:47 2016
@@ -65,6 +65,7 @@
 
 #include "../libsvn_fs/fs-loader.h"
 #include "private/svn_fs_util.h"
+#include "private/svn_subr_private.h"
 
 
 /* Checking for return values, and reporting errors.  */
@@ -314,6 +315,15 @@ base_bdb_set_errcall(svn_fs_t *fs,
   return SVN_NO_ERROR;
 }
 
+static svn_boolean_t
+base_supports_concurrent_writes(svn_fs_t *fs,
+                                apr_pool_t *scratch_pool)
+{
+  base_fs_data_t *ffd = fs->fsap_data;
+  return ffd->concurrent_txns;
+}
+
+
 
 /* Write the DB_CONFIG file. */
 static svn_error_t *
@@ -574,7 +584,7 @@ static fs_vtable_t fs_vtable = {
   base_bdb_verify_root,
   base_bdb_freeze,
   base_bdb_set_errcall,
-  NULL,
+  base_supports_concurrent_writes,
 };
 
 /* Where the format number is stored. */
@@ -602,6 +612,10 @@ open_databases(svn_fs_t *fs,
   if (create)
     SVN_ERR(bdb_write_config(fs));
 
+  bfd->concurrent_txns = svn_hash__get_bool(fs->config,
+                                            SVN_FS_CONFIG_CONCURRENT_WRITES,
+                                            FALSE);
+
   /* Create the Berkeley DB environment.  */
   {
     svn_error_t *err = svn_fs_bdb__open(&(bfd->bdb), path,

Modified: subversion/branches/parallel-put/subversion/libsvn_fs_base/fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/libsvn_fs_base/fs.h?rev=1726390&r1=1726389&r2=1726390&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/libsvn_fs_base/fs.h (original)
+++ subversion/branches/parallel-put/subversion/libsvn_fs_base/fs.h Sat Jan 23 11:56:47 2016
@@ -115,6 +115,10 @@ typedef struct base_fs_data_t
   /* The format number of this FS. */
   int format;
 
+  /* TRUE, if more than one thread or process may write to a transaction
+     at the same time. */
+  svn_boolean_t concurrent_txns;
+
 } base_fs_data_t;