X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb2%2Fprivate.h;h=63354a43dd829c52f82d0a933783f6c67ce8782b;hb=f6067e4cbd7b7415571f12438aec00faec5657fb;hp=4e7fc8ffeccaba5e2ab13348cf02a23bcbbb15bf;hpb=bb4d59ee1e914df9f8066e59a9c9a6604e581c40;p=ccan diff --git a/ccan/tdb2/private.h b/ccan/tdb2/private.h index 4e7fc8ff..63354a43 100644 --- a/ccan/tdb2/private.h +++ b/ccan/tdb2/private.h @@ -246,7 +246,9 @@ struct tdb_header { uint64_t features_used; /* Features all writers understand */ uint64_t features_offered; /* Features offered */ - tdb_off_t reserved[24]; + uint64_t seqnum; /* Sequence number for TDB_SEQNUM */ + + tdb_off_t reserved[23]; /* Top level hash table. */ tdb_off_t hashtable[1ULL << TDB_TOPLEVEL_HASH_BITS]; @@ -388,6 +390,9 @@ struct tdb_context { /* Direct access information */ struct tdb_access_hdr *access; + /* Last error we returned. */ + enum TDB_ERROR last_error; + /* The actual file information */ struct tdb_file *file; }; @@ -523,6 +528,9 @@ enum TDB_ERROR tdb_write_convert(struct tdb_context *tdb, tdb_off_t off, enum TDB_ERROR tdb_read_convert(struct tdb_context *tdb, tdb_off_t off, void *rec, size_t len); +/* Bump the seqnum (caller checks for tdb->flags & TDB_SEQNUM) */ +void tdb_inc_seqnum(struct tdb_context *tdb); + /* Adds a stat, if it's in range. */ void add_stat_(struct tdb_context *tdb, uint64_t *stat, size_t val); #define add_stat(tdb, statname, val) \