diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-05-12 02:57:24 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-05-12 02:57:24 +0000 |
commit | afab0b2ca0517267fe102a12821a06469406fbc5 (patch) | |
tree | 62dd526173b67ba9dd4e2c3f06ccb73ca3a5e9f3 | |
parent | 28d8970987265275f53ba1898b0057cf20629c9c (diff) | |
download | samba-afab0b2ca0517267fe102a12821a06469406fbc5.tar.gz samba-afab0b2ca0517267fe102a12821a06469406fbc5.tar.bz2 samba-afab0b2ca0517267fe102a12821a06469406fbc5.zip |
an imcompatible tdb format change (sorry!)
this will give us a much nicer migration path for the proposed
semaphore code
(This used to be commit 491ab241897a7252fb088c718de4bdf7f43f4ddc)
-rw-r--r-- | source3/tdb/tdb.c | 13 | ||||
-rw-r--r-- | source3/tdb/tdb.h | 1 |
2 files changed, 3 insertions, 11 deletions
diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c index bc7c90613c..31d4d0dfcc 100644 --- a/source3/tdb/tdb.c +++ b/source3/tdb/tdb.c @@ -35,7 +35,7 @@ #include "includes.h" #endif -#define TDB_VERSION (0x26011967 + 2) +#define TDB_VERSION (0x26011967 + 3) #define TDB_MAGIC (0x26011999U) #define TDB_FREE_MAGIC (~TDB_MAGIC) #define TDB_ALIGN 4 @@ -43,8 +43,7 @@ #define DEFAULT_HASH_SIZE 131 #define TDB_PAGE_SIZE 0x2000 #define TDB_LEN_MULTIPLIER 10 -#define TDB_RESERVED 1024 -#define FREELIST_TOP (TDB_RESERVED + sizeof(struct tdb_header)) +#define FREELIST_TOP (sizeof(struct tdb_header)) #define LOCK_SET 1 #define LOCK_CLEAR 0 @@ -498,7 +497,6 @@ static int tdb_new_database(TDB_CONTEXT *tdb, int hash_size) tdb_off offset; int i, size = 0; tdb_off buf[16]; - char buf2[TDB_RESERVED]; /* create the header */ memset(&header, 0, sizeof(header)); @@ -516,13 +514,6 @@ static int tdb_new_database(TDB_CONTEXT *tdb, int hash_size) return -1; } else size += sizeof(header); - memset(buf2, 0, sizeof(buf2)); - if (tdb->fd != -1 && write(tdb->fd, buf2, TDB_RESERVED) != - TDB_RESERVED) { - tdb->ecode = TDB_ERR_IO; - return -1; - } else size += TDB_RESERVED; - /* the freelist and hash pointers */ offset = 0; memset(buf, 0, sizeof(buf)); diff --git a/source3/tdb/tdb.h b/source3/tdb/tdb.h index f4039f119c..47254b5013 100644 --- a/source3/tdb/tdb.h +++ b/source3/tdb/tdb.h @@ -29,6 +29,7 @@ struct tdb_header { char magic_food[32]; /* for /etc/magic */ unsigned version; /* version of the code */ unsigned hash_size; /* number of hash entries */ + tdb_off reserved[32]; }; typedef struct { |