From acf19af1ab27ad071c1614f9610ae29eb5c902c1 Mon Sep 17 00:00:00 2001 From: jbj Date: Thu, 11 Nov 2004 15:58:46 +0000 Subject: Upgrade to db-4.3.21. CVS patchset: 7578 CVS date: 2004/11/11 15:58:46 --- db/lock/lock.c | 31 +++++++++++++------------------ db/lock/lock_deadlock.c | 11 +++++------ db/lock/lock_id.c | 9 ++++----- db/lock/lock_region.c | 38 ++++++++++++++++---------------------- db/lock/lock_stat.c | 4 ++-- 5 files changed, 40 insertions(+), 53 deletions(-) (limited to 'db/lock') diff --git a/db/lock/lock.c b/db/lock/lock.c index 4e4b07890..2b4f63e0d 100644 --- a/db/lock/lock.c +++ b/db/lock/lock.c @@ -4,7 +4,7 @@ * Copyright (c) 1996-2004 * Sleepycat Software. All rights reserved. * - * $Id: lock.c,v 11.166 2004/10/11 19:38:49 ubell Exp $ + * $Id: lock.c,v 11.167 2004/10/15 16:59:41 bostic Exp $ */ #include "db_config.h" @@ -237,8 +237,7 @@ __lock_vec(dbenv, locker, flags, list, nlist, elistp) locker_links, __db_lock)) { if (lp->mode != DB_LOCK_WWRITE) continue; - lock.off = R_OFFSET(dbenv, - <->reginfo, lp); + lock.off = R_OFFSET(<->reginfo, lp); lock.gen = lp->gen; F_SET(sh_locker, DB_LOCKER_INABORT); if ((ret = __lock_get_internal(lt, @@ -482,8 +481,8 @@ __lock_get_internal(lt, locker, flags, obj, lock_mode, timeout, lock) if (obj == NULL) { DB_ASSERT(LOCK_ISSET(*lock)); - lp = (struct __db_lock *)R_ADDR(dbenv, <->reginfo, lock->off); - sh_obj = (DB_LOCKOBJ *) ((u_int8_t *)lp + lp->obj); + lp = R_ADDR(<->reginfo, lock->off); + sh_obj = (DB_LOCKOBJ *)((u_int8_t *)lp + lp->obj); } else { /* Allocate a shared memory new object. */ OBJECT_LOCK(lt, region, obj, lock->ndx); @@ -563,7 +562,7 @@ __lock_get_internal(lt, locker, flags, obj, lock_mode, timeout, lock) * the locker. */ lp->refcount++; - lock->off = R_OFFSET(dbenv, <->reginfo, lp); + lock->off = R_OFFSET(<->reginfo, lp); lock->gen = lp->gen; lock->mode = lp->mode; goto done; @@ -704,13 +703,12 @@ __lock_get_internal(lt, locker, flags, obj, lock_mode, timeout, lock) upgrade: if (wwrite != NULL) { lp = wwrite; lp->refcount++; - lock->off = R_OFFSET(dbenv, <->reginfo, lp); + lock->off = R_OFFSET(<->reginfo, lp); lock->gen = lp->gen; lock->mode = lock_mode; } else - lp = (struct __db_lock *)R_ADDR(dbenv, - <->reginfo, lock->off); + lp = R_ADDR(<->reginfo, lock->off); if (IS_WRITELOCK(lock_mode) && !IS_WRITELOCK(lp->mode)) sh_locker->nwrites++; lp->mode = lock_mode; @@ -874,7 +872,7 @@ expired: SHOBJECT_LOCK(lt, region, sh_obj, obj_ndx); } } - lock->off = R_OFFSET(dbenv, <->reginfo, newl); + lock->off = R_OFFSET(<->reginfo, newl); lock->gen = newl->gen; lock->mode = newl->mode; sh_locker->nlocks++; @@ -974,7 +972,7 @@ __lock_put_nolock(dbenv, lock, runp, flags) lt = dbenv->lk_handle; region = lt->reginfo.primary; - lockp = (struct __db_lock *)R_ADDR(dbenv, <->reginfo, lock->off); + lockp = R_ADDR(<->reginfo, lock->off); if (lock->gen != lockp->gen) { __db_err(dbenv, __db_lock_invalid, "DB_LOCK->lock_put"); LOCK_INIT(*lock); @@ -1040,7 +1038,7 @@ __lock_downgrade(dbenv, lock, new_mode, flags) if (!LF_ISSET(DB_LOCK_NOREGION)) LOCKREGION(dbenv, lt); - lockp = (struct __db_lock *)R_ADDR(dbenv, <->reginfo, lock->off); + lockp = R_ADDR(<->reginfo, lock->off); if (lock->gen != lockp->gen) { __db_err(dbenv, __db_lock_invalid, "lock_downgrade"); ret = EINVAL; @@ -1298,8 +1296,7 @@ __lock_is_parent(lt, locker, sh_locker) parent = sh_locker; while (parent->parent_locker != INVALID_ROFF) { - parent = (DB_LOCKER *) - R_ADDR(lt->dbenv, <->reginfo, parent->parent_locker); + parent = R_ADDR(<->reginfo, parent->parent_locker); if (parent->id == locker) return (1); } @@ -1394,8 +1391,7 @@ __lock_inherit_locks(lt, locker, flags) ret = EINVAL; goto err; } - sh_parent = (DB_LOCKER *) - R_ADDR(dbenv, <->reginfo, sh_locker->parent_locker); + sh_parent = R_ADDR(<->reginfo, sh_locker->parent_locker); F_SET(sh_locker, DB_LOCKER_DELETED); /* @@ -1618,8 +1614,7 @@ __lock_trade(dbenv, lock, new_locker) lt = dbenv->lk_handle; region = lt->reginfo.primary; - - lp = (struct __db_lock *)R_ADDR(dbenv, <->reginfo, lock->off); + lp = R_ADDR(<->reginfo, lock->off); /* If the lock is already released, simply return. */ if (lp->gen != lock->gen) diff --git a/db/lock/lock_deadlock.c b/db/lock/lock_deadlock.c index 61f4f5a35..8caf82100 100644 --- a/db/lock/lock_deadlock.c +++ b/db/lock/lock_deadlock.c @@ -4,7 +4,7 @@ * Copyright (c) 1996-2004 * Sleepycat Software. All rights reserved. * - * $Id: lock_deadlock.c,v 11.85 2004/09/22 03:48:29 bostic Exp $ + * $Id: lock_deadlock.c,v 11.86 2004/10/15 16:59:42 bostic Exp $ */ #include "db_config.h" @@ -512,7 +512,7 @@ obj_loop: continue; if (lockerp->dd_id == DD_INVALID_ID) { - dd = ((DB_LOCKER *)R_ADDR(dbenv, <->reginfo, + dd = ((DB_LOCKER *)R_ADDR(<->reginfo, lockerp->master_locker))->dd_id; lockerp->dd_id = dd; switch (atype) { @@ -571,7 +571,7 @@ look_waiters: continue; if (lockerp->dd_id == DD_INVALID_ID) { - dd = ((DB_LOCKER *)R_ADDR(dbenv, <->reginfo, + dd = ((DB_LOCKER *)R_ADDR(<->reginfo, lockerp->master_locker))->dd_id; lockerp->dd_id = dd; switch (atype) { @@ -654,8 +654,7 @@ look_waiters: lp = SH_LIST_FIRST(&lockerp->heldby, __db_lock); if (lp != NULL) { id_array[id].last_locker_id = lockerp->id; -get_lock: id_array[id].last_lock = R_OFFSET(dbenv, - <->reginfo, lp); +get_lock: id_array[id].last_lock = R_OFFSET(<->reginfo, lp); id_array[id].last_obj = lp->obj; lo = (DB_LOCKOBJ *)((u_int8_t *)lp + lp->obj); pptr = SH_DBT_PTR(&lo->lockobj); @@ -790,7 +789,7 @@ __dd_abort(dbenv, info) ret = DB_ALREADY_ABORTED; goto out; } - if (R_OFFSET(dbenv, <->reginfo, lockp) != info->last_lock || + if (R_OFFSET(<->reginfo, lockp) != info->last_lock || lockp->holder != lockerp->id || lockp->obj != info->last_obj || lockp->status != DB_LSTAT_WAITING) { ret = DB_ALREADY_ABORTED; diff --git a/db/lock/lock_id.c b/db/lock/lock_id.c index 0efd001b0..02f85765d 100644 --- a/db/lock/lock_id.c +++ b/db/lock/lock_id.c @@ -4,7 +4,7 @@ * Copyright (c) 1996-2004 * Sleepycat Software. All rights reserved. * - * $Id: lock_id.c,v 11.145 2004/09/15 21:49:17 mjc Exp $ + * $Id: lock_id.c,v 11.146 2004/10/15 16:59:42 bostic Exp $ */ #include "db_config.h" @@ -312,15 +312,14 @@ __lock_addfamilylocker(dbenv, pid, id) goto err; /* Point to our parent. */ - lockerp->parent_locker = R_OFFSET(dbenv, <->reginfo, mlockerp); + lockerp->parent_locker = R_OFFSET(<->reginfo, mlockerp); /* See if this locker is the family master. */ if (mlockerp->master_locker == INVALID_ROFF) - lockerp->master_locker = - R_OFFSET(dbenv, <->reginfo, mlockerp); + lockerp->master_locker = R_OFFSET(<->reginfo, mlockerp); else { lockerp->master_locker = mlockerp->master_locker; - mlockerp = R_ADDR(dbenv, <->reginfo, mlockerp->master_locker); + mlockerp = R_ADDR(<->reginfo, mlockerp->master_locker); } /* diff --git a/db/lock/lock_region.c b/db/lock/lock_region.c index ff4bf2270..b03dc74f1 100644 --- a/db/lock/lock_region.c +++ b/db/lock/lock_region.c @@ -4,7 +4,7 @@ * Copyright (c) 1996-2004 * Sleepycat Software. All rights reserved. * - * $Id: lock_region.c,v 11.81 2004/09/15 21:49:17 mjc Exp $ + * $Id: lock_region.c,v 11.82 2004/10/15 16:59:42 bostic Exp $ */ #include "db_config.h" @@ -98,7 +98,7 @@ __lock_open(dbenv) /* Set the local addresses. */ region = lt->reginfo.primary = - R_ADDR(dbenv, <->reginfo, lt->reginfo.rp->primary); + R_ADDR(<->reginfo, lt->reginfo.rp->primary); if (dbenv->lk_detect != DB_LOCK_NORUN) { /* @@ -132,12 +132,9 @@ __lock_open(dbenv) region->tx_timeout = dbenv->tx_timeout; /* Set remaining pointers into region. */ - lt->conflicts = - (u_int8_t *)R_ADDR(dbenv, <->reginfo, region->conf_off); - lt->obj_tab = - (DB_HASHTAB *)R_ADDR(dbenv, <->reginfo, region->obj_off); - lt->locker_tab = - (DB_HASHTAB *)R_ADDR(dbenv, <->reginfo, region->locker_off); + lt->conflicts = R_ADDR(<->reginfo, region->conf_off); + lt->obj_tab = R_ADDR(<->reginfo, region->obj_off); + lt->locker_tab = R_ADDR(<->reginfo, region->locker_off); R_UNLOCK(dbenv, <->reginfo); @@ -178,8 +175,7 @@ __lock_region_init(dbenv, lt) if ((ret = __db_shalloc(<->reginfo, sizeof(DB_LOCKREGION), 0, <->reginfo.primary)) != 0) goto mem_err; - lt->reginfo.rp->primary = - R_OFFSET(dbenv, <->reginfo, lt->reginfo.primary); + lt->reginfo.rp->primary = R_OFFSET(<->reginfo, lt->reginfo.primary); region = lt->reginfo.primary; memset(region, 0, sizeof(*region)); @@ -217,21 +213,21 @@ __lock_region_init(dbenv, lt) <->reginfo, (size_t)(lk_modes * lk_modes), 0, &addr)) != 0) goto mem_err; memcpy(addr, lk_conflicts, (size_t)(lk_modes * lk_modes)); - region->conf_off = R_OFFSET(dbenv, <->reginfo, addr); + region->conf_off = R_OFFSET(<->reginfo, addr); /* Allocate room for the object hash table and initialize it. */ if ((ret = __db_shalloc(<->reginfo, region->object_t_size * sizeof(DB_HASHTAB), 0, &addr)) != 0) goto mem_err; __db_hashinit(addr, region->object_t_size); - region->obj_off = R_OFFSET(dbenv, <->reginfo, addr); + region->obj_off = R_OFFSET(<->reginfo, addr); /* Allocate room for the locker hash table and initialize it. */ if ((ret = __db_shalloc(<->reginfo, region->locker_t_size * sizeof(DB_HASHTAB), 0, &addr)) != 0) goto mem_err; __db_hashinit(addr, region->locker_t_size); - region->locker_off = R_OFFSET(dbenv, <->reginfo, addr); + region->locker_off = R_OFFSET(<->reginfo, addr); #ifdef HAVE_MUTEX_SYSTEM_RESOURCES maint_size = __lock_region_maint(dbenv); @@ -240,7 +236,7 @@ __lock_region_init(dbenv, lt) sizeof(REGMAINT) + maint_size, 0, &addr)) != 0) goto mem_err; __db_maintinit(<->reginfo, addr, maint_size); - region->maint_off = R_OFFSET(dbenv, <->reginfo, addr); + region->maint_off = R_OFFSET(<->reginfo, addr); #endif /* @@ -320,16 +316,14 @@ __lock_dbenv_refresh(dbenv) */ if (F_ISSET(dbenv, DB_ENV_PRIVATE)) { /* Discard the conflict matrix. */ - __db_shalloc_free(reginfo, - R_ADDR(dbenv, <->reginfo, lr->conf_off)); + __db_shalloc_free(reginfo, R_ADDR(<->reginfo, lr->conf_off)); /* Discard the object hash table. */ - __db_shalloc_free(reginfo, - R_ADDR(dbenv, <->reginfo, lr->obj_off)); + __db_shalloc_free(reginfo, R_ADDR(<->reginfo, lr->obj_off)); /* Discard the locker hash table. */ __db_shalloc_free( - reginfo, R_ADDR(dbenv, <->reginfo, lr->locker_off)); + reginfo, R_ADDR(<->reginfo, lr->locker_off)); /* Discard locks. */ while ((lp = @@ -448,11 +442,11 @@ __lock_region_destroy(dbenv, infop) #ifdef HAVE_MUTEX_SYSTEM_RESOURCES DB_LOCKREGION *lt; - lt = R_ADDR(dbenv, infop, infop->rp->primary); + lt = R_ADDR(infop, infop->rp->primary); - __db_shlocks_destroy(infop, R_ADDR(dbenv, infop, lt->maint_off)); + __db_shlocks_destroy(infop, R_ADDR(infop, lt->maint_off)); if (infop->primary != NULL && F_ISSET(dbenv, DB_ENV_PRIVATE)) - __db_shalloc_free(infop, R_ADDR(dbenv, infop, lt->maint_off)); + __db_shalloc_free(infop, R_ADDR(infop, lt->maint_off)); #endif if (infop->primary != NULL && F_ISSET(dbenv, DB_ENV_PRIVATE)) __db_shalloc_free(infop, infop->primary); diff --git a/db/lock/lock_stat.c b/db/lock/lock_stat.c index d49235dac..7cf56bb90 100644 --- a/db/lock/lock_stat.c +++ b/db/lock/lock_stat.c @@ -4,7 +4,7 @@ * Copyright (c) 1996-2004 * Sleepycat Software. All rights reserved. * - * $Id: lock_stat.c,v 11.63 2004/09/22 03:48:29 bostic Exp $ + * $Id: lock_stat.c,v 11.64 2004/10/15 16:59:42 bostic Exp $ */ #include "db_config.h" @@ -528,7 +528,7 @@ __lock_printlock(lt, mbp, lp, ispgno) (u_long)pgno); } else { __db_msgadd(dbenv, mbp, "0x%lx ", - (u_long)R_OFFSET(dbenv, <->reginfo, lockobj)); + (u_long)R_OFFSET(<->reginfo, lockobj)); __db_pr(dbenv, mbp, ptr, lockobj->lockobj.size); } DB_MSGBUF_FLUSH(dbenv, mbp); -- cgit v1.2.3