~ubuntu-branches/ubuntu/saucy/db/saucy-proposed

« back to all changes in this revision

Viewing changes to btree/bt_open.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2010-10-25 22:16:35 UTC
  • mfrom: (13.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20101025221635-k0o38lxdx9kle3mh
Tags: 5.0.26-3ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Pass --build/--host to configure to support cross-building, and don't
    override CC.
  - Disable the Java build when cross-building, for now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*-
2
2
 * See the file LICENSE for redistribution information.
3
3
 *
4
 
 * Copyright (c) 1996-2009 Oracle.  All rights reserved.
 
4
 * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
5
5
 */
6
6
/*
7
7
 * Copyright (c) 1990, 1993, 1994, 1995, 1996
49
49
#include "dbinc/db_swap.h"
50
50
#include "dbinc/btree.h"
51
51
#include "dbinc/lock.h"
52
 
#include "dbinc/log.h"
53
52
#include "dbinc/mp.h"
54
53
#include "dbinc/partition.h"
55
54
#include "dbinc/fop.h"
340
339
 
341
340
                t->bt_meta = base_pgno;
342
341
                t->bt_root = meta->root;
343
 
#ifndef HAVE_FTRUNCATE
344
 
                if (PGNO(meta) == PGNO_BASE_MD &&
345
 
                    !F_ISSET(dbp, DB_AM_RECOVER) && !IS_VERSION(dbp, meta))
 
342
                if (PGNO(meta) == PGNO_BASE_MD && !F_ISSET(dbp, DB_AM_RECOVER))
346
343
                        __memp_set_last_pgno(mpf, meta->dbmeta.last_pgno);
347
 
#endif
348
344
        } else {
349
345
                DB_ASSERT(dbp->env,
350
346
                    IS_RECOVERING(dbp->env) || F_ISSET(dbp, DB_AM_RECOVER));
487
483
        if (F_ISSET(dbp, DB_AM_INMEM)) {
488
484
                /* Build the meta-data page. */
489
485
                pgno = PGNO_BASE_MD;
490
 
                if ((ret = __memp_fget(mpf, &pgno, ip, txn,
491
 
                    DB_MPOOL_CREATE | DB_MPOOL_DIRTY, &meta)) != 0)
 
486
                if ((ret = __memp_fget(mpf, &pgno,
 
487
                    ip, txn, DB_MPOOL_CREATE | DB_MPOOL_DIRTY, &meta)) != 0)
492
488
                        return (ret);
493
489
                LSN_NOT_LOGGED(lsn);
494
490
                __bam_init_meta(dbp, meta, PGNO_BASE_MD, &lsn);
505
501
                /* Build the root page. */
506
502
                pgno = 1;
507
503
                if ((ret = __memp_fget(mpf, &pgno,
508
 
                    ip, txn, DB_MPOOL_CREATE, &root)) != 0)
 
504
                    ip, txn, DB_MPOOL_CREATE | DB_MPOOL_DIRTY, &root)) != 0)
509
505
                        goto err;
510
506
                P_INIT(root, dbp->pgsize, 1, PGNO_INVALID, PGNO_INVALID,
511
507
                    LEAFLEVEL, dbp->type == DB_RECNO ? P_LRECNO : P_LBTREE);
614
610
            0, dbp->meta_pgno, DB_LOCK_WRITE, 0, &metalock)) != 0)
615
611
                goto err;
616
612
        if ((ret = __memp_fget(mpf, &dbp->meta_pgno,
617
 
            ip, txn, DB_MPOOL_CREATE, &meta)) != 0)
 
613
            ip, txn, DB_MPOOL_CREATE | DB_MPOOL_DIRTY, &meta)) != 0)
618
614
                goto err;
619
615
 
620
616
        /* Build meta-data page. */