• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/BerkeleyDB-21/db/hash/

Lines Matching defs:meta

85 	 * In STD_LOCKING mode, we'll synchronize using the meta page
118 "%s: Invalid hash meta page %lu", name, (u_long)base_pgno);
122 /* Release the meta data page */
236 * Initialize a hash meta-data page. We assume that the meta-data page is
242 __ham_init_meta(dbp, meta, pgno, lsnp)
244 HMETA *meta;
266 memset(meta, 0, sizeof(HMETA));
267 meta->dbmeta.lsn = *lsnp;
268 meta->dbmeta.pgno = pgno;
269 meta->dbmeta.magic = DB_HASHMAGIC;
270 meta->dbmeta.version = DB_HASHVERSION;
271 meta->dbmeta.pagesize = dbp->pgsize;
273 FLD_SET(meta->dbmeta.metaflags, DBMETA_CHKSUM);
275 meta->dbmeta.encrypt_alg = env->crypto_handle->alg;
276 DB_ASSERT(env, meta->dbmeta.encrypt_alg != 0);
277 meta->crypto_magic = meta->dbmeta.magic;
279 meta->dbmeta.type = P_HASHMETA;
280 meta->dbmeta.free = PGNO_INVALID;
281 meta->dbmeta.last_pgno = pgno;
282 meta->max_bucket = nbuckets - 1;
283 meta->high_mask = nbuckets - 1;
284 meta->low_mask = (nbuckets >> 1) - 1;
285 meta->ffactor = hashp->h_ffactor;
286 meta->nelem = hashp->h_nelem;
287 meta->h_charkey = hashp->h_hash(dbp, CHARKEY, sizeof(CHARKEY));
288 memcpy(meta->dbmeta.uid, dbp->fileid, DB_FILE_ID_LEN);
291 F_SET(&meta->dbmeta, DB_HASH_DUP);
293 F_SET(&meta->dbmeta, DB_HASH_SUBDB);
295 F_SET(&meta->dbmeta, DB_HASH_DUPSORT);
300 * meta-data header (spares[0]).
302 meta->spares[0] = pgno + 1;
304 /* Fill in the last fields of the meta data page. */
306 meta->spares[i] = meta->spares[0];
308 meta->spares[i] = PGNO_INVALID;
343 HMETA *meta;
351 meta = NULL;
356 /* Build meta-data page. */
359 DB_MPOOL_CREATE | DB_MPOOL_DIRTY, &meta)) != 0)
362 lpgno = __ham_init_meta(dbp, meta, PGNO_BASE_MD, &lsn);
363 meta->dbmeta.last_pgno = lpgno;
365 txn, &lsn, meta->dbmeta.pgno, (PAGE *)meta)) != 0)
367 ret = __memp_fput(mpf, ip, meta, dbp->priority);
368 meta = NULL;
389 /* Build meta-data page. */
398 meta = (HMETA *)buf;
400 lpgno = __ham_init_meta(dbp, meta, PGNO_BASE_MD, &lsn);
401 meta->dbmeta.last_pgno = lpgno;
403 __db_pgout(env->dbenv, PGNO_BASE_MD, meta, &pdbt)) != 0)
409 meta = NULL;
431 if (meta != NULL)
432 (void)__memp_fput(mpf, ip, meta, dbp->priority);
457 HMETA *meta;
465 meta = NULL;
474 /* Get and lock the new meta data page. */
479 DB_MPOOL_CREATE, &meta)) != 0)
482 /* Initialize the new meta-data page. */
483 lsn = meta->dbmeta.lsn;
484 lpgno = __ham_init_meta(dbp, meta, dbp->meta_pgno, &lsn);
488 * worth). We need to get the master meta-data page to figure
490 * get the master meta data page.
500 * Now update the hash meta-data page to reflect where the first
503 meta->spares[0] = mmeta->last_pgno + 1;
504 for (i = 0; i < NCACHED && meta->spares[i] != PGNO_INVALID; i++)
505 meta->spares[i] = meta->spares[0];
507 /* The new meta data page is now complete; log it. */
509 txn, &meta->dbmeta.lsn, dbp->meta_pgno, (PAGE *)meta)) != 0)
519 &LSN(mmeta), 0, &LSN(mmeta), meta->spares[0],
520 meta->max_bucket + 1, 0, mmeta->last_pgno)) != 0)
523 /* Release the new meta-data page. */
524 if ((ret = __memp_fput(mpf, ip, meta, dbc->priority)) != 0)
526 meta = NULL;
547 if (meta != NULL && (t_ret = __memp_fput(mpf,
548 ip, meta, dbc->priority)) != 0 && ret == 0)