aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/realpath.h
diff options
context:
space:
mode:
Diffstat (limited to 'security/tomoyo/realpath.h')
-rw-r--r--security/tomoyo/realpath.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/security/tomoyo/realpath.h b/security/tomoyo/realpath.h
index da4f06ff6f8d..b94cb512adb5 100644
--- a/security/tomoyo/realpath.h
+++ b/security/tomoyo/realpath.h
@@ -43,7 +43,7 @@ bool tomoyo_memory_ok(void *ptr);
43 * Keep the given name on the RAM. 43 * Keep the given name on the RAM.
44 * The RAM is shared, so NEVER try to modify or kfree() the returned name. 44 * The RAM is shared, so NEVER try to modify or kfree() the returned name.
45 */ 45 */
46const struct tomoyo_path_info *tomoyo_save_name(const char *name); 46const struct tomoyo_path_info *tomoyo_get_name(const char *name);
47 47
48/* Check for memory usage. */ 48/* Check for memory usage. */
49int tomoyo_read_memory_counter(struct tomoyo_io_buffer *head); 49int tomoyo_read_memory_counter(struct tomoyo_io_buffer *head);
@@ -54,4 +54,23 @@ int tomoyo_write_memory_quota(struct tomoyo_io_buffer *head);
54/* Initialize realpath related code. */ 54/* Initialize realpath related code. */
55void __init tomoyo_realpath_init(void); 55void __init tomoyo_realpath_init(void);
56 56
57/*
58 * tomoyo_name_entry is a structure which is used for linking
59 * "struct tomoyo_path_info" into tomoyo_name_list .
60 */
61struct tomoyo_name_entry {
62 struct list_head list;
63 atomic_t users;
64 struct tomoyo_path_info entry;
65};
66
67static inline void tomoyo_put_name(const struct tomoyo_path_info *name)
68{
69 if (name) {
70 struct tomoyo_name_entry *ptr =
71 container_of(name, struct tomoyo_name_entry, entry);
72 atomic_dec(&ptr->users);
73 }
74}
75
57#endif /* !defined(_SECURITY_TOMOYO_REALPATH_H) */ 76#endif /* !defined(_SECURITY_TOMOYO_REALPATH_H) */