adu.ggo: Remove unused --config-file option.
[adu.git] / create.c
index 1b4ba880a1c3d220adc664b83bdae3ab1a46eef0..0394412955134a8a2d75dfe592ea602303261c2b 100644 (file)
--- a/create.c
+++ b/create.c
@@ -31,7 +31,9 @@ static int consider_bloom(struct stat64 *s)
        return 1;
 }
 
+/** Data size to hash for the global bloom filter. */
 #define GLOBAL_BLOOM_BUF_SIZE (sizeof(ino_t) + sizeof(dev_t) + sizeof(off_t))
+/** For the user bloom filter also the uid is being hashed. */
 #define USER_BLOOM_BUF_SIZE (GLOBAL_BLOOM_BUF_SIZE + sizeof(uid_t))
 
 static void make_bloom_buf(struct stat64 *s, uint8_t buf[USER_BLOOM_BUF_SIZE])
@@ -54,8 +56,7 @@ static int insert_global_bloom(struct stat64 *s,
 {
        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,
@@ -63,8 +64,7 @@ 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,
@@ -223,7 +223,7 @@ static void log_bloom_stat(struct bloom *b)
        NOTICE_LOG("\t%u%% of bits are set\n", percent);
        if (percent > 50) {
                WARNING_LOG("results may be unreliable!\n");
-               WARNING_LOG("consider incrasing bllom filter size\n");
+               WARNING_LOG("consider increasing bloom filter size\n");
        }
 }
 
@@ -256,8 +256,8 @@ int com_create(void)
        if (!S_ISDIR(statbuf.st_mode))
                return -ERRNO_TO_ERROR(ENOTDIR);
        if (order >= 10 && num > 0) {
-               bloom_init(order, num, &global_bloom_filter);
-               bloom_init(order, num, &user_bloom_filter);
+               global_bloom_filter = bloom_new(order, num);
+               user_bloom_filter = bloom_new(order, num);
        } else
                WARNING_LOG("hard link detection deactivated\n");
        device_id = statbuf.st_dev;