summaryrefslogtreecommitdiff
path: root/lib/tdb2/tdb1_private.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-09-14 07:37:13 +0930
committerRusty Russell <rusty@rustcorp.com.au>2011-09-14 07:37:13 +0930
commitc5b7c4aea8a1d2be1d61c3b909177cb5ef07fd62 (patch)
treedb52ef46f4f127ffba98916a42b73eff780450af /lib/tdb2/tdb1_private.h
parent5a3f207318bee2fc2236ac1e19eda8ac2ae80829 (diff)
downloadsamba-c5b7c4aea8a1d2be1d61c3b909177cb5ef07fd62.tar.gz
samba-c5b7c4aea8a1d2be1d61c3b909177cb5ef07fd62.tar.bz2
samba-c5b7c4aea8a1d2be1d61c3b909177cb5ef07fd62.zip
tdb2: Make tdb1 use the tdb_file structure.
Because tdb2 allows multiple opens of the same TDB, we separate out the file information from the struct tdb_context. Do the same for tdb1. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 60210a73ec08a7b34ba637ad19e6749cf6dc1952)
Diffstat (limited to 'lib/tdb2/tdb1_private.h')
-rw-r--r--lib/tdb2/tdb1_private.h17
1 files changed, 3 insertions, 14 deletions
diff --git a/lib/tdb2/tdb1_private.h b/lib/tdb2/tdb1_private.h
index 0d40d7a919..5470955a54 100644
--- a/lib/tdb2/tdb1_private.h
+++ b/lib/tdb2/tdb1_private.h
@@ -135,12 +135,6 @@ struct tdb1_header {
tdb1_off_t reserved[27];
};
-struct tdb1_lock_type {
- uint32_t off;
- uint32_t count;
- uint32_t ltype;
-};
-
struct tdb1_traverse_lock {
struct tdb1_traverse_lock *next;
uint32_t off;
@@ -174,20 +168,15 @@ struct tdb1_context {
/* Last error we returned. */
enum TDB_ERROR last_error; /* error code for last tdb error */
- void *map_ptr; /* where it is currently mapped */
- int fd; /* open file descriptor for the database */
- tdb1_len_t map_size; /* how much space has been mapped */
+ /* The actual file information */
+ struct tdb_file *file;
+
int read_only; /* opened read-only */
int traverse_read; /* read-only traversal */
int traverse_write; /* read-write traversal */
- struct tdb1_lock_type allrecord_lock; /* .offset == upgradable */
- int num_lockrecs;
- struct tdb1_lock_type *lockrecs; /* only real locks, all with count>0 */
struct tdb1_header header; /* a cached copy of the header */
uint32_t flags; /* the flags passed to tdb1_open */
struct tdb1_traverse_lock travlocks; /* current traversal locks */
- dev_t device; /* uniquely identifies this tdb */
- ino_t inode; /* uniquely identifies this tdb */
unsigned int (*hash_fn)(TDB_DATA *key);
int open_flags; /* flags used in the open - needed by reopen */
const struct tdb1_methods *methods;