[CVS] RPM: rpm/ CHANGES rpm/lib/ rpmps.c
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: 19-Mar-2009 15:52:38 Branch: HEAD Handle: 2009031914523800 Modified files: rpm CHANGES rpm/lib rpmps.c Log: - jbj: rpmps: fix: avoid reusing items from pool for now. Summary: RevisionChanges Path 1.2844 +1 -0 rpm/CHANGES 2.30+4 -0 rpm/lib/rpmps.c patch -p0 <<'@@ .' Index: rpm/CHANGES $ cvs diff -u -r1.2843 -r1.2844 CHANGES --- rpm/CHANGES 19 Mar 2009 00:20:17 - 1.2843 +++ rpm/CHANGES 19 Mar 2009 14:52:38 - 1.2844 @@ -1,5 +1,6 @@ 5.2a3 -> 5.2a4: +- jbj: rpmps: fix: avoid reusing items from pool for now. - proyvind: libcpuinfo may now return 64bit feature only if PER_LINUX_32BIT personality isn't set, so don't check un.machine anymore. - jbj: yarn: convert rpmtsi refcount to usage mutex. @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmps.c $ cvs diff -u -r2.29 -r2.30 rpmps.c --- rpm/lib/rpmps.c 18 Mar 2009 22:31:39 - 2.29 +++ rpm/lib/rpmps.c 19 Mar 2009 14:52:38 - 2.30 @@ -116,7 +116,11 @@ rpmps rpmpsCreate(void) { +#ifdef BUGGY rpmps ps = rpmpsGetPool(_rpmpsPool); +#else +rpmps ps = rpmpsGetPool(NULL); +#endif return rpmpsLink(ps, "create"); } @@ . __ RPM Package Managerhttp://rpm5.org CVS Sources Repositoryrpm-cvs@rpm5.org
[CVS] RPM: rpm-5_1: rpm/ CHANGES rpm/lib/ rpmps.c
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: 19-Mar-2009 15:53:52 Branch: rpm-5_1 Handle: 2009031914535200 Modified files: (Branch: rpm-5_1) rpm CHANGES rpm/lib rpmps.c Log: - rpmps: fix: avoid reusing items from pool for now. Summary: RevisionChanges Path 1.2288.2.216+1 -0 rpm/CHANGES 2.22.2.4+4 -0 rpm/lib/rpmps.c patch -p0 <<'@@ .' Index: rpm/CHANGES $ cvs diff -u -r1.2288.2.215 -r1.2288.2.216 CHANGES --- rpm/CHANGES 18 Mar 2009 23:24:30 - 1.2288.2.215 +++ rpm/CHANGES 19 Mar 2009 14:53:52 - 1.2288.2.216 @@ -1,4 +1,5 @@ 5.1.7 -> 5.1.8: +- jbj: rpmps: fix: avoid reusing items from pool for now. - jbj: yarn: convert rpmtsi refcount to usage mutex. - jbj: yarn: convert rpmsx refcount to usage mutex. - jbj: yarn: convert rpmps refcount to usage mutex. @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmps.c $ cvs diff -u -r2.22.2.3 -r2.22.2.4 rpmps.c --- rpm/lib/rpmps.c 18 Mar 2009 22:32:09 - 2.22.2.3 +++ rpm/lib/rpmps.c 19 Mar 2009 14:53:52 - 2.22.2.4 @@ -116,7 +116,11 @@ rpmps rpmpsCreate(void) { +#ifdef BUGGY rpmps ps = rpmpsGetPool(_rpmpsPool); +#else +rpmps ps = rpmpsGetPool(NULL); +#endif return rpmpsLink(ps, "create"); } @@ . __ RPM Package Managerhttp://rpm5.org CVS Sources Repositoryrpm-cvs@rpm5.org
[CVS] RPM: rpm/ CHANGES rpm/lib/ librpm.vers poptALL.c rpmts.c rpmts.h
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: 19-Mar-2009 15:57:21 Branch: HEAD Handle: 2009031914572001 Modified files: rpm CHANGES rpm/lib librpm.vers poptALL.c rpmts.c rpmts.h Log: - yarn: convert rpmts refcount to usage mutex (avoid recurse deadlock). Summary: RevisionChanges Path 1.2845 +1 -0 rpm/CHANGES 1.60+0 -2 rpm/lib/librpm.vers 2.112 +3 -0 rpm/lib/poptALL.c 2.159 +60 -55 rpm/lib/rpmts.c 2.110 +9 -18 rpm/lib/rpmts.h patch -p0 <<'@@ .' Index: rpm/CHANGES $ cvs diff -u -r1.2844 -r1.2845 CHANGES --- rpm/CHANGES 19 Mar 2009 14:52:38 - 1.2844 +++ rpm/CHANGES 19 Mar 2009 14:57:20 - 1.2845 @@ -1,5 +1,6 @@ 5.2a3 -> 5.2a4: +- jbj: yarn: convert rpmts refcount to usage mutex (avoid recurse deadlock). - jbj: rpmps: fix: avoid reusing items from pool for now. - proyvind: libcpuinfo may now return 64bit feature only if PER_LINUX_32BIT personality isn't set, so don't check un.machine anymore. @@ . patch -p0 <<'@@ .' Index: rpm/lib/librpm.vers $ cvs diff -u -r1.59 -r1.60 librpm.vers --- rpm/lib/librpm.vers 18 Mar 2009 22:58:33 - 1.59 +++ rpm/lib/librpm.vers 19 Mar 2009 14:57:21 - 1.60 @@ -412,8 +412,6 @@ XrpmpsmUnlink; XrpmtsiFree; XrpmtsiInit; -XrpmtsLink; -XrpmtsUnlink; local: *; }; @@ . patch -p0 <<'@@ .' Index: rpm/lib/poptALL.c $ cvs diff -u -r2.111 -r2.112 poptALL.c --- rpm/lib/poptALL.c 18 Mar 2009 23:23:56 - 2.111 +++ rpm/lib/poptALL.c 19 Mar 2009 14:57:21 - 2.112 @@ -129,6 +129,8 @@ /*...@unchecked@*/ extern int _rpmts_debug; +/*...@unchecked@*/ +extern rpmioPool _rpmtsPool; /*...@unchecked@*/ extern int _rpmwf_debug; @@ -465,6 +467,7 @@ _rpmgiPool = rpmioFreePool(_rpmgiPool); _rpmtsiPool = rpmioFreePool(_rpmtsiPool); +_rpmtsPool = rpmioFreePool(_rpmtsPool); _rpmtePool = rpmioFreePool(_rpmtePool); _rpmpsPool = rpmioFreePool(_rpmpsPool); @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmts.c $ cvs diff -u -r2.158 -r2.159 rpmts.c --- rpm/lib/rpmts.c 10 Dec 2008 23:08:27 - 2.158 +++ rpm/lib/rpmts.c 19 Mar 2009 14:57:21 - 2.159 @@ -88,26 +88,23 @@ /*...@unchecked@*/ int _rpmts_macros = 0; -rpmts XrpmtsUnlink(rpmts ts, const char * msg, const char * fn, unsigned ln) -{ -/*...@-modfilesys@*/ -if (_rpmts_debug) -fprintf(stderr, "--> ts %p -- %d %s at %s:%u\n", ts, ts->nrefs, msg, fn, ln); -/*...@=modfilesys@*/ -ts->nrefs--; -return NULL; -} -rpmts XrpmtsLink(rpmts ts, const char * msg, const char * fn, unsigned ln) +/*...@unchecked@*/ /*...@null@*/ +rpmioPool _rpmtsPool; + +static rpmts rpmtsGetPool(/*...@null@*/ rpmioPool pool) + /*...@modifies pool @*/ { -ts->nrefs++; -/*...@-modfilesys@*/ -if (_rpmts_debug) -fprintf(stderr, "--> ts %p ++ %d %s at %s:%u\n", ts, ts->nrefs, msg, fn, ln); -/*...@=modfilesys@*/ -/*...@-refcounttrans@*/ return ts; /*...@=refcounttrans@*/ +rpmts ts; + +if (_rpmtsPool == NULL) { + _rpmtsPool = rpmioNewPool("ts", sizeof(*ts), -1, _rpmts_debug); + pool = _rpmtsPool; +} +return (rpmts) rpmioGetPool(pool, sizeof(*ts)); } + int rpmtsCloseDB(rpmts ts) { int rc = 0; @@ -642,64 +639,75 @@ if (ts == NULL) return NULL; -if (ts->nrefs > 1) - return rpmtsUnlink(ts, "tsCreate"); +yarnPossess(ts->use); +/*...@-modfilesys@*/ +if (_rpmts_debug) +fprintf(stderr, "--> ts %p -- %ld %s at %s:%u\n", ts, yarnPeekLock(ts->use), "tsCreate", __FILE__, __LINE__); +/*...@=modfilesys@*/ + +if (yarnPeekLock(ts->use) <= 1L) { /*...@-nullstate@*/ /* FIX: partial annotations */ -rpmtsEmpty(ts); + /* XXX there's a recursion here ... release and reacquire the lock */ +#ifndef BUGGY + yarnRelease(ts->use); /* XXX hack-o-round */ +#endif + rpmtsEmpty(ts); +#ifndef BUGGY + yarnPossess(ts->use); /* XXX hack-o-round */ +#endif /*...@=nul
[CVS] RPM: rpm-5_1: rpm/ CHANGES rpm/lib/ librpm.vers poptALL.c rpmts....
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: 19-Mar-2009 16:00:07 Branch: rpm-5_1 Handle: 2009031915000501 Modified files: (Branch: rpm-5_1) rpm CHANGES rpm/lib librpm.vers poptALL.c rpmts.c rpmts.h Log: - yarn: convert rpmts refcount to usage mutex (avoid recurse deadlock). Summary: RevisionChanges Path 1.2288.2.217+1 -0 rpm/CHANGES 1.39.2.12 +0 -2 rpm/lib/librpm.vers 2.90.2.12 +3 -0 rpm/lib/poptALL.c 2.145.2.3 +61 -57 rpm/lib/rpmts.c 2.98.2.3+9 -18 rpm/lib/rpmts.h patch -p0 <<'@@ .' Index: rpm/CHANGES $ cvs diff -u -r1.2288.2.216 -r1.2288.2.217 CHANGES --- rpm/CHANGES 19 Mar 2009 14:53:52 - 1.2288.2.216 +++ rpm/CHANGES 19 Mar 2009 15:00:05 - 1.2288.2.217 @@ -1,4 +1,5 @@ 5.1.7 -> 5.1.8: +- jbj: yarn: convert rpmts refcount to usage mutex (avoid recurse deadlock). - jbj: rpmps: fix: avoid reusing items from pool for now. - jbj: yarn: convert rpmtsi refcount to usage mutex. - jbj: yarn: convert rpmsx refcount to usage mutex. @@ . patch -p0 <<'@@ .' Index: rpm/lib/librpm.vers $ cvs diff -u -r1.39.2.11 -r1.39.2.12 librpm.vers --- rpm/lib/librpm.vers 18 Mar 2009 22:58:58 - 1.39.2.11 +++ rpm/lib/librpm.vers 19 Mar 2009 15:00:06 - 1.39.2.12 @@ -411,8 +411,6 @@ XrpmpsmUnlink; XrpmtsiFree; XrpmtsiInit; -XrpmtsLink; -XrpmtsUnlink; local: *; }; @@ . patch -p0 <<'@@ .' Index: rpm/lib/poptALL.c $ cvs diff -u -r2.90.2.11 -r2.90.2.12 poptALL.c --- rpm/lib/poptALL.c 18 Mar 2009 23:24:30 - 2.90.2.11 +++ rpm/lib/poptALL.c 19 Mar 2009 15:00:06 - 2.90.2.12 @@ -117,6 +117,8 @@ /*...@unchecked@*/ extern int _rpmts_debug; +/*...@unchecked@*/ +extern rpmioPool _rpmtsPool; /*...@unchecked@*/ extern int _rpmwf_debug; @@ -451,6 +453,7 @@ _rpmgiPool = rpmioFreePool(_rpmgiPool); _rpmtsiPool = rpmioFreePool(_rpmtsiPool); +_rpmtsPool = rpmioFreePool(_rpmtsPool); _rpmtePool = rpmioFreePool(_rpmtePool); _rpmpsPool = rpmioFreePool(_rpmpsPool); @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmts.c $ cvs diff -u -r2.145.2.2 -r2.145.2.3 rpmts.c --- rpm/lib/rpmts.c 30 Oct 2008 15:57:21 - 2.145.2.2 +++ rpm/lib/rpmts.c 19 Mar 2009 15:00:06 - 2.145.2.3 @@ -79,26 +79,23 @@ /*...@unchecked@*/ int _rpmts_macros = 0; -rpmts XrpmtsUnlink(rpmts ts, const char * msg, const char * fn, unsigned ln) -{ -/*...@-modfilesys@*/ -if (_rpmts_debug) -fprintf(stderr, "--> ts %p -- %d %s at %s:%u\n", ts, ts->nrefs, msg, fn, ln); -/*...@=modfilesys@*/ -ts->nrefs--; -return NULL; -} -rpmts XrpmtsLink(rpmts ts, const char * msg, const char * fn, unsigned ln) +/*...@unchecked@*/ /*...@null@*/ +rpmioPool _rpmtsPool; + +static rpmts rpmtsGetPool(/*...@null@*/ rpmioPool pool) + /*...@modifies pool @*/ { -ts->nrefs++; -/*...@-modfilesys@*/ -if (_rpmts_debug) -fprintf(stderr, "--> ts %p ++ %d %s at %s:%u\n", ts, ts->nrefs, msg, fn, ln); -/*...@=modfilesys@*/ -/*...@-refcounttrans@*/ return ts; /*...@=refcounttrans@*/ +rpmts ts; + +if (_rpmtsPool == NULL) { + _rpmtsPool = rpmioNewPool("ts", sizeof(*ts), -1, _rpmts_debug); + pool = _rpmtsPool; +} +return (rpmts) rpmioGetPool(pool, sizeof(*ts)); } + int rpmtsCloseDB(rpmts ts) { int rc = 0; @@ -632,59 +629,69 @@ if (ts == NULL) return NULL; -if (ts->nrefs > 1) - return rpmtsUnlink(ts, "tsCreate"); +yarnPossess(ts->use); +/*...@-modfilesys@*/ +if (_rpmts_debug) +fprintf(stderr, "--> ts %p -- %ld %s at %s:%u\n", ts, yarnPeekLock(ts->use), "tsCreate", __FILE__, __LINE__); +/*...@=modfilesys@*/ + +if (yarnPeekLock(ts->use) <= 1L) { /*...@-nullstate@*/ /* FIX: partial annotations */ -rpmtsEmpty(ts); + /* XXX there's a recursion here ... release and reacquire the lock */ +#ifndef BUGGY + yarnRelease(ts->use); /* XXX hack-o-round */ +#endif + rpmtsEmpty(ts); +#ifndef BUGGY + y
[CVS] RPM: rpm/ CHANGES rpm/rpmio/ librpmio.vers rpmio.c rpmpgp.c rpmp...
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: 19-Mar-2009 17:29:24 Branch: HEAD Handle: 2009031916292400 Modified files: rpm CHANGES rpm/rpmio librpmio.vers rpmio.c rpmpgp.c rpmpgp.h Log: - yarn: convert pgpDig refcount to usage mutex (avoid recurse deadlock). Summary: RevisionChanges Path 1.2846 +1 -0 rpm/CHANGES 2.96+0 -2 rpm/rpmio/librpmio.vers 1.167 +2 -0 rpm/rpmio/rpmio.c 2.99+30 -29 rpm/rpmio/rpmpgp.c 2.80+7 -9 rpm/rpmio/rpmpgp.h patch -p0 <<'@@ .' Index: rpm/CHANGES $ cvs diff -u -r1.2845 -r1.2846 CHANGES --- rpm/CHANGES 19 Mar 2009 14:57:20 - 1.2845 +++ rpm/CHANGES 19 Mar 2009 16:29:24 - 1.2846 @@ -1,5 +1,6 @@ 5.2a3 -> 5.2a4: +- jbj: yarn: convert pgpDig refcount to usage mutex (avoid recurse deadlock). - jbj: yarn: convert rpmts refcount to usage mutex (avoid recurse deadlock). - jbj: rpmps: fix: avoid reusing items from pool for now. - proyvind: libcpuinfo may now return 64bit feature only if PER_LINUX_32BIT @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/librpmio.vers $ cvs diff -u -r2.95 -r2.96 librpmio.vers --- rpm/rpmio/librpmio.vers 18 Mar 2009 18:47:51 - 2.95 +++ rpm/rpmio/librpmio.vers 19 Mar 2009 16:29:24 - 2.96 @@ -204,8 +204,6 @@ pgpDigClean; pgpDigFree; pgpDigNew; -XpgpDigLink; -XpgpDigUnlink; pgpDigVSFlags; _pgp_debug; _pgp_print; @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmio.c $ cvs diff -u -r1.166 -r1.167 rpmio.c --- rpm/rpmio/rpmio.c 18 Mar 2009 18:36:37 - 1.166 +++ rpm/rpmio/rpmio.c 19 Mar 2009 16:29:24 - 1.167 @@ -3153,6 +3153,7 @@ void rpmioClean(void) { +extern rpmioPool _digPool; extern rpmioPool _urlPool; #if defined(WITH_LUA) @@ -3170,6 +3171,7 @@ urlFreeCache(); _urlPool = rpmioFreePool(_urlPool); +_digPool = rpmioFreePool(_digPool); _fdPool = rpmioFreePool(_fdPool); rpmlogClose(); @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmpgp.c $ cvs diff -u -r2.98 -r2.99 rpmpgp.c --- rpm/rpmio/rpmpgp.c12 Dec 2008 13:47:06 - 2.98 +++ rpm/rpmio/rpmpgp.c19 Mar 2009 16:29:24 - 2.99 @@ -1011,28 +1011,19 @@ /*...@unchecked@*/ pgpVSFlags pgpDigVSFlags; -pgpDig XpgpDigUnlink(pgpDig dig, const char * msg, const char * fn, unsigned ln) -{ -if (dig == NULL) return NULL; -/*...@-modfilesys@*/ -if (_pgp_debug < 0 && msg != NULL) -fprintf(stderr, "--> dig %p -- %d %s at %s:%u\n", dig, dig->nrefs, msg, fn, ln); -/*...@=modfilesys@*/ -dig->nrefs--; -return NULL; -} +/*...@unchecked@*/ /*...@null@*/ +rpmioPool _digPool; -pgpDig XpgpDigLink(pgpDig dig, const char * msg, const char * fn, unsigned ln) +static pgpDig digGetPool(/*...@null@*/ rpmioPool pool) + /*...@modifies pool @*/ { -if (dig == NULL) return NULL; -dig->nrefs++; - -/*...@-modfilesys@*/ -if (_pgp_debug < 0 && msg != NULL) -fprintf(stderr, "--> dig %p ++ %d %s at %s:%u\n", dig, dig->nrefs, msg, fn, ln); -/*...@=modfilesys@*/ +pgpDig dig; -/*...@-refcounttrans@*/ return dig; /*...@=refcounttrans@*/ +if (_digPool == NULL) { + _digPool = rpmioNewPool("dig", sizeof(*dig), -1, _pgp_debug); + pool = _digPool; +} +return (pgpDig) rpmioGetPool(pool, sizeof(*dig)); } void pgpDigClean(pgpDig dig) @@ -1070,18 +1061,31 @@ pgpDig pgpDigFree(pgpDig dig) { -if (dig != NULL) { +if (dig == NULL) + return NULL; /*...@-onlytrans@*/ - if (dig->nrefs > 1) - return pgpDigUnlink(dig, "pgpDigFree"); +yarnPossess(dig->use); +/*...@-modfilesys@*/ +if (_pgp_debug < 0) +fprintf(stderr, "--> dig %p -- %ld %s at %s:%u\n", dig, yarnPeekLock(dig->use), "pgpDigFree", __FILE__, __LINE__); +/*...@=modfilesys@*/ +if (yarnPeekLock(dig->use) <= 1L) { + yarnLock use = dig->use; /* Lose the header tag data. */ /* XXX this free should be done somewhere else. */ dig->sig = _free(dig->s
[CVS] RPM: rpm-5_1: rpm/ CHANGES rpm/rpmio/ librpmio.vers rpmio.c rpmp...
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: 19-Mar-2009 17:29:49 Branch: rpm-5_1 Handle: 2009031916294800 Modified files: (Branch: rpm-5_1) rpm CHANGES rpm/rpmio librpmio.vers rpmio.c rpmpgp.c rpmpgp.h Log: - yarn: convert pgpDig refcount to usage mutex (avoid recurse deadlock). Summary: RevisionChanges Path 1.2288.2.218+1 -0 rpm/CHANGES 2.63.2.11 +0 -2 rpm/rpmio/librpmio.vers 1.127.2.10 +2 -0 rpm/rpmio/rpmio.c 2.90.2.3+30 -29 rpm/rpmio/rpmpgp.c 2.72.2.4+7 -9 rpm/rpmio/rpmpgp.h patch -p0 <<'@@ .' Index: rpm/CHANGES $ cvs diff -u -r1.2288.2.217 -r1.2288.2.218 CHANGES --- rpm/CHANGES 19 Mar 2009 15:00:05 - 1.2288.2.217 +++ rpm/CHANGES 19 Mar 2009 16:29:48 - 1.2288.2.218 @@ -1,4 +1,5 @@ 5.1.7 -> 5.1.8: +- jbj: yarn: convert pgpDig refcount to usage mutex (avoid recurse deadlock). - jbj: yarn: convert rpmts refcount to usage mutex (avoid recurse deadlock). - jbj: rpmps: fix: avoid reusing items from pool for now. - jbj: yarn: convert rpmtsi refcount to usage mutex. @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/librpmio.vers $ cvs diff -u -r2.63.2.10 -r2.63.2.11 librpmio.vers --- rpm/rpmio/librpmio.vers 18 Mar 2009 19:29:52 - 2.63.2.10 +++ rpm/rpmio/librpmio.vers 19 Mar 2009 16:29:48 - 2.63.2.11 @@ -203,8 +203,6 @@ pgpDigClean; pgpDigFree; pgpDigNew; -XpgpDigLink; -XpgpDigUnlink; pgpDigVSFlags; _pgp_debug; _pgp_print; @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmio.c $ cvs diff -u -r1.127.2.9 -r1.127.2.10 rpmio.c --- rpm/rpmio/rpmio.c 18 Mar 2009 19:29:52 - 1.127.2.9 +++ rpm/rpmio/rpmio.c 19 Mar 2009 16:29:48 - 1.127.2.10 @@ -3192,6 +3192,7 @@ void rpmioClean(void) { +extern rpmioPool _digPool; extern rpmioPool _urlPool; #if defined(WITH_LUA) @@ -3209,6 +3210,7 @@ urlFreeCache(); _urlPool = rpmioFreePool(_urlPool); +_digPool = rpmioFreePool(_digPool); _fdPool = rpmioFreePool(_fdPool); rpmlogClose(); @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmpgp.c $ cvs diff -u -r2.90.2.2 -r2.90.2.3 rpmpgp.c --- rpm/rpmio/rpmpgp.c11 Jan 2009 03:26:21 - 2.90.2.2 +++ rpm/rpmio/rpmpgp.c19 Mar 2009 16:29:48 - 2.90.2.3 @@ -1007,28 +1007,19 @@ /*...@unchecked@*/ pgpVSFlags pgpDigVSFlags; -pgpDig XpgpDigUnlink(pgpDig dig, const char * msg, const char * fn, unsigned ln) -{ -if (dig == NULL) return NULL; -/*...@-modfilesys@*/ -if (_pgp_debug < 0 && msg != NULL) -fprintf(stderr, "--> dig %p -- %d %s at %s:%u\n", dig, dig->nrefs, msg, fn, ln); -/*...@=modfilesys@*/ -dig->nrefs--; -return NULL; -} +/*...@unchecked@*/ /*...@null@*/ +rpmioPool _digPool; -pgpDig XpgpDigLink(pgpDig dig, const char * msg, const char * fn, unsigned ln) +static pgpDig digGetPool(/*...@null@*/ rpmioPool pool) + /*...@modifies pool @*/ { -if (dig == NULL) return NULL; -dig->nrefs++; - -/*...@-modfilesys@*/ -if (_pgp_debug < 0 && msg != NULL) -fprintf(stderr, "--> dig %p ++ %d %s at %s:%u\n", dig, dig->nrefs, msg, fn, ln); -/*...@=modfilesys@*/ +pgpDig dig; -/*...@-refcounttrans@*/ return dig; /*...@=refcounttrans@*/ +if (_digPool == NULL) { + _digPool = rpmioNewPool("dig", sizeof(*dig), -1, _pgp_debug); + pool = _digPool; +} +return (pgpDig) rpmioGetPool(pool, sizeof(*dig)); } void pgpDigClean(pgpDig dig) @@ -1066,18 +1057,31 @@ pgpDig pgpDigFree(pgpDig dig) { -if (dig != NULL) { +if (dig == NULL) + return NULL; /*...@-onlytrans@*/ - if (dig->nrefs > 1) - return pgpDigUnlink(dig, "pgpDigFree"); +yarnPossess(dig->use); +/*...@-modfilesys@*/ +if (_pgp_debug < 0) +fprintf(stderr, "--> dig %p -- %ld %s at %s:%u\n", dig, yarnPeekLock(dig->use), "pgpDigFree", __FILE__, __LINE__); +/*...@=modfilesys@*/ +if (yarnPeekLock(dig->use) <= 1L) { + yarnLock use = dig->use; /* Lose the header tag data. */ /* X
[CVS] RPM: rpm/ CHANGES rpm/rpmio/ rpmio.c rpmxar.c rpmxar.h
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: 19-Mar-2009 18:33:43 Branch: HEAD Handle: 2009031917334300 Modified files: rpm CHANGES rpm/rpmio rpmio.c rpmxar.c rpmxar.h Log: - yarn: convert rpmxar refcount to usage mutex. Summary: RevisionChanges Path 1.2847 +1 -0 rpm/CHANGES 1.168 +3 -1 rpm/rpmio/rpmio.c 2.18+23 -34 rpm/rpmio/rpmxar.c 2.10+9 -18 rpm/rpmio/rpmxar.h patch -p0 <<'@@ .' Index: rpm/CHANGES $ cvs diff -u -r1.2846 -r1.2847 CHANGES --- rpm/CHANGES 19 Mar 2009 16:29:24 - 1.2846 +++ rpm/CHANGES 19 Mar 2009 17:33:43 - 1.2847 @@ -1,5 +1,6 @@ 5.2a3 -> 5.2a4: +- jbj: yarn: convert rpmxar refcount to usage mutex. - jbj: yarn: convert pgpDig refcount to usage mutex (avoid recurse deadlock). - jbj: yarn: convert rpmts refcount to usage mutex (avoid recurse deadlock). - jbj: rpmps: fix: avoid reusing items from pool for now. @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmio.c $ cvs diff -u -r1.167 -r1.168 rpmio.c --- rpm/rpmio/rpmio.c 19 Mar 2009 16:29:24 - 1.167 +++ rpm/rpmio/rpmio.c 19 Mar 2009 17:33:43 - 1.168 @@ -3154,6 +3154,7 @@ void rpmioClean(void) { extern rpmioPool _digPool; +extern rpmioPool _xarPool; extern rpmioPool _urlPool; #if defined(WITH_LUA) @@ -3170,8 +3171,9 @@ #endif urlFreeCache(); -_urlPool = rpmioFreePool(_urlPool); _digPool = rpmioFreePool(_digPool); +_xarPool = rpmioFreePool(_xarPool); +_urlPool = rpmioFreePool(_urlPool); _fdPool = rpmioFreePool(_fdPool); rpmlogClose(); @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmxar.c $ cvs diff -u -r2.17 -r2.18 rpmxar.c --- rpm/rpmio/rpmxar.c10 Mar 2008 04:46:20 - 2.17 +++ rpm/rpmio/rpmxar.c19 Mar 2009 17:33:43 - 2.18 @@ -58,8 +58,7 @@ #define _RPMXAR_INTERNAL #include - -#include +#include /* for fdGetXAR */ #include "debug.h" @@ -68,38 +67,31 @@ /*...@unchecked@*/ int _xar_debug = 0; -rpmxar XrpmxarUnlink(rpmxar xar, const char * msg, const char * fn, unsigned ln) -{ -if (xar == NULL) return NULL; -/*...@-modfilesys@*/ -if (_xar_debug && msg != NULL) -fprintf(stderr, "--> xar %p -- %d %s at %s:%u\n", xar, xar->nrefs, msg, fn, ln); -/*...@=modfilesys@*/ -xar->nrefs--; -return NULL; -} +/*...@unchecked@*/ /*...@null@*/ +rpmioPool _xarPool; -rpmxar XrpmxarLink(rpmxar xar, const char * msg, const char * fn, unsigned ln) +static rpmxar rpmxarGetPool(/*...@null@*/ rpmioPool pool) + /*...@modifies pool @*/ { -if (xar == NULL) return NULL; -xar->nrefs++; +rpmxar xar; -/*...@-modfilesys@*/ -if (_xar_debug && msg != NULL) -fprintf(stderr, "--> xar %p ++ %d %s at %s:%u\n", xar, xar->nrefs, msg, fn, ln); -/*...@=modfilesys@*/ - -/*...@-refcounttrans@*/ return xar; /*...@=refcounttrans@*/ +if (_xarPool == NULL) { + _xarPool = rpmioNewPool("xar", sizeof(*xar), -1, _xar_debug); + pool = _xarPool; +} +return (rpmxar) rpmioGetPool(pool, sizeof(*xar)); } - rpmxar rpmxarFree(rpmxar xar) { -if (xar) { - +if (xar == NULL) + return NULL; +yarnPossess(xar->use); +/*...@-modfilesys@*/ +if (_xar_debug) +fprintf(stderr, "--> xar %p -- %ld %s at %s:%u\n", xar, yarnPeekLock(xar->use), "rpmxarFree", __FILE__, __LINE__); +/*...@=modfilesys@*/ +if (yarnPeekLock(xar->use) <= 1L) { /*...@-onlytrans@*/ - if (xar->nrefs > 1) - return rpmxarUnlink(xar, "rpmxarFree"); - if (xar->i) { xar_iter_free(xar->i); xar->i = NULL; @@ -113,19 +105,16 @@ xar->member = _free(xar->member); xar->b = _free(xar->b); - (void) rpmxarUnlink(xar, "rpmxarFree"); /*...@=onlytrans@*/ - /*...@-refcounttrans -userelea...@*/ - memset(xar, 0, sizeof(*xar)); /* XXX trash and burn */ - xar = _free(xar); - /*...@=refcounttrans =userelea...@*/ -} + xar = (rpmxar) rpmioPutPool((rpmioItem)xar); +} else + yarnTwist(xar->use, BY, -1); return NULL; } rpmxar rp
[CVS] RPM: rpm-5_1: rpm/ CHANGES rpm/rpmio/ rpmio.c rpmxar.c rpmxar.h
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: 19-Mar-2009 18:38:44 Branch: rpm-5_1 Handle: 2009031917384400 Modified files: (Branch: rpm-5_1) rpm CHANGES rpm/rpmio rpmio.c rpmxar.c rpmxar.h Log: - jbj: yarn: convert rpmxar refcount to usage mutex. Summary: RevisionChanges Path 1.2288.2.219+1 -0 rpm/CHANGES 1.127.2.11 +3 -1 rpm/rpmio/rpmio.c 2.17.2.1+23 -34 rpm/rpmio/rpmxar.c 2.9.4.1 +9 -18 rpm/rpmio/rpmxar.h patch -p0 <<'@@ .' Index: rpm/CHANGES $ cvs diff -u -r1.2288.2.218 -r1.2288.2.219 CHANGES --- rpm/CHANGES 19 Mar 2009 16:29:48 - 1.2288.2.218 +++ rpm/CHANGES 19 Mar 2009 17:38:44 - 1.2288.2.219 @@ -1,4 +1,5 @@ 5.1.7 -> 5.1.8: +- jbj: yarn: convert rpmxar refcount to usage mutex. - jbj: yarn: convert pgpDig refcount to usage mutex (avoid recurse deadlock). - jbj: yarn: convert rpmts refcount to usage mutex (avoid recurse deadlock). - jbj: rpmps: fix: avoid reusing items from pool for now. @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmio.c $ cvs diff -u -r1.127.2.10 -r1.127.2.11 rpmio.c --- rpm/rpmio/rpmio.c 19 Mar 2009 16:29:48 - 1.127.2.10 +++ rpm/rpmio/rpmio.c 19 Mar 2009 17:38:44 - 1.127.2.11 @@ -3193,6 +3193,7 @@ void rpmioClean(void) { extern rpmioPool _digPool; +extern rpmioPool _xarPool; extern rpmioPool _urlPool; #if defined(WITH_LUA) @@ -3209,8 +3210,9 @@ #endif urlFreeCache(); -_urlPool = rpmioFreePool(_urlPool); _digPool = rpmioFreePool(_digPool); +_xarPool = rpmioFreePool(_xarPool); +_urlPool = rpmioFreePool(_urlPool); _fdPool = rpmioFreePool(_fdPool); rpmlogClose(); @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmxar.c $ cvs diff -u -r2.17 -r2.17.2.1 rpmxar.c --- rpm/rpmio/rpmxar.c10 Mar 2008 04:46:20 - 2.17 +++ rpm/rpmio/rpmxar.c19 Mar 2009 17:38:44 - 2.17.2.1 @@ -58,8 +58,7 @@ #define _RPMXAR_INTERNAL #include - -#include +#include /* for fdGetXAR */ #include "debug.h" @@ -68,38 +67,31 @@ /*...@unchecked@*/ int _xar_debug = 0; -rpmxar XrpmxarUnlink(rpmxar xar, const char * msg, const char * fn, unsigned ln) -{ -if (xar == NULL) return NULL; -/*...@-modfilesys@*/ -if (_xar_debug && msg != NULL) -fprintf(stderr, "--> xar %p -- %d %s at %s:%u\n", xar, xar->nrefs, msg, fn, ln); -/*...@=modfilesys@*/ -xar->nrefs--; -return NULL; -} +/*...@unchecked@*/ /*...@null@*/ +rpmioPool _xarPool; -rpmxar XrpmxarLink(rpmxar xar, const char * msg, const char * fn, unsigned ln) +static rpmxar rpmxarGetPool(/*...@null@*/ rpmioPool pool) + /*...@modifies pool @*/ { -if (xar == NULL) return NULL; -xar->nrefs++; +rpmxar xar; -/*...@-modfilesys@*/ -if (_xar_debug && msg != NULL) -fprintf(stderr, "--> xar %p ++ %d %s at %s:%u\n", xar, xar->nrefs, msg, fn, ln); -/*...@=modfilesys@*/ - -/*...@-refcounttrans@*/ return xar; /*...@=refcounttrans@*/ +if (_xarPool == NULL) { + _xarPool = rpmioNewPool("xar", sizeof(*xar), -1, _xar_debug); + pool = _xarPool; +} +return (rpmxar) rpmioGetPool(pool, sizeof(*xar)); } - rpmxar rpmxarFree(rpmxar xar) { -if (xar) { - +if (xar == NULL) + return NULL; +yarnPossess(xar->use); +/*...@-modfilesys@*/ +if (_xar_debug) +fprintf(stderr, "--> xar %p -- %ld %s at %s:%u\n", xar, yarnPeekLock(xar->use), "rpmxarFree", __FILE__, __LINE__); +/*...@=modfilesys@*/ +if (yarnPeekLock(xar->use) <= 1L) { /*...@-onlytrans@*/ - if (xar->nrefs > 1) - return rpmxarUnlink(xar, "rpmxarFree"); - if (xar->i) { xar_iter_free(xar->i); xar->i = NULL; @@ -113,19 +105,16 @@ xar->member = _free(xar->member); xar->b = _free(xar->b); - (void) rpmxarUnlink(xar, "rpmxarFree"); /*...@=onlytrans@*/ - /*...@-refcounttrans -userelea...@*/ - memset(xar, 0, sizeof(*xar)); /* XXX trash and burn */ - xar = _free(xar); - /*...@=refcounttrans =userelea...@*/ -} + xar = (rpmxar) rpmioPutPool((rpmioItem)xar); +} el
[CVS] RPM: rpm/lib/ rpmds.c rpmrc.c
RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Per Ãyvind Karlsen Root: /v/rpm/cvs Email: pkarl...@rpm5.org Module: rpm Date: 19-Mar-2009 18:46:24 Branch: HEAD Handle: 2009031917462300 Modified files: rpm/lib rpmds.c rpmrc.c Log: add cpuinfo(endianness) Summary: RevisionChanges Path 2.133 +11 -0 rpm/lib/rpmds.c 2.270 +28 -28 rpm/lib/rpmrc.c patch -p0 <<'@@ .' Index: rpm/lib/rpmds.c $ cvs diff -u -r2.132 -r2.133 rpmds.c --- rpm/lib/rpmds.c 18 Mar 2009 22:11:21 - 2.132 +++ rpm/lib/rpmds.c 19 Mar 2009 17:46:23 - 2.133 @@ -5,6 +5,7 @@ #if defined(SUPPORT_LIBCPUINFO) #include +#include #endif #if defined(HAVE_GELF_H) && !defined(__FreeBSD__) @@ -1217,6 +1218,16 @@ rpmdsNSAdd(dsp, NS, "cpu_cores", tmp, RPMSENSE_PROBE|RPMSENSE_EQUAL); snprintf(tmp, 19, "%d", cpuinfo_get_threads(cip)); rpmdsNSAdd(dsp, NS, "cpu_threads", tmp, RPMSENSE_PROBE|RPMSENSE_EQUAL); +#ifdef __BYTE_ORDER +#if __BYTE_ORDER == LITTLE_ENDIAN +#define endian "little" +#elif __BYTE_ORDER == BIG_ENDIAN +#define endian "big" +#elif __BYTE_ORDER == PDP_ENDIAN +#define endian "pdp" +#endif +rpmdsNSAdd(dsp, NS, "endianness", endian, RPMSENSE_PROBE|RPMSENSE_EQUAL); +#endif for (feature = cpuinfo_feature_common; feature != cpuinfo_feature_architecture_max; feature++) { if(feature == cpuinfo_feature_common_max) @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmrc.c $ cvs diff -u -r2.269 -r2.270 rpmrc.c --- rpm/lib/rpmrc.c 19 Mar 2009 00:20:18 - 2.269 +++ rpm/lib/rpmrc.c 19 Mar 2009 17:46:23 - 2.270 @@ -503,9 +503,9 @@ /*...@=onlytrans@*/ #if defined(SUPPORT_LIBCPUINFO) -static inline int rpmCpuinfoMatch(const char * feature, rpmds cpuinfo) +static inline int rpmCpuinfoMatch(const char * feature, const char * EVR, rpmds cpuinfo) { -rpmds cpufeature = rpmdsSingle(RPMTAG_REQUIRENAME, feature, "", RPMSENSE_PROBE); +rpmds cpufeature = rpmdsSingle(RPMTAG_REQUIRENAME, feature, EVR, RPMSENSE_PROBE); int ret = rpmdsMatch(cpufeature, cpuinfo); cpufeature = rpmdsFree(cpufeature); return ret; @@ -523,59 +523,59 @@ xx = rpmdsCpuinfo(&cpuinfo, NULL); -if(rpmCpuinfoMatch("cpuinfo([x86])", cpuinfo)) { - if(rpmCpuinfoMatch("cpuinfo(64bit)", cpuinfo)) +if(rpmCpuinfoMatch("cpuinfo([x86])", "", cpuinfo)) { + if(rpmCpuinfoMatch("cpuinfo(64bit)", "", cpuinfo)) { xx = mireAppend(RPMMIRE_REGEX, 0, "x86_64", NULL, &mi_re, &mi_nre); xx = mireAppend(RPMMIRE_REGEX, 0, "amd64", NULL, &mi_re, &mi_nre); } - if(rpmCpuinfoMatch("cpuinfo(cmov)", cpuinfo)) { - if(rpmCpuinfoMatch("cpuinfo(mmx)", cpuinfo)) { - if(rpmCpuinfoMatch("cpuinfo(sse)", cpuinfo)) { - if(rpmCpuinfoMatch("cpuinfo(sse2)", cpuinfo)) + if(rpmCpuinfoMatch("cpuinfo(cmov)", "", cpuinfo)) { + if(rpmCpuinfoMatch("cpuinfo(mmx)", "", cpuinfo)) { + if(rpmCpuinfoMatch("cpuinfo(sse)", "", cpuinfo)) { + if(rpmCpuinfoMatch("cpuinfo(sse2)", "", cpuinfo)) xx = mireAppend(RPMMIRE_REGEX, 0, "pentium4", NULL, &mi_re, &mi_nre); xx = mireAppend(RPMMIRE_REGEX, 0, "pentium3", NULL, &mi_re, &mi_nre); } - if(rpmCpuinfoMatch("cpuinfo(3dnowext)", cpuinfo)) + if(rpmCpuinfoMatch("cpuinfo(3dnowext)", "", cpuinfo)) xx = mireAppend(RPMMIRE_REGEX, 0, "athlon", NULL, &mi_re, &mi_nre); xx = mireAppend(RPMMIRE_REGEX, 0, "pentium2", NULL, &mi_re, &mi_nre); } xx = mireAppend(RPMMIRE_REGEX, 0, "i686", NULL, &mi_re, &mi_nre); } - if(rpmCpuinfoMatch("cpuinfo(3dnow)", cpuinfo) && rpmCpuinfoMatch("cpuinfo(mmx)", cpuinfo)) + if(rpmCpuinfoMatch("cpuinfo(3dnow)", "", cpuinfo) && rpmCpuinfoMatch("cpuinfo(mmx)", "", cpuinfo)) xx = mireAppend(RPMMIRE_REGEX, 0, "geode", NULL, &mi_re, &mi_nre); - if(rpmCpuinfoMatch("cpuinfo(tsc)", cpuinfo)) + if(rpmCpuinfoMatch("cpuinfo(tsc)", "", cpuinfo)) xx = mireAppend(RPMMIRE_REGEX, 0, "i586", NULL, &mi_re, &mi_nre); - if(rpmCpuinfoMatch("cpuinfo(ac)", cpuinfo)) + if(rpmCpuinfoMatch("cpuinfo(ac)", "", cpuinfo)) xx = mireAppend(RPMMIRE_REGEX, 0, "i486", NULL, &mi_re, &mi_nre); xx =
[CVS] RPM: rpm/ CHANGES rpm/lib/ librpm.vers poptALL.c psm.c psm.h
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: 19-Mar-2009 19:22:04 Branch: HEAD Handle: 2009031918220300 Modified files: rpm CHANGES rpm/lib librpm.vers poptALL.c psm.c psm.h Log: - yarn: convert psm refcount to usage mutex. Summary: RevisionChanges Path 1.2848 +1 -0 rpm/CHANGES 1.61+0 -6 rpm/lib/librpm.vers 2.113 +4 -0 rpm/lib/poptALL.c 2.346 +38 -44 rpm/lib/psm.c 2.69+8 -20 rpm/lib/psm.h patch -p0 <<'@@ .' Index: rpm/CHANGES $ cvs diff -u -r1.2847 -r1.2848 CHANGES --- rpm/CHANGES 19 Mar 2009 17:33:43 - 1.2847 +++ rpm/CHANGES 19 Mar 2009 18:22:03 - 1.2848 @@ -1,5 +1,6 @@ 5.2a3 -> 5.2a4: +- jbj: yarn: convert psm refcount to usage mutex. - jbj: yarn: convert rpmxar refcount to usage mutex. - jbj: yarn: convert pgpDig refcount to usage mutex (avoid recurse deadlock). - jbj: yarn: convert rpmts refcount to usage mutex (avoid recurse deadlock). @@ . patch -p0 <<'@@ .' Index: rpm/lib/librpm.vers $ cvs diff -u -r1.60 -r1.61 librpm.vers --- rpm/lib/librpm.vers 19 Mar 2009 14:57:21 - 1.60 +++ rpm/lib/librpm.vers 19 Mar 2009 18:22:03 - 1.61 @@ -404,12 +404,6 @@ showVerifyPackage; specedit; strict_erasures; -_tar_debug; -tarHeaderRead; -tarHeaderWrite; -tarTrailerWrite; -XrpmpsmLink; -XrpmpsmUnlink; XrpmtsiFree; XrpmtsiInit; local: @@ . patch -p0 <<'@@ .' Index: rpm/lib/poptALL.c $ cvs diff -u -r2.112 -r2.113 poptALL.c --- rpm/lib/poptALL.c 19 Mar 2009 14:57:21 - 2.112 +++ rpm/lib/poptALL.c 19 Mar 2009 18:22:03 - 2.113 @@ -78,6 +78,8 @@ /*...@unchecked@*/ extern int _psm_debug; +/*...@unchecked@*/ +extern rpmioPool _psmPool; /*...@unchecked@*/ extern int _psm_threads; @@ -466,7 +468,9 @@ _rpmgiPool = rpmioFreePool(_rpmgiPool); +_psmPool = rpmioFreePool(_psmPool); _rpmtsiPool = rpmioFreePool(_rpmtsiPool); + _rpmtsPool = rpmioFreePool(_rpmtsPool); _rpmtePool = rpmioFreePool(_rpmtePool); _rpmpsPool = rpmioFreePool(_rpmpsPool); @@ . patch -p0 <<'@@ .' Index: rpm/lib/psm.c $ cvs diff -u -r2.345 -r2.346 psm.c --- rpm/lib/psm.c 14 Mar 2009 23:46:19 - 2.345 +++ rpm/lib/psm.c 19 Mar 2009 18:22:03 - 2.346 @@ -61,6 +61,21 @@ /*...@access rpmluav @*/ +/*...@unchecked@*/ /*...@null@*/ +rpmioPool _psmPool; + +static rpmpsm rpmpsmGetPool(/*...@null@*/ rpmioPool pool) + /*...@modifies pool @*/ +{ +rpmpsm psm; + +if (_psmPool == NULL) { + _psmPool = rpmioNewPool("psm", sizeof(*psm), -1, _psm_debug); + pool = _psmPool; +} +return (rpmpsm) rpmioGetPool(pool, sizeof(*psm)); +} + /** * Mark files in database shared with this package as "replaced". * @param psmpackage state machine data @@ -1535,62 +1550,41 @@ /*...@noteached@*/ } -rpmpsm XrpmpsmUnlink(rpmpsm psm, const char * msg, const char * fn, unsigned ln) +rpmpsm rpmpsmFree(rpmpsm psm) { -if (psm == NULL) return NULL; -/*...@-modfilesys@*/ -if (_psm_debug && msg != NULL) -fprintf(stderr, "--> psm %p -- %d %s at %s:%u\n", psm, psm->nrefs, msg, fn, ln); -/*...@=modfilesys@*/ -psm->nrefs--; -return NULL; -} +static const char msg[] = "rpmpsmFree"; +if (psm == NULL) + return NULL; -rpmpsm XrpmpsmLink(rpmpsm psm, const char * msg, const char * fn, unsigned ln) -{ -if (psm == NULL) return NULL; -psm->nrefs++; +yarnPossess(psm->use); /*...@-modfilesys@*/ -if (_psm_debug && msg != NULL) -fprintf(stderr, "--> psm %p ++ %d %s at %s:%u\n", psm, psm->nrefs, msg, fn, ln); +if (_psm_debug) +fprintf(stderr, "--> psm %p -- %ld %s at %s:%u\n", psm, yarnPeekLock(psm->use), msg, __FILE__, __LINE__); /*...@=modfilesys@*/ -/*...@-refcounttrans@*/ return psm; /*...@=refcounttrans@*/ -} - -rpmpsm rpmpsmFree(rpmpsm psm) -{ -const char * msg = "rpmpsmFree"; -if (psm == NULL) - return NU
[CVS] RPM: rpm-5_1: rpm/ CHANGES rpm/lib/ librpm.vers poptALL.c psm.c ...
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: 19-Mar-2009 19:22:30 Branch: rpm-5_1 Handle: 2009031918222901 Modified files: (Branch: rpm-5_1) rpm CHANGES rpm/lib librpm.vers poptALL.c psm.c psm.h Log: - yarn: convert psm refcount to usage mutex. Summary: RevisionChanges Path 1.2288.2.220+1 -0 rpm/CHANGES 1.39.2.13 +0 -6 rpm/lib/librpm.vers 2.90.2.13 +4 -0 rpm/lib/poptALL.c 2.298.2.10 +27 -33 rpm/lib/psm.c 2.63.2.2+8 -20 rpm/lib/psm.h patch -p0 <<'@@ .' Index: rpm/CHANGES $ cvs diff -u -r1.2288.2.219 -r1.2288.2.220 CHANGES --- rpm/CHANGES 19 Mar 2009 17:38:44 - 1.2288.2.219 +++ rpm/CHANGES 19 Mar 2009 18:22:29 - 1.2288.2.220 @@ -1,4 +1,5 @@ 5.1.7 -> 5.1.8: +- jbj: yarn: convert psm refcount to usage mutex. - jbj: yarn: convert rpmxar refcount to usage mutex. - jbj: yarn: convert pgpDig refcount to usage mutex (avoid recurse deadlock). - jbj: yarn: convert rpmts refcount to usage mutex (avoid recurse deadlock). @@ . patch -p0 <<'@@ .' Index: rpm/lib/librpm.vers $ cvs diff -u -r1.39.2.12 -r1.39.2.13 librpm.vers --- rpm/lib/librpm.vers 19 Mar 2009 15:00:06 - 1.39.2.12 +++ rpm/lib/librpm.vers 19 Mar 2009 18:22:30 - 1.39.2.13 @@ -403,12 +403,6 @@ specedit; splitString; strict_erasures; -_tar_debug; -tarHeaderRead; -tarHeaderWrite; -tarTrailerWrite; -XrpmpsmLink; -XrpmpsmUnlink; XrpmtsiFree; XrpmtsiInit; local: @@ . patch -p0 <<'@@ .' Index: rpm/lib/poptALL.c $ cvs diff -u -r2.90.2.12 -r2.90.2.13 poptALL.c --- rpm/lib/poptALL.c 19 Mar 2009 15:00:06 - 2.90.2.12 +++ rpm/lib/poptALL.c 19 Mar 2009 18:22:30 - 2.90.2.13 @@ -66,6 +66,8 @@ /*...@unchecked@*/ extern int _psm_debug; +/*...@unchecked@*/ +extern rpmioPool _psmPool; /*...@unchecked@*/ extern int _psm_threads; @@ -452,7 +454,9 @@ _rpmgiPool = rpmioFreePool(_rpmgiPool); +_psmPool = rpmioFreePool(_psmPool); _rpmtsiPool = rpmioFreePool(_rpmtsiPool); + _rpmtsPool = rpmioFreePool(_rpmtsPool); _rpmtePool = rpmioFreePool(_rpmtePool); _rpmpsPool = rpmioFreePool(_rpmpsPool); @@ . patch -p0 <<'@@ .' Index: rpm/lib/psm.c $ cvs diff -u -r2.298.2.9 -r2.298.2.10 psm.c --- rpm/lib/psm.c 16 Mar 2009 10:32:04 - 2.298.2.9 +++ rpm/lib/psm.c 19 Mar 2009 18:22:30 - 2.298.2.10 @@ -59,6 +59,21 @@ /*...@access rpmluav @*/ +/*...@unchecked@*/ /*...@null@*/ +rpmioPool _psmPool; + +static rpmpsm rpmpsmGetPool(/*...@null@*/ rpmioPool pool) + /*...@modifies pool @*/ +{ +rpmpsm psm; + +if (_psmPool == NULL) { + _psmPool = rpmioNewPool("psm", sizeof(*psm), -1, _psm_debug); + pool = _psmPool; +} +return (rpmpsm) rpmioGetPool(pool, sizeof(*psm)); +} + /** * Mark files in database shared with this package as "replaced". * @param psmpackage state machine data @@ -1532,38 +1547,20 @@ /*...@noteached@*/ } -rpmpsm XrpmpsmUnlink(rpmpsm psm, const char * msg, const char * fn, unsigned ln) +rpmpsm rpmpsmFree(rpmpsm psm) { -if (psm == NULL) return NULL; -/*...@-modfilesys@*/ -if (_psm_debug && msg != NULL) -fprintf(stderr, "--> psm %p -- %d %s at %s:%u\n", psm, psm->nrefs, msg, fn, ln); -/*...@=modfilesys@*/ -psm->nrefs--; +static const char msg[] = "rpmpsmFree"; +if (psm == NULL) return NULL; -} -rpmpsm XrpmpsmLink(rpmpsm psm, const char * msg, const char * fn, unsigned ln) -{ -if (psm == NULL) return NULL; -psm->nrefs++; +yarnPossess(psm->use); /*...@-modfilesys@*/ -if (_psm_debug && msg != NULL) -fprintf(stderr, "--> psm %p ++ %d %s at %s:%u\n", psm, psm->nrefs, msg, fn, ln); +if (_psm_debug) +fprintf(stderr, "--> psm %p -- %ld %s at %s:%u\n", psm, yarnPeekLock(psm->use), msg, __FILE__, __LINE__); /*...@=modfilesys@*/ -/*...@-refcounttrans@*/ return psm; /*...@=refcounttrans@*/ -} - -rpmpsm rpmpsmFree(rpmpsm psm) -{ -
[CVS] RPM: rpm/ CHANGES rpm/lib/ poptALL.c rpm/rpmdb/ librpmdb.vers rp...
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: 19-Mar-2009 20:49:20 Branch: HEAD Handle: 2009031919491901 Modified files: rpm CHANGES rpm/lib poptALL.c rpm/rpmdb librpmdb.vers rpmdb.c rpmdb.h Log: - yarn: convert rpmdb refcount to usage mutex. Summary: RevisionChanges Path 1.2849 +1 -0 rpm/CHANGES 2.114 +3 -0 rpm/lib/poptALL.c 1.57+1 -2 rpm/rpmdb/librpmdb.vers 1.279 +71 -68 rpm/rpmdb/rpmdb.c 1.84+11 -20 rpm/rpmdb/rpmdb.h patch -p0 <<'@@ .' Index: rpm/CHANGES $ cvs diff -u -r1.2848 -r1.2849 CHANGES --- rpm/CHANGES 19 Mar 2009 18:22:03 - 1.2848 +++ rpm/CHANGES 19 Mar 2009 19:49:19 - 1.2849 @@ -1,5 +1,6 @@ 5.2a3 -> 5.2a4: +- jbj: yarn: convert rpmdb refcount to usage mutex. - jbj: yarn: convert psm refcount to usage mutex. - jbj: yarn: convert rpmxar refcount to usage mutex. - jbj: yarn: convert pgpDig refcount to usage mutex (avoid recurse deadlock). @@ . patch -p0 <<'@@ .' Index: rpm/lib/poptALL.c $ cvs diff -u -r2.113 -r2.114 poptALL.c --- rpm/lib/poptALL.c 19 Mar 2009 18:22:03 - 2.113 +++ rpm/lib/poptALL.c 19 Mar 2009 19:49:19 - 2.114 @@ -465,6 +465,7 @@ /*...@modifies keyids @*/ { extern rpmioPool _headerPool; +extern rpmioPool _rpmdbPool; _rpmgiPool = rpmioFreePool(_rpmgiPool); @@ -478,6 +479,8 @@ _rpmsxPool = rpmioFreePool(_rpmsxPool); _rpmdsPool = rpmioFreePool(_rpmdsPool); _rpmfiPool = rpmioFreePool(_rpmfiPool); + +_rpmdbPool = rpmioFreePool(_rpmdbPool); _headerPool = rpmioFreePool(_headerPool); /* XXX this should be done in the rpmioClean() wrapper. */ @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/librpmdb.vers $ cvs diff -u -r1.56 -r1.57 librpmdb.vers --- rpm/rpmdb/librpmdb.vers 17 Mar 2009 23:59:04 - 1.56 +++ rpm/rpmdb/librpmdb.vers 19 Mar 2009 19:49:20 - 1.57 @@ -87,6 +87,7 @@ rpmAddSignature; rpmCheckPassPhrase; rpmDatabasePoptTable; +_rpmdbPool; rpmdbAdd; rpmdbAppendIterator; rpmDBArgs; @@ -185,8 +186,6 @@ tagType; tagTypeValidate; tagValue; -XrpmdbLink; -XrpmdbUnlink; local: *; }; @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/rpmdb.c $ cvs diff -u -r1.278 -r1.279 rpmdb.c --- rpm/rpmdb/rpmdb.c 19 Feb 2009 15:27:07 - 1.278 +++ rpm/rpmdb/rpmdb.c 19 Mar 2009 19:49:20 - 1.279 @@ -67,7 +67,6 @@ /*...@unchecked@*/ static int _db_filter_dups = 0; - /* Use a path uniquifier in the upper 16 bits of tagNum? */ /* XXX Note: one cannot just choose a value, rpmdb tagNum's need fixing too */ #define _DB_TAGGED_FILE_INDICES 1 @@ -930,12 +929,27 @@ /*...@-fullinitblock@*/ /*...@observer@*/ /*...@unchecked@*/ -static struct rpmdb_s dbTemplate = { +static struct rpmdb_s dbTemplate = { NULL, NULL, _DB_ROOT,_DB_HOME, _DB_FLAGS, _DB_MODE, _DB_PERMS, _DB_MAJOR, _DB_ERRPFX }; /*...@=fullinitblock@*/ +/*...@unchecked@*/ /*...@null@*/ +rpmioPool _rpmdbPool; + +static rpmdb rpmdbGetPool(/*...@null@*/ rpmioPool pool) + /*...@modifies pool @*/ +{ +rpmdb db; + +if (_rpmdbPool == NULL) { + _rpmdbPool = rpmioNewPool("db", sizeof(*db), -1, _rpmdb_debug); + pool = _rpmdbPool; +} +return (rpmdb) rpmioGetPool(pool, sizeof(*db)); +} + int rpmdbOpenAll(rpmdb db) { size_t dbix; @@ -1015,6 +1029,7 @@ /*...@globals rpmdbRock @*/ /*...@modifies rpmdbRock @*/ { +static const char msg[] = "rpmdbClose"; rpmdb * prev, next; size_t dbix; int rc = 0; @@ -1022,55 +1037,59 @@ if (db == NULL) return rc; -(void) rpmdbUnlink(db, "rpmdbClose"); +yarnPossess(db->use); +/*...@-modfilesys@*/ +if (_rpmdb_debug) +fprintf(stderr, "--> db %p -- %ld %s at %s:%u\n", db, yarnPeekLock(db->use), msg, __FILE__, __LINE__); /*...@-usereleased@*/ -if (db->nrefs > 0) - return rc; +if (yarnPeekLock(db->us
[CVS] RPM: rpm-5_1: rpm/ CHANGES rpm/lib/ poptALL.c rpm/rpmdb/ librpmd...
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: 19-Mar-2009 20:50:09 Branch: rpm-5_1 Handle: 2009031919500801 Modified files: (Branch: rpm-5_1) rpm CHANGES rpm/lib poptALL.c rpm/rpmdb librpmdb.vers rpmdb.c rpmdb.h Log: - jbj: yarn: convert rpmdb refcount to usage mutex. Summary: RevisionChanges Path 1.2288.2.221+1 -0 rpm/CHANGES 2.90.2.14 +3 -0 rpm/lib/poptALL.c 1.43.2.8+1 -2 rpm/rpmdb/librpmdb.vers 1.246.2.5 +59 -55 rpm/rpmdb/rpmdb.c 1.73.2.4+11 -20 rpm/rpmdb/rpmdb.h patch -p0 <<'@@ .' Index: rpm/CHANGES $ cvs diff -u -r1.2288.2.220 -r1.2288.2.221 CHANGES --- rpm/CHANGES 19 Mar 2009 18:22:29 - 1.2288.2.220 +++ rpm/CHANGES 19 Mar 2009 19:50:08 - 1.2288.2.221 @@ -1,4 +1,5 @@ 5.1.7 -> 5.1.8: +- jbj: yarn: convert rpmdb refcount to usage mutex. - jbj: yarn: convert psm refcount to usage mutex. - jbj: yarn: convert rpmxar refcount to usage mutex. - jbj: yarn: convert pgpDig refcount to usage mutex (avoid recurse deadlock). @@ . patch -p0 <<'@@ .' Index: rpm/lib/poptALL.c $ cvs diff -u -r2.90.2.13 -r2.90.2.14 poptALL.c --- rpm/lib/poptALL.c 19 Mar 2009 18:22:30 - 2.90.2.13 +++ rpm/lib/poptALL.c 19 Mar 2009 19:50:09 - 2.90.2.14 @@ -451,6 +451,7 @@ /*...@modifies keyids @*/ { extern rpmioPool _headerPool; +extern rpmioPool _rpmdbPool; _rpmgiPool = rpmioFreePool(_rpmgiPool); @@ -464,6 +465,8 @@ _rpmsxPool = rpmioFreePool(_rpmsxPool); _rpmdsPool = rpmioFreePool(_rpmdsPool); _rpmfiPool = rpmioFreePool(_rpmfiPool); + +_rpmdbPool = rpmioFreePool(_rpmdbPool); _headerPool = rpmioFreePool(_headerPool); /* XXX this should be done in the rpmioClean() wrapper. */ @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/librpmdb.vers $ cvs diff -u -r1.43.2.7 -r1.43.2.8 librpmdb.vers --- rpm/rpmdb/librpmdb.vers 18 Mar 2009 00:00:05 - 1.43.2.7 +++ rpm/rpmdb/librpmdb.vers 19 Mar 2009 19:50:09 - 1.43.2.8 @@ -86,6 +86,7 @@ rpmAddSignature; rpmCheckPassPhrase; rpmDatabasePoptTable; +_rpmdbPool; rpmdbAdd; rpmdbAppendIterator; rpmDBArgs; @@ -171,8 +172,6 @@ tagType; tagTypeValidate; tagValue; -XrpmdbLink; -XrpmdbUnlink; local: *; }; @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/rpmdb.c $ cvs diff -u -r1.246.2.4 -r1.246.2.5 rpmdb.c --- rpm/rpmdb/rpmdb.c 15 Oct 2008 19:53:30 - 1.246.2.4 +++ rpm/rpmdb/rpmdb.c 19 Mar 2009 19:50:09 - 1.246.2.5 @@ -926,12 +926,27 @@ /*...@-fullinitblock@*/ /*...@observer@*/ /*...@unchecked@*/ -static struct rpmdb_s dbTemplate = { +static struct rpmdb_s dbTemplate = { NULL, NULL, _DB_ROOT,_DB_HOME, _DB_FLAGS, _DB_MODE, _DB_PERMS, _DB_MAJOR, _DB_ERRPFX }; /*...@=fullinitblock@*/ +/*...@unchecked@*/ /*...@null@*/ +rpmioPool _rpmdbPool; + +static rpmdb rpmdbGetPool(/*...@null@*/ rpmioPool pool) + /*...@modifies pool @*/ +{ +rpmdb db; + +if (_rpmdbPool == NULL) { + _rpmdbPool = rpmioNewPool("db", sizeof(*db), -1, _rpmdb_debug); + pool = _rpmdbPool; +} +return (rpmdb) rpmioGetPool(pool, sizeof(*db)); +} + int rpmdbOpenAll(rpmdb db) { size_t dbix; @@ -1011,6 +1026,7 @@ /*...@globals rpmdbRock @*/ /*...@modifies rpmdbRock @*/ { +static const char msg[] = "rpmdbClose"; rpmdb * prev, next; size_t dbix; int rc = 0; @@ -1018,44 +1034,48 @@ if (db == NULL) goto exit; -(void) rpmdbUnlink(db, "rpmdbClose"); +yarnPossess(db->use); +/*...@-modfilesys@*/ +if (_rpmdb_debug) +fprintf(stderr, "--> db %p -- %ld %s at %s:%u\n", db, yarnPeekLock(db->use), msg, __FILE__, __LINE__); /*...@-usereleased@*/ -if (db->nrefs > 0) - goto exit; +if (yarnPeekLock(db->use) <= 1L) { -if (db->_dbi) -for (dbix = db->db_ndbi; dbix;) { - int xx; - dbix--; - if (db->_dbi[dbix] == NULL) - continue; -
[CVS] RPM: rpm/lib/ rpmds.c
RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Per Ãyvind Karlsen Root: /v/rpm/cvs Email: pkarl...@rpm5.org Module: rpm Date: 19-Mar-2009 21:35:07 Branch: HEAD Handle: 2009031920350700 Modified files: rpm/lib rpmds.c Log: detect cpuinfo(endianness) at runtime Summary: RevisionChanges Path 2.134 +14 -11 rpm/lib/rpmds.c patch -p0 <<'@@ .' Index: rpm/lib/rpmds.c $ cvs diff -u -r2.133 -r2.134 rpmds.c --- rpm/lib/rpmds.c 19 Mar 2009 17:46:23 - 2.133 +++ rpm/lib/rpmds.c 19 Mar 2009 20:35:07 - 2.134 @@ -5,7 +5,6 @@ #if defined(SUPPORT_LIBCPUINFO) #include -#include #endif #if defined(HAVE_GELF_H) && !defined(__FreeBSD__) @@ -1210,6 +1209,12 @@ struct cpuinfo *cip = cpuinfo_new(); cpuinfo_feature_t feature; char tmp[20]; +union _dbswap { + rpmuint32_t ui; + unsigned char uc[4]; +}; +static union _dbswap orderedbytes = { .ui = 0x11223344 }; +const char * endianness = NULL; snprintf(tmp, 19, "%d", cpuinfo_get_frequency(cip)); tmp[19] = '\0'; @@ -1218,16 +1223,14 @@ rpmdsNSAdd(dsp, NS, "cpu_cores", tmp, RPMSENSE_PROBE|RPMSENSE_EQUAL); snprintf(tmp, 19, "%d", cpuinfo_get_threads(cip)); rpmdsNSAdd(dsp, NS, "cpu_threads", tmp, RPMSENSE_PROBE|RPMSENSE_EQUAL); -#ifdef __BYTE_ORDER -#if __BYTE_ORDER == LITTLE_ENDIAN -#define endian "little" -#elif __BYTE_ORDER == BIG_ENDIAN -#define endian "big" -#elif __BYTE_ORDER == PDP_ENDIAN -#define endian "pdp" -#endif -rpmdsNSAdd(dsp, NS, "endianness", endian, RPMSENSE_PROBE|RPMSENSE_EQUAL); -#endif + +if(orderedbytes.uc[0] == 0x44) + endianness = "little"; +else if(orderedbytes.uc[0] == 0x11) + endianness = "big"; +else if(orderedbytes.uc[0] == 0x22) + endianness = "pdp"; +rpmdsNSAdd(dsp, NS, "endianness", endianness, RPMSENSE_PROBE|RPMSENSE_EQUAL); for (feature = cpuinfo_feature_common; feature != cpuinfo_feature_architecture_max; feature++) { if(feature == cpuinfo_feature_common_max) @@ . __ RPM Package Managerhttp://rpm5.org CVS Sources Repositoryrpm-cvs@rpm5.org