Lines Matching refs:tdb_off_t
118 typedef u32 tdb_off_t; typedef
138 #define TDB_HASH_TOP(hash) (FREELIST_TOP + (BUCKET(hash)+1)*sizeof(tdb_off_t))
139 #define TDB_HASHTABLE_SIZE(tdb) ((tdb->header.hash_size+1)*sizeof(tdb_off_t))
170 tdb_off_t next; /* offset of the next record in the list */
194 tdb_off_t rwlocks; /* obsolete - kept to detect old formats */
195 tdb_off_t recovery_start; /* offset of transaction recovery region */
196 tdb_off_t sequence_number; /* used when TDB_SEQNUM is set */
197 tdb_off_t reserved[29];
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);
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);
260 static int tdb_brlock(struct tdb_context *tdb, tdb_off_t offset, int rw_type, int lck_type, int pro…
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);
280 tdb_off_t offset, tdb_len_t len,
284 static tdb_off_t tdb_find_lock_hash(struct tdb_context *tdb, TDB_DATA key, u32 hash, int locktype,
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,
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()
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()
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()
1058 tdb_off_t offset; 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()
1132 tdb_off_t off = *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()
1164 tdb_off_t offset, tdb_len_t len, 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()
1298 tdb_off_t offset;
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()
1412 if (len == sizeof(tdb_off_t) && off >= FREELIST_TOP && in transaction_write()
1414 u32 chain = (off-FREELIST_TOP) / sizeof(tdb_off_t); in transaction_write()
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()
1552 tdb_off_t addition) in transaction_expand_file()
1566 static int transaction_brlock(struct tdb_context *tdb, tdb_off_t offset, in transaction_brlock()
1748 static int transaction_sync(struct tdb_context *tdb, tdb_off_t offset, tdb_len_t length) in transaction_sync()
1757 tdb_off_t moffset = offset & ~(tdb->page_size-1); in transaction_sync()
1784 recovery_size += 2*sizeof(tdb_off_t) + el->length; in tdb_recovery_size()
1796 tdb_off_t *recovery_offset, in tdb_recovery_allocate()
1801 tdb_off_t recovery_head; in tdb_recovery_allocate()
1863 &recovery_head, sizeof(tdb_off_t)) == -1) { in tdb_recovery_allocate()
1876 tdb_off_t *magic_offset) in transaction_setup_recovery()
1883 tdb_off_t recovery_offset, recovery_max_size; in transaction_setup_recovery()
1884 tdb_off_t old_map_size = tdb->transaction->old_map_size; in transaction_setup_recovery()
1987 tdb_off_t magic_offset = 0; in tdb_transaction_commit()
2139 tdb_off_t recovery_head, recovery_eof; 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()
2294 tdb_off_t last_ptr, i; in remove_from_freelist()
2312 static int update_tailer(struct tdb_context *tdb, tdb_off_t offset, in update_tailer()
2315 tdb_off_t totalsize; in update_tailer()
2319 return tdb_ofs_write(tdb, offset + totalsize - sizeof(tdb_off_t), in update_tailer()
2325 int tdb_free(struct tdb_context *tdb, tdb_off_t offset, struct list_struct *rec) in tdb_free()
2327 tdb_off_t right, left; in tdb_free()
2361 left = offset - sizeof(tdb_off_t); in tdb_free()
2364 tdb_off_t leftsize; 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()
2428 struct list_struct *rec, tdb_off_t last_ptr) in tdb_allocate_ofs()
2431 tdb_off_t newrec_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()
2490 tdb_off_t rec_ptr, last_ptr, newrec_ptr; in tdb_allocate()
2492 tdb_off_t rec_ptr, last_ptr; in tdb_allocate()
2500 length += sizeof(tdb_off_t); in tdb_allocate()
2572 static int seen_insert(struct tdb_context *mem_tdb, tdb_off_t rec_ptr) in seen_insert()
2586 tdb_off_t rec_ptr, last_ptr; in tdb_validate_freelist()
2713 tdb_off_t current; in tdb_next_lock()
2953 static tdb_off_t tdb_dump_record(struct tdb_context *tdb, int hash, in tdb_dump_record()
2954 tdb_off_t offset) in tdb_dump_record()
2957 tdb_off_t tailer_ofs, tailer; in tdb_dump_record()
2970 tailer_ofs = offset + sizeof(rec) + rec.rec_len - sizeof(tdb_off_t); in tdb_dump_record()
2986 tdb_off_t rec_ptr, top; in tdb_dump_chain()
3020 tdb_off_t offset, rec_ptr; in tdb_printfreelist()
3069 tdb_off_t seqnum=0; in tdb_increment_seqnum_nonblock()
3109 static tdb_off_t tdb_find(struct tdb_context *tdb, TDB_DATA key, u32 hash, in tdb_find()
3112 tdb_off_t rec_ptr; 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()
3156 tdb_off_t rec_ptr; in tdb_update_hash()
3163 if (rec.rec_len < key.dsize + dbuf.dsize + sizeof(tdb_off_t)) { in tdb_update_hash()
3189 tdb_off_t rec_ptr; in tdb_fetch()
3227 tdb_off_t rec_ptr; in tdb_parse_record()
3270 int tdb_do_delete(struct tdb_context *tdb, tdb_off_t rec_ptr, struct list_struct*rec) in tdb_do_delete()
3272 tdb_off_t last_ptr, i; in tdb_do_delete()
3307 tdb_off_t rec_ptr; in tdb_count_dead()
3333 tdb_off_t rec_ptr; in tdb_purge_dead()
3344 tdb_off_t next; in tdb_purge_dead()
3367 tdb_off_t rec_ptr; in tdb_delete_hash()
3426 static tdb_off_t tdb_find_dead(struct tdb_context *tdb, u32 hash, in tdb_find_dead()
3429 tdb_off_t rec_ptr; in tdb_find_dead()
3461 tdb_off_t rec_ptr; in tdb_store()
3523 key.dsize + dbuf.dsize + sizeof(tdb_off_t)); in tdb_store()
3678 tdb_off_t seqnum=0; in tdb_get_seqnum()
3735 size = sizeof(struct tdb_header) + (hash_size+1)*sizeof(tdb_off_t); in tdb_new_database()