• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/ap/gpl/timemachine/netatalk-2.2.5/libatalk/tdb/

Lines Matching refs:offset

169 	tdb_off next; /* offset of the next record in the list */
200 this functions locks/unlocks 1 byte at the specified offset.
204 static int tdb_brlock(TDB_CONTEXT *tdb, tdb_off offset,
219 fl.l_start = offset;
236 TDB_LOG((tdb, 5,"tdb_brlock failed (fd=%d) at offset %d rw_type=%d lck_type=%d\n",
237 tdb->fd, offset, rw_type, lck_type));
372 /* write a lump of data at a specified offset */
395 /* read a lump of data at a specified offset, maybe convert */
421 static char *tdb_alloc_read(TDB_CONTEXT *tdb, tdb_off offset, tdb_len len)
432 if (tdb_read(tdb, offset, buf, len, 0) == -1) {
440 static int ofs_read(TDB_CONTEXT *tdb, tdb_off offset, tdb_off *d)
442 return tdb_read(tdb, offset, (char*)d, sizeof(*d), DOCONV());
444 static int ofs_write(TDB_CONTEXT *tdb, tdb_off offset, tdb_off *d)
447 return tdb_write(tdb, offset, CONVERT(off), sizeof(*d));
451 static int rec_read(TDB_CONTEXT *tdb, tdb_off offset, struct list_struct *rec)
453 if (tdb_read(tdb, offset, rec, sizeof(*rec),DOCONV()) == -1)
458 TDB_LOG((tdb, 0,"rec_read bad magic 0x%x at offset=%d\n", rec->magic, offset));
463 static int rec_write(TDB_CONTEXT *tdb, tdb_off offset, struct list_struct *rec)
466 return tdb_write(tdb, offset, CONVERT(r), sizeof(r));
478 TDB_LOG((tdb, 0,"rec_free_read non-free magic at offset=%d - fixing\n",
488 TDB_LOG((tdb, 0,"rec_free_read bad magic 0x%x at offset=%d\n",
498 static int update_tailer(TDB_CONTEXT *tdb, tdb_off offset,
505 return ofs_write(tdb, offset + totalsize - sizeof(tdb_off),
509 static tdb_off tdb_dump_record(TDB_CONTEXT *tdb, tdb_off offset)
514 if (tdb_read(tdb, offset, (char *)&rec, sizeof(rec), DOCONV()) == -1) {
515 printf("ERROR: failed to read record at %u\n", offset);
519 printf(" rec: offset=%u next=%d rec_len=%d key_len=%d data_len=%d full_hash=0x%x magic=0x%x\n",
520 offset, rec.next, rec.rec_len, rec.key_len, rec.data_len, rec.full_hash, rec.magic);
522 tailer_ofs = offset + sizeof(rec) + rec.rec_len - sizeof(tdb_off);
571 tdb_off offset, rec_ptr;
577 offset = FREELIST_TOP;
580 if (ofs_read(tdb, offset, &rec_ptr) == -1) {
598 printf("entry offset=[0x%08x], rec.rec_len = [0x%08x (%d)]\n", rec.next, rec.rec_len, rec.rec_len );
622 /* Follow chain (next offset is at start of record) */
631 static int tdb_free(TDB_CONTEXT *tdb, tdb_off offset, struct list_struct *rec)
640 if (update_tailer(tdb, offset, rec) != 0) {
646 right = offset + sizeof(*rec) + rec->rec_len;
667 left = offset - sizeof(tdb_off);
674 TDB_LOG((tdb, 0, "tdb_free: left offset read failed at %u\n", left));
677 left = offset - leftsize;
691 offset = left;
698 if (update_tailer(tdb, offset, rec) == -1) {
699 TDB_LOG((tdb, 0, "tdb_free: update_tailer failed at %u\n", offset));
707 rec_write(tdb, offset, rec) == -1 ||
708 ofs_write(tdb, FREELIST_TOP, &offset) == -1) {
709 TDB_LOG((tdb, 0, "tdb_free record write failed at offset=%d\n", offset));
779 tdb_off offset;
828 offset = tdb->map_size - size;
829 if (tdb_free(tdb, offset, &rec) == -1)
839 /* allocate some space from the free list. The offset returned points
909 /* all done - return the new record offset */
972 /* Returns 0 on fail. On success, return offset of record, and fills
1180 /* actually delete an entry in the database given the offset */
1215 /* Uses traverse lock: 0 = finish, -1 = error, other = record offset */
1242 /* We have offset of old record: grab next */