Enable FSFS to take out more than file lock at once through a single call.
Use that functionality to take out the new pack lock for upgrade, hotcopy
and recovery.  Also, disallow new TXNs during upgrade and recovery.

The core is the introduction of a new data type describing a lock to take
out, which can be nested / chained.  Switch all existing lock function to
using that infrastructure.

* subversion/libsvn_fs_fs/fs_fs.h
  (svn_fs_fs__with_all_locks): Declare the new internal lock API.

* subversion/libsvn_fs_fs/fs_fs.c
  (with_lock_baton_t): New data type.  It allows us to describe a whole
                       chain of locks to take out with minimal extra
                       overhead.
  (with_some_lock_file): Take all parameters and the lock pool from the
                         new data struct.  Also, update the FS members
                         only once before calling the user-provided BODY
                         and release all file locks at once in the outermost
                         nesting level.  Finally, make the funcion not
                         hold / leak file locks when updating FS members
                         failed.
  (with_lock): New wrapper around the above that ensures in-process
               serialization as well.
  (lock_id_t): New enum that enables us to abstractly specify a FS-internal
               lock.
  (init_lock_baton,
   create_lock_baton,
   chain_lock_baton): New functions to construct single block batons as
                      well as whole chains of it.
  (svn_fs_fs__with_write_lock,
   svn_fs_fs__with_pack_lock,
   svn_fs_fs__with_txn_current_lock): Switch to the new infrastructure.
  (svn_fs_fs__upgrade): Use the new lock API for global serialization.

* subversion/libsvn_fs_fs/hotcopy.c
  (svn_fs_fs__hotcopy): Same.

* subversion/libsvn_fs_fs/recovery.c
  (svn_fs_fs__recover): Same.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1588815 13f79535-47bb-0310-9956-ffa450edef68