X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Fdoc%2Fdesign.lyx;h=ba3f9cc60fdee362aa94386cdf6b9067cd852a3a;hp=bb499482e5c077385fadfc1b82ed7c14577bedb5;hb=380372e733416c2b348d5307f536d0a0807e95df;hpb=51a56b52627e635566253a3fae081c3f466b6bb6 diff --git a/ccan/tdb2/doc/design.lyx b/ccan/tdb2/doc/design.lyx index bb499482..ba3f9cc6 100644 --- a/ccan/tdb2/doc/design.lyx +++ b/ccan/tdb2/doc/design.lyx @@ -35,7 +35,7 @@ \paperpagestyle default \tracking_changes true \output_changes true -\author "Rusty Russell,,," +\author "" \author "" \end_header @@ -50,7 +50,7 @@ Rusty Russell, IBM Corporation \end_layout \begin_layout Date -1-December-2010 +17-March-2011 \end_layout \begin_layout Abstract @@ -698,7 +698,7 @@ Status \end_layout \begin_layout Standard -Incomplete; nesting flag is still defined as per tdb1. +Complete; the nesting flag has been removed. \end_layout \begin_layout Subsection @@ -779,9 +779,9 @@ Status \end_layout \begin_layout Standard -Incomplete. - TDB_VOLATILE still defined, but implementation should fail on unknown flags - to be future-proof. +Complete. + Unknown flags cause tdb_open() to fail as well, so they can be detected + at runtime. \end_layout \begin_layout Subsection @@ -841,7 +841,7 @@ Status \end_layout \begin_layout Standard -Incomplete. +Complete. \end_layout \begin_layout Subsection @@ -870,14 +870,13 @@ Proposed Solution \begin_layout Standard Reachitecting the API to include a tdb_errcode pointer would be a great - deal of churn; we are better to guarantee that the tdb_errcode is per-thread - so the current programming model can be maintained. -\end_layout - -\begin_layout Standard -This requires dynamic per-thread allocations, which is awkward with POSIX - threads (pthread_key_create space is limited and we cannot simply allocate - a key for every TDB). + deal of churn, but fortunately most functions return 0 on success and -1 + on error: we can change these to return 0 on success and a negative error + code on error, and the API remains similar to previous. + The tdb_fetch, tdb_firstkey and tdb_nextkey functions need to take a TDB_DATA + pointer and return an error code. + It is also simpler to have tdb_nextkey replace its key argument in place, + freeing up any old .dptr. \end_layout \begin_layout Standard @@ -903,7 +902,7 @@ Status \end_layout \begin_layout Standard -Incomplete. +Incomplete; API has been changed but thread safety has not been implemented. \end_layout \begin_layout Subsection @@ -1246,7 +1245,7 @@ Status \end_layout \begin_layout Standard -Incomplete. +Complete. \end_layout \begin_layout Subsection @@ -1291,7 +1290,7 @@ Status \end_layout \begin_layout Standard -Incomplete, TDB_CLEAR_IF_FIRST still defined, but not implemented. +Complete. \end_layout \begin_layout Subsection @@ -1350,7 +1349,7 @@ Status \end_layout \begin_layout Standard -Incomplete. +Complete. \end_layout \begin_layout Subsection @@ -1380,7 +1379,7 @@ Status \end_layout \begin_layout Standard -Incomplete. +Complete. \end_layout \begin_layout Subsection @@ -1497,7 +1496,7 @@ Status \end_layout \begin_layout Standard -Incomplete; TDB_CLEAR_IF_FIRST still defined, but does nothing. +Complete. \end_layout \begin_layout Subsection @@ -2237,10 +2236,6 @@ struct tdb_free_record { \end_layout \begin_layout Standard - -\change_deleted 0 1291206079 - -\change_unchanged Note that by limiting valid offsets to 56 bits, we can pack everything we need into 3 64-byte words, meaning our minimum record size is 8 bytes. \end_layout