From eb50727a93ce10568973d6fc6b267b966e65b698 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Sun, 25 Sep 2016 13:43:51 -0600 Subject: [PATCH] bloom: allow to pass in whether to set bits for strings Signed-off-by: Jens Axboe --- lib/bloom.c | 5 +++-- lib/bloom.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/bloom.c b/lib/bloom.c index c2e6c11f..9ccec5fa 100644 --- a/lib/bloom.c +++ b/lib/bloom.c @@ -118,7 +118,8 @@ bool bloom_set(struct bloom *b, uint32_t *data, unsigned int nwords) return __bloom_check(b, data, nwords * sizeof(uint32_t), true); } -bool bloom_set_string(struct bloom *b, const char *data, unsigned int len) +bool bloom_string(struct bloom *b, const char *data, unsigned int len, + bool set) { - return __bloom_check(b, data, len, true); + return __bloom_check(b, data, len, set); } diff --git a/lib/bloom.h b/lib/bloom.h index d40d9f6b..141ead9a 100644 --- a/lib/bloom.h +++ b/lib/bloom.h @@ -9,6 +9,6 @@ struct bloom; struct bloom *bloom_new(uint64_t entries); void bloom_free(struct bloom *b); bool bloom_set(struct bloom *b, uint32_t *data, unsigned int nwords); -bool bloom_set_string(struct bloom *b, const char *data, unsigned int len); +bool bloom_string(struct bloom *b, const char *data, unsigned int len, bool); #endif -- 2.25.1