Lines Matching refs:tdb_context

215 	int (*tdb_read)(struct tdb_context *, tdb_off_t , void *, tdb_len_t , int );
216 int (*tdb_write)(struct tdb_context *, tdb_off_t, const void *, tdb_len_t);
217 void (*next_hash_chain)(struct tdb_context *, u32 *);
218 int (*tdb_oob)(struct tdb_context *, tdb_off_t , int );
219 int (*tdb_expand_file)(struct tdb_context *, tdb_off_t , tdb_off_t );
220 int (*tdb_brlock)(struct tdb_context *, tdb_off_t , int, int, int, size_t);
223 struct tdb_context { struct
237 struct tdb_context *next; /* all tdbs to avoid multiple opens */ argument
256 static int tdb_munmap(struct tdb_context *tdb); argument
257 static void tdb_mmap(struct tdb_context *tdb);
258 static int tdb_lock(struct tdb_context *tdb, int list, int ltype);
259 static int tdb_unlock(struct tdb_context *tdb, int list, int ltype);
260 static int tdb_brlock(struct tdb_context *tdb, tdb_off_t offset, int rw_type, int lck_type, int pro…
261 static int tdb_transaction_lock(struct tdb_context *tdb, int ltype);
262 static int tdb_transaction_unlock(struct tdb_context *tdb);
263 static int tdb_brlock_upgrade(struct tdb_context *tdb, tdb_off_t offset, size_t len);
264 static int tdb_write_lock_record(struct tdb_context *tdb, tdb_off_t off);
265 static int tdb_write_unlock_record(struct tdb_context *tdb, tdb_off_t off);
266 static int tdb_ofs_read(struct tdb_context *tdb, tdb_off_t offset, tdb_off_t *d);
267 static int tdb_ofs_write(struct tdb_context *tdb, tdb_off_t offset, tdb_off_t *d);
269 static int tdb_free(struct tdb_context *tdb, tdb_off_t offset, struct list_struct *rec);
270 static tdb_off_t tdb_allocate(struct tdb_context *tdb, tdb_len_t length, struct list_struct *rec);
271 static int tdb_ofs_read(struct tdb_context *tdb, tdb_off_t offset, tdb_off_t *d);
272 static int tdb_ofs_write(struct tdb_context *tdb, tdb_off_t offset, tdb_off_t *d);
273 static int tdb_lock_record(struct tdb_context *tdb, tdb_off_t off);
274 static int tdb_unlock_record(struct tdb_context *tdb, tdb_off_t off);
275 static int tdb_rec_read(struct tdb_context *tdb, tdb_off_t offset, struct list_struct *rec);
276 static int tdb_rec_write(struct tdb_context *tdb, tdb_off_t offset, struct list_struct *rec);
277 static int tdb_do_delete(struct tdb_context *tdb, tdb_off_t rec_ptr, struct list_struct *rec);
278 static unsigned char *tdb_alloc_read(struct tdb_context *tdb, tdb_off_t offset, tdb_len_t len);
279 static int tdb_parse_data(struct tdb_context *tdb, TDB_DATA key,
284 static tdb_off_t tdb_find_lock_hash(struct tdb_context *tdb, TDB_DATA key, u32 hash, int locktype,
286 static void tdb_io_init(struct tdb_context *tdb);
287 static int tdb_expand(struct tdb_context *tdb, tdb_off_t size);
288 static int tdb_rec_free_read(struct tdb_context *tdb, tdb_off_t off,
294 enum TDB_ERROR tdb_error(struct tdb_context *tdb) in tdb_error()
313 const char *tdb_errorstr(struct tdb_context *tdb) in tdb_errorstr()
334 int tdb_brlock(struct tdb_context *tdb, tdb_off_t offset, in tdb_brlock()
381 int tdb_brlock_upgrade(struct tdb_context *tdb, tdb_off_t offset, size_t len) in tdb_brlock_upgrade()
403 static int _tdb_lock(struct tdb_context *tdb, int list, int ltype, int op) in _tdb_lock()
476 int tdb_lock(struct tdb_context *tdb, int list, int ltype) in tdb_lock()
488 int tdb_lock_nonblock(struct tdb_context *tdb, int list, int ltype) in tdb_lock_nonblock()
497 int tdb_unlock(struct tdb_context *tdb, int list, int ltype) in tdb_unlock()
584 int tdb_transaction_lock(struct tdb_context *tdb, int ltype) in tdb_transaction_lock()
602 int tdb_transaction_unlock(struct tdb_context *tdb) in tdb_transaction_unlock()
619 static int _tdb_lockall(struct tdb_context *tdb, int ltype, int op) in _tdb_lockall()
662 static int _tdb_unlockall(struct tdb_context *tdb, int ltype) in _tdb_unlockall()
696 int tdb_lockall(struct tdb_context *tdb) in tdb_lockall()
702 int tdb_lockall_mark(struct tdb_context *tdb) in tdb_lockall_mark()
708 int tdb_lockall_unmark(struct tdb_context *tdb) in tdb_lockall_unmark()
714 int tdb_lockall_nonblock(struct tdb_context *tdb) in tdb_lockall_nonblock()
720 int tdb_unlockall(struct tdb_context *tdb) in tdb_unlockall()
726 int tdb_lockall_read(struct tdb_context *tdb) in tdb_lockall_read()
732 int tdb_lockall_read_nonblock(struct tdb_context *tdb) in tdb_lockall_read_nonblock()
738 int tdb_unlockall_read(struct tdb_context *tdb) in tdb_unlockall_read()
745 int tdb_chainlock(struct tdb_context *tdb, TDB_DATA key) in tdb_chainlock()
753 int tdb_chainlock_nonblock(struct tdb_context *tdb, TDB_DATA key) in tdb_chainlock_nonblock()
759 int tdb_chainlock_mark(struct tdb_context *tdb, TDB_DATA key) in tdb_chainlock_mark()
765 int tdb_chainlock_unmark(struct tdb_context *tdb, TDB_DATA key) in tdb_chainlock_unmark()
770 int tdb_chainunlock(struct tdb_context *tdb, TDB_DATA key) in tdb_chainunlock()
775 int tdb_chainlock_read(struct tdb_context *tdb, TDB_DATA key) in tdb_chainlock_read()
780 int tdb_chainunlock_read(struct tdb_context *tdb, TDB_DATA key) in tdb_chainunlock_read()
788 int tdb_lock_record(struct tdb_context *tdb, tdb_off_t off) in tdb_lock_record()
798 int tdb_write_lock_record(struct tdb_context *tdb, tdb_off_t off) in tdb_write_lock_record()
811 int tdb_write_unlock_record(struct tdb_context *tdb, tdb_off_t off) in tdb_write_unlock_record()
817 int tdb_unlock_record(struct tdb_context *tdb, tdb_off_t off) in tdb_unlock_record()
837 static int tdb_oob(struct tdb_context *tdb, tdb_off_t len, int probe) in tdb_oob()
875 static int tdb_write(struct tdb_context *tdb, tdb_off_t off, in tdb_write()
913 static int tdb_read(struct tdb_context *tdb, tdb_off_t off, void *buf, in tdb_read()
946 static void tdb_next_hash_chain(struct tdb_context *tdb, u32 *chain) in tdb_next_hash_chain()
967 int tdb_munmap(struct tdb_context *tdb) in tdb_munmap()
984 void tdb_mmap(struct tdb_context *tdb) in tdb_mmap()
1016 static int tdb_expand_file(struct tdb_context *tdb, tdb_off_t size, tdb_off_t addition) in tdb_expand_file()
1055 int tdb_expand(struct tdb_context *tdb, tdb_off_t size) in tdb_expand()
1125 int tdb_ofs_read(struct tdb_context *tdb, tdb_off_t offset, tdb_off_t *d) in tdb_ofs_read()
1130 int tdb_ofs_write(struct tdb_context *tdb, tdb_off_t offset, tdb_off_t *d) in tdb_ofs_write()
1138 unsigned char *tdb_alloc_read(struct tdb_context *tdb, tdb_off_t offset, tdb_len_t len) in tdb_alloc_read()
1163 int tdb_parse_data(struct tdb_context *tdb, TDB_DATA key, in tdb_parse_data()
1196 int tdb_rec_read(struct tdb_context *tdb, tdb_off_t offset, struct list_struct *rec) in tdb_rec_read()
1209 int tdb_rec_write(struct tdb_context *tdb, tdb_off_t offset, struct list_struct *rec) in tdb_rec_write()
1227 void tdb_io_init(struct tdb_context *tdb) in tdb_io_init()
1340 static int transaction_read(struct tdb_context *tdb, tdb_off_t off, void *buf, in transaction_read()
1401 static int transaction_write(struct tdb_context *tdb, tdb_off_t off, in transaction_write()
1525 static void transaction_next_hash_chain(struct tdb_context *tdb, u32 *chain) in transaction_next_hash_chain()
1540 static int transaction_oob(struct tdb_context *tdb, tdb_off_t len, int probe) in transaction_oob()
1551 static int transaction_expand_file(struct tdb_context *tdb, tdb_off_t size, in transaction_expand_file()
1566 static int transaction_brlock(struct tdb_context *tdb, tdb_off_t offset, in transaction_brlock()
1586 int tdb_transaction_start(struct tdb_context *tdb) in tdb_transaction_start()
1693 int tdb_transaction_cancel(struct tdb_context *tdb) in tdb_transaction_cancel()
1748 static int transaction_sync(struct tdb_context *tdb, tdb_off_t offset, tdb_len_t length) in transaction_sync()
1774 static tdb_len_t tdb_recovery_size(struct tdb_context *tdb) in tdb_recovery_size()
1794 static int tdb_recovery_allocate(struct tdb_context *tdb, in tdb_recovery_allocate()
1875 static int transaction_setup_recovery(struct tdb_context *tdb, in transaction_setup_recovery()
1984 int tdb_transaction_commit(struct tdb_context *tdb) in tdb_transaction_commit()
2137 int tdb_transaction_recover(struct tdb_context *tdb) in tdb_transaction_recover()
2262 static int tdb_rec_free_read(struct tdb_context *tdb, tdb_off_t off, struct list_struct *rec) in tdb_rec_free_read()
2292 static int remove_from_freelist(struct tdb_context *tdb, tdb_off_t off, tdb_off_t next) in remove_from_freelist()
2312 static int update_tailer(struct tdb_context *tdb, tdb_off_t offset, in update_tailer()
2325 int tdb_free(struct tdb_context *tdb, tdb_off_t offset, struct list_struct *rec) in tdb_free()
2427 static tdb_off_t tdb_allocate_ofs(struct tdb_context *tdb, tdb_len_t length, tdb_off_t rec_ptr, in tdb_allocate_ofs()
2488 tdb_off_t tdb_allocate(struct tdb_context *tdb, tdb_len_t length, struct list_struct *rec) in tdb_allocate()
2572 static int seen_insert(struct tdb_context *mem_tdb, tdb_off_t rec_ptr) in seen_insert()
2582 int tdb_validate_freelist(struct tdb_context *tdb, int *pnum_entries) in tdb_validate_freelist()
2584 struct tdb_context *mem_tdb = NULL; in tdb_validate_freelist()
2648 static int tdb_next_lock(struct tdb_context *tdb, struct tdb_traverse_lock *tlock, in tdb_next_lock()
2755 static int tdb_traverse_internal(struct tdb_context *tdb, in tdb_traverse_internal()
2819 int tdb_traverse_read(struct tdb_context *tdb, in tdb_traverse_read()
2844 int tdb_traverse(struct tdb_context *tdb, in tdb_traverse()
2867 TDB_DATA tdb_firstkey(struct tdb_context *tdb) in tdb_firstkey()
2892 TDB_DATA tdb_nextkey(struct tdb_context *tdb, TDB_DATA oldkey) in tdb_nextkey()
2953 static tdb_off_t tdb_dump_record(struct tdb_context *tdb, int hash, in tdb_dump_record()
2984 static int tdb_dump_chain(struct tdb_context *tdb, int i) in tdb_dump_chain()
3006 void tdb_dump_all(struct tdb_context *tdb) in tdb_dump_all()
3016 int tdb_printfreelist(struct tdb_context *tdb) in tdb_printfreelist()
3067 void tdb_increment_seqnum_nonblock(struct tdb_context *tdb) in tdb_increment_seqnum_nonblock()
3087 static void tdb_increment_seqnum(struct tdb_context *tdb) in tdb_increment_seqnum()
3109 static tdb_off_t tdb_find(struct tdb_context *tdb, TDB_DATA key, u32 hash, in tdb_find()
3136 tdb_off_t tdb_find_lock_hash(struct tdb_context *tdb, TDB_DATA key, u32 hash, int locktype, in tdb_find_lock_hash()
3153 static int tdb_update_hash(struct tdb_context *tdb, TDB_DATA key, u32 hash, TDB_DATA dbuf) in tdb_update_hash()
3187 TDB_DATA tdb_fetch(struct tdb_context *tdb, TDB_DATA key) in tdb_fetch()
3222 int tdb_parse_record(struct tdb_context *tdb, TDB_DATA key, in tdb_parse_record()
3253 static int tdb_exists_hash(struct tdb_context *tdb, TDB_DATA key, u32 hash) in tdb_exists_hash()
3263 int tdb_exists(struct tdb_context *tdb, TDB_DATA key) in tdb_exists()
3270 int tdb_do_delete(struct tdb_context *tdb, tdb_off_t rec_ptr, struct list_struct*rec) in tdb_do_delete()
3304 static int tdb_count_dead(struct tdb_context *tdb, u32 hash) in tdb_count_dead()
3329 static int tdb_purge_dead(struct tdb_context *tdb, u32 hash) in tdb_purge_dead()
3365 static int tdb_delete_hash(struct tdb_context *tdb, TDB_DATA key, u32 hash) in tdb_delete_hash()
3417 int tdb_delete(struct tdb_context *tdb, TDB_DATA key) in tdb_delete()
3426 static tdb_off_t tdb_find_dead(struct tdb_context *tdb, u32 hash, in tdb_find_dead()
3457 int tdb_store(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf, int flag) in tdb_store()
3596 int tdb_append(struct tdb_context *tdb, TDB_DATA key, TDB_DATA new_dbuf) in tdb_append()
3641 const char *tdb_name(struct tdb_context *tdb) in tdb_name()
3651 int tdb_fd(struct tdb_context *tdb) in tdb_fd()
3660 tdb_log_func tdb_log_fn(struct tdb_context *tdb) in tdb_log_fn()
3676 int tdb_get_seqnum(struct tdb_context *tdb) in tdb_get_seqnum()
3684 int tdb_hash_size(struct tdb_context *tdb) in tdb_hash_size()
3689 size_t tdb_map_size(struct tdb_context *tdb) in tdb_map_size()
3694 int tdb_get_flags(struct tdb_context *tdb) in tdb_get_flags()
3703 void tdb_enable_seqnum(struct tdb_context *tdb) in tdb_enable_seqnum()
3711 static struct tdb_context *tdbs = NULL;
3729 static int tdb_new_database(struct tdb_context *tdb, int hash_size) in tdb_new_database()
3777 struct tdb_context *i; in tdb_already_open()
3798 struct tdb_context *tdb_open(const char *name, int hash_size, int tdb_flags, in tdb_open()
3805 static void null_log_fn(struct tdb_context *tdb, enum tdb_debug_level level, const char *fmt, ...) …
3806 static void null_log_fn(struct tdb_context *tdb, enum tdb_debug_level level, const char *fmt, ...) in null_log_fn()
3811 struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags, in tdb_open_ex()
3816 struct tdb_context *tdb; in tdb_open_ex()
3822 if (!(tdb = (struct tdb_context *)calloc(1, sizeof *tdb))) { in tdb_open_ex()
4008 void tdb_set_max_dead(struct tdb_context *tdb, int max_dead) in tdb_set_max_dead()
4018 int tdb_close(struct tdb_context *tdb) in tdb_close()
4020 struct tdb_context **i; in tdb_close()
4053 void tdb_set_logging_function(struct tdb_context *tdb, in tdb_set_logging_function()
4059 void *tdb_get_logging_private(struct tdb_context *tdb) in tdb_get_logging_private()
4066 int tdb_reopen(struct tdb_context *tdb) in tdb_reopen()
4120 struct tdb_context *tdb; in tdb_reopen_all()
4149 int tdb_flush(struct tdb_context *tdb) in tdb_flush()