return ret;
}
-int bloom_test_and_insert(const uint8_t *data, size_t len, struct bloom *b)
+int bloom_insert(const uint8_t *data, size_t len, struct bloom *b)
{
int i, ret = 0;
uint32_t h = 0xb11924e1; /* some arbitrary value */
#ifdef TEST_BLOOM
-int bloom_test_and_insert_string(const char *str, struct bloom *b)
+int bloom_insert_string(const char *str, struct bloom *b)
{
uint32_t len = strlen(str);
- return bloom_test_and_insert((const uint8_t *)str, len, b);
+ return bloom_insert((const uint8_t *)str, len, b);
}
void add_stdin(struct bloom *b)
continue;
if (buf[len - 1] == '\n')
buf[len - 1] = '\0';
- if (bloom_test_and_insert_string(buf, b))
+ if (bloom_insert_string(buf, b))
false_positives++;
}
INFO_LOG("filter contains %llu entries\n", b->num_entries);
struct bloom *bloom_new(unsigned order, unsigned num_hash_functions);
void bloom_free(struct bloom *b);
-int bloom_test_and_insert(const uint8_t *data, size_t len, struct bloom *b);
+int bloom_insert(const uint8_t *data, size_t len, struct bloom *b);
{
if (!consider_bloom(s))
return 0;
- return bloom_test_and_insert(buf, GLOBAL_BLOOM_BUF_SIZE,
- global_bloom_filter);
+ return bloom_insert(buf, GLOBAL_BLOOM_BUF_SIZE, global_bloom_filter);
}
static int insert_user_bloom(struct stat64 *s,
{
if (!consider_bloom(s))
return 0;
- return bloom_test_and_insert(buf, USER_BLOOM_BUF_SIZE,
- user_bloom_filter);
+ return bloom_insert(buf, USER_BLOOM_BUF_SIZE, user_bloom_filter);
}
static int add_directory(char *dirname, uint64_t *dir_num, uint64_t *parent_dir_num,