RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  [EMAIL PROTECTED]
  Module: db                               Date:   04-Apr-2008 22:52:30
  Branch: HEAD                             Handle: 2008040420523000

  Modified files:
    db/dbinc                mp.h
    db/mp                   mp_fopen.c mp_sync.c

  Log:
    - jbj: apply patch.4.6.21.1.

  Summary:
    Revision    Changes     Path
    1.9         +3  -0      db/dbinc/mp.h
    1.19        +9  -2      db/mp/mp_fopen.c
    1.11        +2  -1      db/mp/mp_sync.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: db/dbinc/mp.h
  ============================================================================
  $ cvs diff -u -r1.8 -r1.9 mp.h
  --- db/dbinc/mp.h     9 Oct 2007 22:50:06 -0000       1.8
  +++ db/dbinc/mp.h     4 Apr 2008 20:52:30 -0000       1.9
  @@ -639,6 +639,9 @@
    */
   #define      MP_TRUNC_RECOVER        0x01
   
  +/* Private flags to DB_MPOOLFILE->close. */
  +#define      DB_MPOOL_NOLOCK         0x002   /* Already have mpf locked. */
  +
   #if defined(__cplusplus)
   }
   #endif
  @@ .
  patch -p0 <<'@@ .'
  Index: db/mp/mp_fopen.c
  ============================================================================
  $ cvs diff -u -r1.18 -r1.19 mp_fopen.c
  --- db/mp/mp_fopen.c  29 Jul 2007 13:13:24 -0000      1.18
  +++ db/mp/mp_fopen.c  4 Apr 2008 20:52:30 -0000       1.19
  @@ -888,7 +888,8 @@
         * when we try to flush them.
         */
        deleted = 0;
  -     MUTEX_LOCK(dbenv, mfp->mutex);
  +     if (!LF_ISSET(DB_MPOOL_NOLOCK))
  +             MUTEX_LOCK(dbenv, mfp->mutex);
        if (F_ISSET(dbmfp, MP_MULTIVERSION))
                --mfp->multiversion;
        if (--mfp->mpf_cnt == 0 || LF_ISSET(DB_MPOOL_DISCARD)) {
  @@ -909,13 +910,19 @@
                        }
                }
                if (mfp->block_cnt == 0) {
  +                     /*
  +                      * We should never discard this mp file if our caller
  +                      * is holding the lock on it.  See comment in
  +                      * __memp_sync_file.
  +                      */
  +                     DB_ASSERT(dbenv, !LF_ISSET(DB_MPOOL_NOLOCK));
                        if ((t_ret =
                            __memp_mf_discard(dbmp, mfp)) != 0 && ret == 0)
                                ret = t_ret;
                        deleted = 1;
                }
        }
  -     if (!deleted)
  +     if (!deleted && !LF_ISSET(DB_MPOOL_NOLOCK))
                MUTEX_UNLOCK(dbenv, mfp->mutex);
   
   done:        /* Discard the DB_MPOOLFILE structure. */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/mp/mp_sync.c
  ============================================================================
  $ cvs diff -u -r1.10 -r1.11 mp_sync.c
  --- db/mp/mp_sync.c   29 Jul 2007 13:13:24 -0000      1.10
  +++ db/mp/mp_sync.c   4 Apr 2008 20:52:30 -0000       1.11
  @@ -755,7 +755,8 @@
         * This is important since we are called with the hash bucket
         * locked.  The mfp will get freed via the cleanup pass.
         */
  -     if (dbmfp != NULL && (t_ret = __memp_fclose(dbmfp, 0)) != 0 && ret == 0)
  +     if (dbmfp != NULL &&
  +         (t_ret = __memp_fclose(dbmfp, DB_MPOOL_NOLOCK)) != 0 && ret == 0)
                ret = t_ret;
   
        --mfp->mpf_cnt;
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                [email protected]

Reply via email to