container_of: don't put member_ptr in container_off.
[ccan] / ccan / tdb / traverse.c
index 1532c6b25029f20042411039d5fb98340bee060e..c605c8e6a3b5b02344a662d492ad31f3497043cf 100644 (file)
@@ -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
@@ -140,9 +140,9 @@ static tdb_off_t tdb_next_lock(struct tdb_context *tdb, struct tdb_traverse_lock
    if fn is NULL then it is not called
    a non-zero return value from fn() indicates that the traversal should stop
   */
-static int _tdb_traverse(struct tdb_context *tdb, 
-                        tdb_traverse_func fn, void *private_data,
-                        struct tdb_traverse_lock *tl)
+static int tdb_traverse_internal(struct tdb_context *tdb, 
+                                tdb_traverse_func fn, void *private_data,
+                                struct tdb_traverse_lock *tl)
 {
        TDB_DATA key, dbuf;
        struct tdb_record rec;
@@ -226,7 +226,7 @@ int tdb_traverse_read(struct tdb_context *tdb,
 
        tdb->traverse_read++;
        tdb_trace(tdb, "tdb_traverse_read_start");
-       ret = _tdb_traverse(tdb, fn, private_data, &tl);
+       ret = tdb_traverse_internal(tdb, fn, private_data, &tl);
        tdb->traverse_read--;
 
        tdb_transaction_unlock(tdb, F_RDLCK);
@@ -257,7 +257,7 @@ int tdb_traverse(struct tdb_context *tdb,
 
        tdb->traverse_write++;
        tdb_trace(tdb, "tdb_traverse_start");
-       ret = _tdb_traverse(tdb, fn, private_data, &tl);
+       ret = tdb_traverse_internal(tdb, fn, private_data, &tl);
        tdb->traverse_write--;
 
        tdb_transaction_unlock(tdb, F_WRLCK);