X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb%2Ftraverse.c;h=c605c8e6a3b5b02344a662d492ad31f3497043cf;hb=87d99348a110a52fbc6e225b360e566fc474956a;hp=d329ef4da4030c095e530b0d7b05b344c2256305;hpb=c39bd505849acdf77744e24b5db7263003911c08;p=ccan-lca-2011.git diff --git a/ccan/tdb/traverse.c b/ccan/tdb/traverse.c index d329ef4..c605c8e 100644 --- a/ccan/tdb/traverse.c +++ b/ccan/tdb/traverse.c @@ -39,7 +39,7 @@ static tdb_off_t tdb_next_lock(struct tdb_context *tdb, struct tdb_traverse_lock /* Lock each chain from the start one. */ for (; tlock->hash < tdb->header.hash_size; tlock->hash++) { if (!tlock->off && tlock->hash != 0) { - /* this is an optimisation for the common case where + /* this is an optimization for the common case where the hash chain is empty, which is particularly common for the use of tdb with ldb, where large hashes are used. In that case we spend most of our @@ -53,7 +53,7 @@ static tdb_off_t tdb_next_lock(struct tdb_context *tdb, struct tdb_traverse_lock lock, so instead we get the lock and re-fetch the value below. - Notice that not doing this optimisation on the + Notice that not doing this optimization on the first hash chain is critical. We must guarantee that we have done at least one fcntl lock at the start of a search to guarantee that memory is