summaryrefstree
path: root/kernel/security/defex_lsm/include/defex_caches.h
blob: 3436a6d8c709294d761b87c66e06a34fa53cc7dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2
 * as published by the Free Software Foundation.
*/

#ifndef __DEFEX_CACHES_H
#define __DEFEX_CACHES_H

#include "defex_config.h"
#include "defex_internal.h"

#define FILE_CACHE_SIZE 0x40

struct defex_file_cache_entry {
	int prev_entry;
	int next_entry;
	int pid;
	struct file *file_addr;
};

struct defex_file_cache_list {
	struct defex_file_cache_entry entry[FILE_CACHE_SIZE];
	int first_entry;
	int last_entry;
};

void defex_file_cache_init(void);
void defex_file_cache_add(int pid, struct file *file_addr);
void defex_file_cache_update(struct file *file_addr);
void defex_file_cache_delete(int pid);
struct file *defex_file_cache_find(int pid);

#endif /* __DEFEX_CACHES_H */