]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal: rename hash64() to jenkins_hash64()
authorLennart Poettering <lennart@poettering.net>
Mon, 1 Jun 2020 16:20:41 +0000 (18:20 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 25 Jun 2020 13:01:36 +0000 (15:01 +0200)
Let's prefix this with "jenkins_" since it wraps the jenkins hash. We
want to add support for other hash functions to journald soon, hence
better be clear with what this is. In particular as all other symbols
defined by lookup3.h actually are prefixed "jenkins_".

src/journal/journal-file.c
src/journal/journal-verify.c
src/journal/lookup3.h
src/journal/sd-journal.c

index 9efd08d9376d58c1926aebe9daa21d1c4e0960a6..c77a9436e6b7abb15ce34dd7e0479cdc6797585c 100644 (file)
@@ -1344,7 +1344,7 @@ int journal_file_find_field_object(
         assert(f);
         assert(field && size > 0);
 
-        hash = hash64(field, size);
+        hash = jenkins_hash64(field, size);
 
         return journal_file_find_field_object_with_hash(
                         f,
@@ -1451,7 +1451,7 @@ int journal_file_find_data_object(
         assert(f);
         assert(data || size == 0);
 
-        hash = hash64(data, size);
+        hash = jenkins_hash64(data, size);
 
         return journal_file_find_data_object_with_hash(
                         f,
@@ -1472,7 +1472,7 @@ static int journal_file_append_field(
         assert(f);
         assert(field && size > 0);
 
-        hash = hash64(field, size);
+        hash = jenkins_hash64(field, size);
 
         r = journal_file_find_field_object_with_hash(f, field, size, hash, &o, &p);
         if (r < 0)
@@ -1535,7 +1535,7 @@ static int journal_file_append_data(
         assert(f);
         assert(data || size == 0);
 
-        hash = hash64(data, size);
+        hash = jenkins_hash64(data, size);
 
         r = journal_file_find_data_object_with_hash(f, data, size, hash, &o, &p);
         if (r < 0)
index 344b7b019a57c3148bccf6c5e1cfa3305ebcb8a6..c70ab7aa24459ea2550feb79edf9ea29122401cf 100644 (file)
@@ -163,9 +163,9 @@ static int journal_file_object_verify(JournalFile *f, uint64_t offset, Object *o
                                 return r;
                         }
 
-                        h2 = hash64(b, b_size);
+                        h2 = jenkins_hash64(b, b_size);
                 } else
-                        h2 = hash64(o->data.payload, le64toh(o->object.size) - offsetof(Object, data.payload));
+                        h2 = jenkins_hash64(o->data.payload, le64toh(o->object.size) - offsetof(Object, data.payload));
 
                 if (h1 != h2) {
                         error(offset, "Invalid hash (%08"PRIx64" vs. %08"PRIx64, h1, h2);
index 787921ffbf767c56053c373f8723bd8488823f7e..0a01269e433980b1c89f933e5f06521d70e2728f 100644 (file)
@@ -13,7 +13,7 @@ void jenkins_hashlittle2(const void *key, size_t length, uint32_t *pc, uint32_t
 
 uint32_t jenkins_hashbig(const void *key, size_t length, uint32_t initval) _pure_;
 
-static inline uint64_t hash64(const void *data, size_t length) {
+static inline uint64_t jenkins_hash64(const void *data, size_t length) {
         uint32_t a = 0, b = 0;
 
         jenkins_hashlittle2(data, length, &a, &b);
index 7e958e9f43140dc9476a68f17bb3f0cd082449e0..5ddca5f93a8b8e370bfe52c96c3213e2626a5ecb 100644 (file)
@@ -279,7 +279,7 @@ _public_ int sd_journal_add_match(sd_journal *j, const void *data, size_t size)
         assert(j->level1->type == MATCH_OR_TERM);
         assert(j->level2->type == MATCH_AND_TERM);
 
-        hash = hash64(data, size);
+        hash = jenkins_hash64(data, size);
 
         LIST_FOREACH(matches, l3, j->level2->matches) {
                 assert(l3->type == MATCH_OR_TERM);