#define ZLOGGER_SMACK_LABEL "*"
#define BLOCK_RATIO(count) (count*100/ZLOGGER_BLOCK_COUNT)
+#define MAP_ORDER (get_order(ZLOGGER_MAP_SIZE))
#define ZLOG_FD_BUFER (2 * ZLOGGER_MB)
hash_init(g_thread_table->data);
for (g_shm_ptr_i = 0; g_shm_ptr_i < ZLOGGER_DEVICE_COUNT; g_shm_ptr_i++) {
- g_shm_ptr[g_shm_ptr_i] = kzalloc(ZLOGGER_MAP_SIZE, GFP_KERNEL);
+ g_shm_ptr[g_shm_ptr_i] = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, MAP_ORDER);
if (g_shm_ptr[g_shm_ptr_i] == NULL) {
r = -ENOMEM;
goto out_free_g_thread_table_g_shm_ptr;
out_free_g_thread_table_g_shm_ptr:
for (i = 0; i < g_shm_ptr_i; ++i) {
- kfree(g_shm_ptr[i]);
+ free_pages((unsigned long)g_shm_ptr[i], MAP_ORDER);
g_shm_ptr[i] = NULL;
}
g_thread_table = NULL;
for (i = 0; i < ZLOGGER_DEVICE_COUNT; i++) {
- kfree(g_shm_ptr[i]);
+ free_pages((unsigned long)g_shm_ptr[i], MAP_ORDER);
g_shm_ptr[i] = NULL;
}