}
struct index_mm *index_mm_open(struct kmod_ctx *ctx, const char *filename,
- bool populate)
+ bool populate, unsigned long long *stamp)
{
int fd;
int flags;
idx->ctx = ctx;
close(fd);
+ *stamp = ts_usec(&st.st_mtim);
+
return idx;
fail:
/* Implementation using mmap */
struct index_mm;
struct index_mm *index_mm_open(struct kmod_ctx *ctx, const char *filename,
- bool populate);
+ bool populate, unsigned long long *stamp);
void index_mm_close(struct index_mm *index);
char *index_mm_search(struct index_mm *idx, const char *key);
struct index_value *index_mm_searchwild(struct index_mm *idx, const char *key);
struct kmod_config *config;
struct hash *modules_by_name;
struct index_mm *indexes[_KMOD_INDEX_LAST];
+ unsigned long long indexes_stamp[_KMOD_INDEX_LAST];
};
void kmod_log(const struct kmod_ctx *ctx,
index_files[index_number], name);
realnames = index_mm_searchwild(ctx->indexes[index_number],
name);
- } else{
+ } else {
char fn[PATH_MAX];
snprintf(fn, sizeof(fn), "%s/%s.bin", ctx->dirname,
snprintf(path, sizeof(path), "%s/%s.bin", ctx->dirname,
index_files[i]);
- ctx->indexes[i] = index_mm_open(ctx, path, true);
+ ctx->indexes[i] = index_mm_open(ctx, path, true,
+ &ctx->indexes_stamp[i]);
if (ctx->indexes[i] == NULL)
goto fail;
}
if (ctx->indexes[i] != NULL) {
index_mm_close(ctx->indexes[i]);
ctx->indexes[i] = NULL;
+ ctx->indexes_stamp[i] = 0;
}
}
}