Skip to content

Commit

Permalink
Add inline comments for activated buckets
Browse files Browse the repository at this point in the history
  • Loading branch information
b1tg committed Aug 10, 2024
1 parent 686a888 commit 378a44c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions clamonacc/inotif/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ int onas_ht_insert(struct onas_ht *ht, struct onas_element *elem)
bckt = ht->htable[idx];
}

/* Init activated buckets */
if (ht->nbckts == 0) {
ht->head = bckt;
ht->tail = bckt;
Expand Down
8 changes: 4 additions & 4 deletions clamonacc/inotif/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ struct onas_bucket {

struct onas_element *head;
struct onas_element *tail;
struct onas_bucket *next;
struct onas_bucket *prev;
struct onas_bucket *next; /* Next activated bucket */
struct onas_bucket *prev; /* Prev activated bucket */
};

struct onas_ht {

struct onas_bucket **htable;
struct onas_bucket *head;
struct onas_bucket *tail;
struct onas_bucket *head; /* Activated buckets head */
struct onas_bucket *tail; /* Activated buckets tail */

/* Must be a sufficiently high power of two--will not grow. */
uint32_t size;
Expand Down
1 change: 1 addition & 0 deletions clamonacc/inotif/inotif.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ void *onas_ddd_th(void *arg)
if ((pt = optget(ctx->clamdopts, "OnAccessExcludePath"))->enabled) {
while (pt) {
struct onas_bucket *ob = ddd_ht->head;
/* Iterate through the activated buckets to find matched paths */
while (ob != NULL) {
struct onas_element *oe = ob->head;
while (oe != NULL) {
Expand Down

0 comments on commit 378a44c

Please sign in to comment.