diff options
author | Andrew Tridgell <tridge@samba.org> | 2006-10-18 21:41:59 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:21:26 -0500 |
commit | cba142f1ae71b03266210e254c251683846d7fd7 (patch) | |
tree | a08bfecb74e2954700df90beca5ee9bb73117a87 /source4/lib/tdb/common/tdb_private.h | |
parent | 403f0c92a734a9bf7709a0af0a0aa9cc89bf3144 (diff) | |
download | samba-cba142f1ae71b03266210e254c251683846d7fd7.tar.gz samba-cba142f1ae71b03266210e254c251683846d7fd7.tar.bz2 samba-cba142f1ae71b03266210e254c251683846d7fd7.zip |
r19401: make tdb_lockall() much more efficient, and add a tdb_lockall_read()
call which does a read lock on all chains. These will be used to make
ldb searches more efficient
(This used to be commit de664ec1f8cf179f1d650563272c0de3f7636e2b)
Diffstat (limited to 'source4/lib/tdb/common/tdb_private.h')
-rw-r--r-- | source4/lib/tdb/common/tdb_private.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source4/lib/tdb/common/tdb_private.h b/source4/lib/tdb/common/tdb_private.h index 71bb53adbe..a3495e42aa 100644 --- a/source4/lib/tdb/common/tdb_private.h +++ b/source4/lib/tdb/common/tdb_private.h @@ -141,7 +141,7 @@ struct tdb_methods { void (*next_hash_chain)(struct tdb_context *, u32 *); int (*tdb_oob)(struct tdb_context *, tdb_off_t , int ); int (*tdb_expand_file)(struct tdb_context *, tdb_off_t , tdb_off_t ); - int (*tdb_brlock)(struct tdb_context *, tdb_off_t , int, int, int); + int (*tdb_brlock)(struct tdb_context *, tdb_off_t , int, int, int, size_t); }; struct tdb_context { @@ -151,6 +151,7 @@ struct tdb_context { tdb_len_t map_size; /* how much space has been mapped */ int read_only; /* opened read-only */ int traverse_read; /* read-only traversal */ + struct tdb_lock_type global_lock; struct tdb_lock_type *locked; /* array of chain locks */ enum TDB_ERROR ecode; /* error code for last tdb error */ struct tdb_header header; /* a cached copy of the header */ @@ -176,10 +177,8 @@ int tdb_munmap(struct tdb_context *tdb); void tdb_mmap(struct tdb_context *tdb); int tdb_lock(struct tdb_context *tdb, int list, int ltype); int tdb_unlock(struct tdb_context *tdb, int list, int ltype); -int tdb_brlock(struct tdb_context *tdb, tdb_off_t offset, int rw_type, int lck_type, int probe); +int tdb_brlock(struct tdb_context *tdb, tdb_off_t offset, int rw_type, int lck_type, int probe, size_t len); int tdb_brlock_upgrade(struct tdb_context *tdb, tdb_off_t offset, size_t len); -int tdb_brlock_len(struct tdb_context *tdb, tdb_off_t offset, - int rw_type, int lck_type, int probe, size_t len); int tdb_write_lock_record(struct tdb_context *tdb, tdb_off_t off); int tdb_write_unlock_record(struct tdb_context *tdb, tdb_off_t off); int tdb_ofs_read(struct tdb_context *tdb, tdb_off_t offset, tdb_off_t *d); |