Lines Matching refs:mgr

298 	DB_TXNMGR *mgr;
310 mgr = txn->mgrp;
311 if (mgr->dbenv->lg_info != NULL && (ret =
312 log_put(mgr->dbenv->lg_info, &begin_lsn, NULL, DB_CURLSN)) != 0)
315 LOCK_TXNREGION(mgr);
318 if (mgr->region->last_txnid == TXN_INVALID) {
319 __db_err(mgr->dbenv, "txn_begin: %s %s",
326 if ((ret = __txn_validate_region(mgr)) != 0)
330 if ((ret = __db_shalloc(mgr->mem, sizeof(TXN_DETAIL), 0, &td)) != 0
331 && ret == ENOMEM && (ret = __txn_grow_region(mgr)) == 0)
332 ret = __db_shalloc(mgr->mem, sizeof(TXN_DETAIL), 0, &td);
337 SH_TAILQ_INSERT_HEAD(&mgr->region->active_txn, td, links, __txn_detail);
339 id = ++mgr->region->last_txnid;
340 ++mgr->region->nbegins;
352 off = (u_int8_t *)td - (u_int8_t *)mgr->region;
353 UNLOCK_TXNREGION(mgr);
360 LOCK_TXNTHREAD(mgr);
361 TAILQ_INSERT_TAIL(&mgr->txn_chain, txn, links);
362 UNLOCK_TXNTHREAD(mgr);
367 err1: UNLOCK_TXNREGION(mgr);
380 DB_TXNMGR *mgr;
383 mgr = txnp->mgrp;
385 TXN_PANIC_CHECK(mgr);
396 if ((logp = mgr->dbenv->lg_info) != NULL &&
400 F_ISSET(mgr, DB_TXN_NOSYNC) ? 0 : DB_FLUSH,
610 DB_TXNMGR *mgr;
615 mgr = txnp->mgrp;
622 if (mgr->dbenv->lk_info) {
624 lock_tvec(mgr->dbenv->lk_info, txnp, 0, &request, 1, NULL);
626 __db_err(mgr->dbenv, "%s: release locks failed %s",
634 LOCK_TXNREGION(mgr);
641 tp = (TXN_DETAIL *)((u_int8_t *)mgr->region + txnp->off);
643 SH_TAILQ_REMOVE(&mgr->region->active_txn,
646 __db_shalloc_free(mgr->mem, tp);
651 mgr->region->ncommits++;
653 mgr->region->naborts++;
655 UNLOCK_TXNREGION(mgr);
667 LOCK_TXNTHREAD(mgr);
668 TAILQ_REMOVE(&mgr->txn_chain, txnp, links);
669 UNLOCK_TXNTHREAD(mgr);
690 DB_TXNMGR *mgr;
693 mgr = txnp->mgrp;
694 logp = mgr->dbenv->lg_info;
715 mgr->recover(logp, &rdbt, &key_lsn, TXN_UNDO, NULL);
739 txn_checkpoint(mgr, kbytes, minutes)
740 const DB_TXNMGR *mgr;
750 TXN_PANIC_CHECK(mgr);
759 LOCK_TXNREGION(mgr);
760 last_ckp_time = mgr->region->time_ckp;
761 UNLOCK_TXNREGION(mgr);
768 dblp = mgr->dbenv->lg_info;
788 dblp = mgr->dbenv->lg_info;
798 LOCK_TXNREGION(mgr);
800 if (!IS_ZERO_LSN(mgr->region->pending_ckp))
801 ckp_lsn = mgr->region->pending_ckp;
804 SH_TAILQ_FIRST(&mgr->region->active_txn, __txn_detail);
817 mgr->region->pending_ckp = ckp_lsn;
818 UNLOCK_TXNREGION(mgr);
825 if (mgr->dbenv->mp_info != NULL &&
826 (ret = memp_sync(mgr->dbenv->mp_info, &sync_lsn)) != 0) {
832 __db_err(mgr->dbenv,
837 if (mgr->dbenv->lg_info != NULL) {
838 LOCK_TXNREGION(mgr);
839 last_ckp = mgr->region->last_ckp;
840 ZERO_LSN(mgr->region->pending_ckp);
841 UNLOCK_TXNREGION(mgr);
843 if ((ret = __txn_ckp_log(mgr->dbenv->lg_info,
845 __db_err(mgr->dbenv,
852 LOCK_TXNREGION(mgr);
853 mgr->region->last_ckp = ckp_lsn;
854 (void)time(&mgr->region->time_ckp);
855 UNLOCK_TXNREGION(mgr);
920 txn_stat(mgr, statp, db_malloc)
921 DB_TXNMGR *mgr;
931 TXN_PANIC_CHECK(mgr);
933 LOCK_TXNREGION(mgr);
934 nactive = mgr->region->nbegins -
935 mgr->region->naborts - mgr->region->ncommits;
936 UNLOCK_TXNREGION(mgr);
946 LOCK_TXNREGION(mgr);
947 stats->st_last_txnid = mgr->region->last_txnid;
948 stats->st_last_ckp = mgr->region->last_ckp;
949 stats->st_maxtxns = mgr->region->maxtxns;
950 stats->st_naborts = mgr->region->naborts;
951 stats->st_nbegins = mgr->region->nbegins;
952 stats->st_ncommits = mgr->region->ncommits;
953 stats->st_pending_ckp = mgr->region->pending_ckp;
954 stats->st_time_ckp = mgr->region->time_ckp;
962 for (txnp = SH_TAILQ_FIRST(&mgr->region->active_txn, __txn_detail);
973 stats->st_region_wait = mgr->region->hdr.lock.mutex_set_wait;
974 stats->st_region_nowait = mgr->region->hdr.lock.mutex_set_nowait;
975 stats->st_refcnt = mgr->region->hdr.refcnt;
976 stats->st_regsize = mgr->region->hdr.size;
978 UNLOCK_TXNREGION(mgr);
987 DB_TXNMGR *mgr;
991 mgr = txnp->mgrp;
1000 LOCK_TXNREGION(mgr);
1001 tp = (TXN_DETAIL *)((u_int8_t *)mgr->region + kids->off);
1002 SH_TAILQ_REMOVE(&mgr->region->active_txn,
1005 __db_shalloc_free(mgr->mem, tp);
1006 UNLOCK_TXNREGION(mgr);
1011 LOCK_TXNTHREAD(mgr);
1012 TAILQ_REMOVE(&mgr->txn_chain, kids, links);
1013 UNLOCK_TXNTHREAD(mgr);
1029 __txn_is_ancestor(mgr, hold_off, req_off)
1030 DB_TXNMGR *mgr;
1035 hold_tp = (TXN_DETAIL *)((u_int8_t *)mgr->region + hold_off);
1036 req_tp = (TXN_DETAIL *)((u_int8_t *)mgr->region + req_off);
1040 (TXN_DETAIL *)((u_int8_t *)mgr->region + req_tp->parent);