lib:tdb: Fix code spelling
authorAndreas Schneider <asn@samba.org>
Thu, 13 Apr 2023 11:17:08 +0000 (13:17 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 14 Apr 2023 05:25:33 +0000 (05:25 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
lib/tdb/common/lock.c
lib/tdb/common/mutex.c
lib/tdb/common/open.c
lib/tdb/common/transaction.c
lib/tdb/common/traverse.c
lib/tdb/docs/mutex.txt
lib/tdb/test/lock-tracking.c

index c4e276f84d609171738a7e6edb364b1f4804f4b4..045ded95857b68fd977cadddbaab33d6f1335f41 100644 (file)
@@ -812,7 +812,7 @@ _PUBLIC_ int tdb_lockall_unmark(struct tdb_context *tdb)
        return tdb_allrecord_unlock(tdb, F_WRLCK, true);
 }
 
-/* lock entire database with write lock - nonblocking varient */
+/* lock entire database with write lock - nonblocking variant */
 _PUBLIC_ int tdb_lockall_nonblock(struct tdb_context *tdb)
 {
        int ret = tdb_allrecord_lock(tdb, F_WRLCK, TDB_LOCK_NOWAIT, false);
@@ -834,7 +834,7 @@ _PUBLIC_ int tdb_lockall_read(struct tdb_context *tdb)
        return tdb_allrecord_lock(tdb, F_RDLCK, TDB_LOCK_WAIT, false);
 }
 
-/* lock entire database with read lock - nonblock varient */
+/* lock entire database with read lock - nonblock variant */
 _PUBLIC_ int tdb_lockall_read_nonblock(struct tdb_context *tdb)
 {
        int ret = tdb_allrecord_lock(tdb, F_RDLCK, TDB_LOCK_NOWAIT, false);
index 78926db0be82b9358db7174facdefa9523b23a04..a7106164445df258fb4cf8385e37f151ea74c55e 100644 (file)
@@ -454,7 +454,7 @@ int tdb_mutex_allrecord_upgrade(struct tdb_context *tdb)
 
        /*
         * Our only caller tdb_allrecord_upgrade()
-        * garantees that we already own the allrecord lock.
+        * guarantees that we already own the allrecord lock.
         *
         * Which means m->allrecord_mutex is still locked by us.
         */
@@ -502,7 +502,7 @@ void tdb_mutex_allrecord_downgrade(struct tdb_context *tdb)
 
        /*
         * Our only caller tdb_allrecord_upgrade() (in the error case)
-        * garantees that we already own the allrecord lock.
+        * guarantees that we already own the allrecord lock.
         *
         * Which means m->allrecord_mutex is still locked by us.
         */
@@ -531,7 +531,7 @@ int tdb_mutex_allrecord_unlock(struct tdb_context *tdb)
        /*
         * Our only callers tdb_allrecord_unlock() and
         * tdb_allrecord_lock() (in the error path)
-        * garantee that we already own the allrecord lock.
+        * guarantee that we already own the allrecord lock.
         *
         * Which means m->allrecord_mutex is still locked by us.
         */
@@ -982,7 +982,7 @@ cleanup:
         * tdb_robust_mutex_pid to -1. This is ok as this code path is only
         * called once per process.
         *
-        * Leaving our signal handler avoids races with other threads potentialy
+        * Leaving our signal handler avoids races with other threads potentially
         * setting up their SIGCHLD handlers.
         *
         * The worst thing that can happen is that the other newer signal
index f7f65b0e2379048a58f280775e28831f5d9eb316..10233591dad34a0f36f3f1b678a433b53307f0e0 100644 (file)
@@ -94,7 +94,7 @@ static int tdb_new_database(struct tdb_context *tdb, struct tdb_header *header,
        }
 
        /*
-        * It's required for some following code pathes
+        * It's required for some following code paths
         * to have the fields on 'tdb' up-to-date.
         *
         * E.g. tdb_mutex_size() requires it
@@ -826,7 +826,7 @@ _PUBLIC_ int tdb_close(struct tdb_context *tdb)
        return ret;
 }
 
-/* register a loging function */
+/* register a logging function */
 _PUBLIC_ void tdb_set_logging_function(struct tdb_context *tdb,
                                        const struct tdb_logging_context *log_ctx)
 {
index 5ab38d0809f29264ea7e69afaa68423705bb8c63..78bbd7ad23e16090db7aa1545c71880aee6cfc21 100644 (file)
@@ -68,7 +68,7 @@
     although once a transaction is started then an exclusive lock is
     gained until the transaction is committed or cancelled
 
-  - the commit stategy involves first saving away all modified data
+  - the commit strategy involves first saving away all modified data
     into a linearised buffer in the transaction recovery area, then
     marking the transaction recovery area with a magic value to
     indicate a valid recovery record. In total 4 fsync/msync calls are
index d69e7dff2854eb55163fa81e44d11672b2eb16ff..fcd2e001be4153c2a65a14ef8a7d5bc04569cf3e 100644 (file)
@@ -58,7 +58,7 @@ static tdb_off_t tdb_next_lock(struct tdb_context *tdb, struct tdb_traverse_lock
                           that we have done at least one fcntl lock at the
                           start of a search to guarantee that memory is
                           coherent on SMP systems. If records are added by
-                          others during the search then thats OK, and we
+                          others during the search then that's OK, and we
                           could possibly miss those with this trick, but we
                           could miss them anyway without this trick, so the
                           semantics don't change.
index a5a75420c1dc86bfd7685fb7c6ef9de2a481680d..0003c7f64be5c2f1b5b32a0797c1ef1e079f3c7b 100644 (file)
@@ -15,7 +15,7 @@ with a fcntl lock.
 The external locking API of tdb also allows one to lock the complete database, and
 ctdb uses this facility to freeze databases during a recovery. While the
 so-called allrecord lock is held, all linked lists and all individual records
-are frozen alltogether. Tdb achieves this by locking the complete file range
+are frozen altogether. Tdb achieves this by locking the complete file range
 with a single fcntl lock. Individual 1-byte locks for the linked lists
 conflict with this. Access to records is prevented by the one large fnctl byte
 range lock.
@@ -73,7 +73,7 @@ The setpshared functions indicate to the kernel that the mutex is about to be
 shared between processes in a common shared memory area.
 
 The process shared posix mutexes have the potential to replace fcntl locking
-to coordinate mmap access for tdbs. However, they are missing the criticial
+to coordinate mmap access for tdbs. However, they are missing the critical
 auto-cleanup property that fcntl provides when a process dies. A process that
 dies hard while holding a shared mutex has no chance to clean up the protected
 data structures and unlock the shared mutex. Thus with a pure process shared
index b2f092c0c4df795bcb000137d2c99769c2374db7..fb7706e9bcf6944a75a0844f77a64f8b0da0b732 100644 (file)
@@ -1,4 +1,4 @@
-/* We save the locks so we can reaquire them. */
+/* We save the locks so we can reacquire them. */
 #include "../common/tdb_private.h"
 #include <unistd.h>
 #include <fcntl.h>