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

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  j...@rpm5.org
  Module: rpm                              Date:   06-Oct-2009 00:48:49
  Branch: HEAD                             Handle: 2009100522484800

  Modified files:
    rpm/rpmdb               db3.c dbconfig.c rpmdb.h

  Log:
    - dbi: stub-in per-table Bloom filters.
    - dbi: better debugging for DB->associate_foreign().

  Summary:
    Revision    Changes     Path
    1.116       +39 -4      rpm/rpmdb/db3.c
    1.73        +3  -0      rpm/rpmdb/dbconfig.c
    1.106       +5  -1      rpm/rpmdb/rpmdb.h
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/db3.c
  ============================================================================
  $ cvs diff -u -r1.115 -r1.116 db3.c
  --- rpm/rpmdb/db3.c   5 Oct 2009 20:31:50 -0000       1.115
  +++ rpm/rpmdb/db3.c   5 Oct 2009 22:48:48 -0000       1.116
  @@ -184,6 +184,37 @@
   }
   #define      _OFLAGS(_dbi)   fmtDBoflags((_dbi)->dbi_oflags)
   
  +static KEY DBaflags[] = {
  +    _ENTRY(CREATE),
  +    _ENTRY(IMMUTABLE_KEY),
  +};
  +static size_t nDBaflags = sizeof(DBaflags) / sizeof(DBaflags[0]);
  +static const char * fmtDBaflags(uint32_t flags)
  +{
  +    static char buf[BUFSIZ];
  +    char * te = buf;
  +    te = stpcpy(te, "\n\tflags: ");
  +    (void) fmtBits(flags, DBaflags, nDBaflags, te);
  +    return buf;
  +}
  +#define      _AFLAGS(_aflags)        fmtDBaflags(_aflags)
  +
  +static KEY DBafflags[] = {
  +    _ENTRY(FOREIGN_ABORT),
  +    _ENTRY(FOREIGN_CASCADE),
  +    _ENTRY(FOREIGN_NULLIFY),
  +};
  +static size_t nDBafflags = sizeof(DBafflags) / sizeof(DBafflags[0]);
  +static const char * fmtDBafflags(uint32_t flags)
  +{
  +    static char buf[BUFSIZ];
  +    char * te = buf;
  +    te = stpcpy(te, "\n\tflags: ");
  +    (void) fmtBits(flags, DBafflags, nDBafflags, te);
  +    return buf;
  +}
  +#define      _AFFLAGS(_afflags)      fmtDBaflags(_afflags)
  +
   static KEY DBCflags[] = {
       _ENTRY(AFTER),           /* Dbc.put */
       _ENTRY(APPEND),          /* Db.put */
  @@ -1139,11 +1170,9 @@
       rc = cvtdberr(dbi, "db->associate", rc, _debug);
   
       if (dbi->dbi_debug || dbisecondary->dbi_debug) {
  -     const char * tag1 = xstrdup(tagName(dbi->dbi_rpmtag));
        const char * tag2 = xstrdup(tagName(dbisecondary->dbi_rpmtag));
  -fprintf(stderr, "<-- %s(%p(%s),%p(%s),%p,0x%x) rc %d\n", __FUNCTION__, dbi, 
tag1, dbisecondary, tag2, callback, flags, rc);
  +fprintf(stderr, "<-- %s(%p(%s),%p(%s),%p,0x%x) rc %d %s\n", __FUNCTION__, 
dbi, tagName(dbi->dbi_rpmtag), dbisecondary, tag2, callback, flags, rc, 
_AFLAGS(flags));
        tag2 = _free(tag2);
  -     tag1 = _free(tag1);
       }
   
       return rc;
  @@ -1161,7 +1190,6 @@
       DB * secondary = dbisecondary->dbi_db;
       int rc;
   
  -DBIDEBUG(dbi, (stderr, "--> %s(%p,%p,%p,0x%x)\n", __FUNCTION__, dbi, 
dbisecondary, callback, flags));
   /*...@-moduncon@*/ /* FIX: annotate db3 methods */
   #if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 8)
   assert(db != NULL);
  @@ -1171,6 +1199,13 @@
   #endif
   /*...@=moduncon@*/
       rc = cvtdberr(dbi, "db->associate_foreign", rc, _debug);
  +
  +    if (dbi->dbi_debug || dbisecondary->dbi_debug) {
  +     const char * tag2 = xstrdup(tagName(dbisecondary->dbi_rpmtag));
  +fprintf(stderr, "<-- %s(%p(%s),%p(%s),%p,0x%x) rc %d %s\n", __FUNCTION__, 
dbi, tagName(dbi->dbi_rpmtag), dbisecondary, tag2, callback, flags, rc, 
_AFFLAGS(flags));
  +     tag2 = _free(tag2);
  +    }
  +
       return rc;
   }
   /*...@=mustmod@*/
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/dbconfig.c
  ============================================================================
  $ cvs diff -u -r1.72 -r1.73 dbconfig.c
  --- rpm/rpmdb/dbconfig.c      5 Oct 2009 14:21:40 -0000       1.72
  +++ rpm/rpmdb/dbconfig.c      5 Oct 2009 22:48:48 -0000       1.73
  @@ -466,9 +466,12 @@
        dbi->dbi_file = _free(dbi->dbi_file);
        dbi->dbi_subfile = _free(dbi->dbi_subfile);
        dbi->dbi_tmpdir = _free(dbi->dbi_tmpdir);
  +     dbi->dbi_bf = rpmbfFree(dbi->dbi_bf);
        dbi->dbi_host = _free(dbi->dbi_host);
        dbi->dbi_errpfx = _free(dbi->dbi_errpfx);
  +     dbi->dbi_seq_id = _free(dbi->dbi_seq_id);
        dbi->dbi_re_source = _free(dbi->dbi_re_source);
  +     dbi->dbi_foreign = _free(dbi->dbi_foreign);
        dbi->dbi_stats = _free(dbi->dbi_stats);
       }
   }
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/rpmdb.h
  ============================================================================
  $ cvs diff -u -r1.105 -r1.106 rpmdb.h
  --- rpm/rpmdb/rpmdb.h 5 Oct 2009 20:31:50 -0000       1.105
  +++ rpm/rpmdb/rpmdb.h 5 Oct 2009 22:48:48 -0000       1.106
  @@ -54,6 +54,7 @@
   
   #if defined(_RPMDB_INTERNAL)
   #include <rpmio.h>
  +#include <rpmbf.h>
   #include <rpmsw.h>
   
   #if !defined(SWIG)   /* XXX inline dbiFoo() need */
  @@ -329,7 +330,7 @@
   
       int      dbi_type;               /*!< db index type */
       unsigned dbi_mode;               /*!< mode to use on open */
  -    int      dbi_perms;              /*!< file permission to use on open */
  +    int      dbi_perms;              /*!< file permission used when creating 
*/
       long dbi_shmkey;         /*!< shared memory base key */
       int      dbi_api;                /*!< Berkeley API type */
   
  @@ -343,6 +344,8 @@
       int      dbi_debug;
       int      dbi_byteswapped;
   
  +    rpmbf dbi_bf;
  +
   /*...@null@*/
       char * dbi_host;
       unsigned long dbi_cl_timeout;
  @@ -360,6 +363,7 @@
       const char * dbi_errpfx;
       int      dbi_region_init;
       unsigned int dbi_thread_count;
  +
        /* locking sub-system parameters */
        /* logging sub-system parameters */
        /* mpool sub-system parameters */
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                rpm-cvs@rpm5.org

Reply via email to