Lines Matching refs:dbp
94 __ham_open(dbp, dbinfo) in __ham_open() argument
95 DB *dbp; in __ham_open()
104 dbenv = dbp->dbenv;
108 dbp->h_hash = dbinfo->h_hash;
114 dbp->internal = NULL;
115 dbp->am_close = __ham_close;
116 dbp->del = __ham_delete;
117 dbp->stat = __ham_stat;
120 if ((ret = dbp->cursor(dbp, NULL, &dbc, 0)) != 0)
124 GET_META(dbp, hcp, ret);
136 if (dbp->h_hash == NULL)
137 dbp->h_hash =
139 if (dbp->h_hash(CHARKEY, sizeof(CHARKEY)) !=
141 __db_err(dbp->dbenv, "hash: incompatible hash function");
146 F_SET(dbp, DB_AM_DUP);
153 if (F_ISSET(dbp, DB_AM_LOCKING) &&
164 if (F_ISSET(dbp, DB_AM_DUP))
166 if ((ret = __ham_dirty_page(dbp, (PAGE *)hcp->hdr)) != 0)
171 RELEASE_META(dbp, hcp);
176 if (!file_existed && (ret = dbp->sync(dbp, 0)) != 0)
180 out: (void)__ham_close(dbp);
188 __ham_close(dbp) in __ham_close() argument
189 DB *dbp; in __ham_close()
191 COMPQUIET(dbp, NULL);
204 DB *dbp; local
209 dbp = dbc->dbp;
212 hcp->hdr->pagesize = dbp->pgsize;
217 if (dbp->h_hash == NULL)
218 dbp->h_hash = hcp->hdr->version < 5 ? __ham_func4 : __ham_func5;
219 hcp->hdr->h_charkey = dbp->h_hash(CHARKEY, sizeof(CHARKEY));
233 memcpy(hcp->hdr->uid, dbp->fileid, DB_FILE_ID_LEN);
237 __ham_delete(dbp, txn, key, flags) in __ham_delete() argument
238 DB *dbp; in __ham_delete()
247 DB_PANIC_CHECK(dbp);
250 __db_delchk(dbp, key, flags, F_ISSET(dbp, DB_AM_RDONLY))) != 0)
253 if ((ret = dbp->cursor(dbp, txn, &dbc, DB_WRITELOCK)) != 0)
259 GET_META(dbp, hcp, ret);
270 RELEASE_META(dbp, hcp);
293 __os_malloc(dbc->dbp->pgsize, NULL, &new_curs->split_buf)) != 0) {
341 __os_free(hcp->split_buf, dbc->dbp->pgsize);
352 DB *dbp; local
360 dbp = dbc->dbp;
361 DB_PANIC_CHECK(dbp);
364 if ((ret = __db_cdelchk(dbc->dbp, flags,
365 F_ISSET(dbc->dbp, DB_AM_RDONLY), IS_VALID(hcp))) != 0)
377 if (F_ISSET(dbp, DB_AM_CDB)) {
383 (ret = lock_get(dbp->dbenv->lk_info, dbc->locker,
389 GET_META(dbp, hcp, ret);
465 ret = __ham_put_page(dbp, hcp->pagep, 1);
497 RELEASE_META(dbp, hcp);
498 RESTORE_CURSOR(dbp, hcp, &save_curs, ret);
499 if (F_ISSET(dbp, DB_AM_CDB) && F_ISSET(dbc, DBC_RMW))
500 (void)__lock_downgrade(dbp->dbenv->lk_info, dbc->mylock,
512 DB *dbp; local
522 dbp = dbc->dbp;
523 DB_PANIC_CHECK(dbp);
526 __db_cgetchk(dbp, key, data, flags, IS_VALID(hcp))) != 0)
536 GET_META(dbp, hcp, ret);
601 if (get_key && (ret = __db_ret(dbp, hcp->pagep,
654 out: RELEASE_META(dbp, hcp);
655 RESTORE_CURSOR(dbp, hcp, &save_curs, ret);
666 DB *dbp; local
672 dbp = dbc->dbp;
673 DB_PANIC_CHECK(dbp);
679 if ((ret = __db_cputchk(dbp, key, data, flags,
680 F_ISSET(dbp, DB_AM_RDONLY), IS_VALID(hcp))) != 0)
693 if (F_ISSET(dbp, DB_AM_CDB)) {
699 (ret = lock_get(dbp->dbenv->lk_info, dbc->locker,
705 GET_META(dbp, hcp, ret);
764 !F_ISSET(dbp, DB_AM_DUP)))
778 out: RELEASE_META(dbp, hcp);
779 RESTORE_CURSOR(dbp, hcp, &save_curs, ret);
780 if (F_ISSET(dbp, DB_AM_CDB) && F_ISSET(dbc, DBC_RMW))
781 (void)__lock_downgrade(dbp->dbenv->lk_info, dbc->mylock,
795 DB *dbp; local
801 dbp = dbc->dbp;
804 DIRTY_META(dbp, hcp, ret);
832 if ((ret = __ham_splitmeta_log(dbp->dbenv->lg_info,
833 dbc->txn, &new_lsn, 0, dbp->log_fileid,
864 __db_err(dbp->dbenv,
884 n = (u_int32_t)(hcp->dbc->dbp->h_hash(k, len));
902 DB *dbp; local
914 dbp = dbc->dbp;
999 if ((ret = __db_moff(dbp, val,
1000 pgno, tlen, dbp->dup_compare, &cmp)) != 0)
1009 dbp->pgsize, hcp->bndx);
1010 cmp = dbp->dup_compare == NULL ?
1012 dbp->dup_compare(&tmp_val, val);
1066 if ((ret = __db_ret(dbp, pp, ndx, myval, &dbc->rdata.data,
1090 if (F_ISSET(dbc->dbp, DB_AM_DUP))
1127 DB *dbp; local
1134 dbp = dbc->dbp;
1159 if ((ret = __db_moff(dbp,
1183 return (__db_pgfmt(dbp, PGNO(hcp->pagep)));
1247 DB *dbp; local
1274 dbp = hcp->dbc->dbp;
1275 DB_THREAD_LOCK(dbp);
1277 for (cp = TAILQ_FIRST(&dbp->active_queue); cp != NULL;
1334 DB_THREAD_UNLOCK(dbp);