diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-06-01 18:20:41 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-06-25 15:01:36 +0200 |
commit | 20b0acfacd61ffd608580ac53a11a387ba8a4ae5 (patch) | |
tree | db7f981e1303e6794a1b3ba99d211340c34e4de7 /src | |
parent | journal-file: rename return parameters to ret_xyz (diff) | |
download | systemd-20b0acfacd61ffd608580ac53a11a387ba8a4ae5.tar.xz systemd-20b0acfacd61ffd608580ac53a11a387ba8a4ae5.zip |
journal: rename hash64() to jenkins_hash64()
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_".
Diffstat (limited to '')
-rw-r--r-- | src/journal/journal-file.c | 8 | ||||
-rw-r--r-- | src/journal/journal-verify.c | 4 | ||||
-rw-r--r-- | src/journal/lookup3.h | 2 | ||||
-rw-r--r-- | src/journal/sd-journal.c | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index 9efd08d937..c77a9436e6 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -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) diff --git a/src/journal/journal-verify.c b/src/journal/journal-verify.c index 344b7b019a..c70ab7aa24 100644 --- a/src/journal/journal-verify.c +++ b/src/journal/journal-verify.c @@ -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); diff --git a/src/journal/lookup3.h b/src/journal/lookup3.h index 787921ffbf..0a01269e43 100644 --- a/src/journal/lookup3.h +++ b/src/journal/lookup3.h @@ -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); diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c index 7e958e9f43..5ddca5f93a 100644 --- a/src/journal/sd-journal.c +++ b/src/journal/sd-journal.c @@ -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); |