You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2015/05/27 13:11:30 UTC

svn commit: r1681975 - in /subversion/trunk/subversion: libsvn_fs_x/lock.c tests/libsvn_fs/locks-test.c

Author: philip
Date: Wed May 27 11:11:30 2015
New Revision: 1681975

URL: http://svn.apache.org/r1681975
Log:
Apply FSFS lock change r1657525 to FSX.

* subversion/subversion/libsvn_fs_x/lock.c:
  (lock_body): Move allocation from here ...
  (svn_fs_fs__lock): ... to here.
  (unlock_body): Move allocation from here ...
  (unlock_single, svn_fs_fs__unlock): ... to here.

* subversion/subversion/tests/libsvn_fs/locks-test.c
  (obtain_write_lock_failure_test): Enable for FSX.

Modified:
    subversion/trunk/subversion/libsvn_fs_x/lock.c
    subversion/trunk/subversion/tests/libsvn_fs/locks-test.c

Modified: subversion/trunk/subversion/libsvn_fs_x/lock.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/lock.c?rev=1681975&r1=1681974&r2=1681975&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/lock.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/lock.c Wed May 27 11:11:30 2015
@@ -885,9 +885,6 @@ lock_body(void *baton, apr_pool_t *pool)
   int i, outstanding = 0;
   apr_pool_t *iterpool = svn_pool_create(pool);
 
-  lb->infos = apr_array_make(lb->result_pool, lb->targets->nelts,
-                             sizeof(lock_info_t));
-
   /* Until we implement directory locks someday, we only allow locks
      on files or non-existent paths. */
   /* Use fs->vtable->foo instead of svn_fs_foo to avoid circular
@@ -1088,9 +1085,6 @@ unlock_body(void *baton, apr_pool_t *poo
   int i, max_components = 0, outstanding = 0;
   apr_pool_t *iterpool = svn_pool_create(pool);
 
-  ub->infos = apr_array_make(ub->result_pool, ub->targets->nelts,
-                             sizeof( unlock_info_t));
-
   SVN_ERR(ub->fs->vtable->youngest_rev(&youngest, ub->fs, pool));
   SVN_ERR(ub->fs->vtable->revision_root(&root, ub->fs, youngest, pool));
 
@@ -1211,6 +1205,8 @@ unlock_single(svn_fs_t *fs,
 
   ub.fs = fs;
   ub.targets = targets;
+  ub.infos = apr_array_make(scratch_pool, targets->nelts,
+                            sizeof(struct unlock_info_t));
   ub.skip_check = TRUE;
   ub.result_pool = scratch_pool;
 
@@ -1272,6 +1268,8 @@ svn_fs_x__lock(svn_fs_t *fs,
 
   lb.fs = fs;
   lb.targets = sorted_targets;
+  lb.infos = apr_array_make(scratch_pool, sorted_targets->nelts,
+                            sizeof(struct lock_info_t));
   lb.comment = comment;
   lb.is_dav_comment = is_dav_comment;
   lb.expiration_date = expiration_date;
@@ -1366,6 +1364,8 @@ svn_fs_x__unlock(svn_fs_t *fs,
 
   ub.fs = fs;
   ub.targets = sorted_targets;
+  ub.infos = apr_array_make(scratch_pool, sorted_targets->nelts,
+                            sizeof(struct unlock_info_t));
   ub.skip_check = FALSE;
   ub.break_lock = break_lock;
   ub.result_pool = result_pool;

Modified: subversion/trunk/subversion/tests/libsvn_fs/locks-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_fs/locks-test.c?rev=1681975&r1=1681974&r2=1681975&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_fs/locks-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_fs/locks-test.c Wed May 27 11:11:30 2015
@@ -1101,9 +1101,10 @@ obtain_write_lock_failure(const svn_test
   apr_hash_t *lock_paths, *unlock_paths;
 
   /* The test makes sense only for FSFS. */
-  if (strcmp(opts->fs_type, SVN_FS_TYPE_FSFS) != 0)
+  if (strcmp(opts->fs_type, SVN_FS_TYPE_FSFS) != 0
+      && strcmp(opts->fs_type, SVN_FS_TYPE_FSX) != 0)
     return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL,
-                            "this will test FSFS repositories only");
+                            "this will test FSFS/FSX repositories only");
 
   SVN_ERR(create_greek_fs(&fs, &newrev, "test-obtain-write-lock-failure",
                           opts, pool));