hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/security/selinux/ss/avtab.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * An access vector table (avtab) is a hash table
34 * of access vectors and transition types indexed
....@@ -13,9 +14,6 @@
1314 * Added conditional policy language extensions
1415 *
1516 * Copyright (C) 2003 Tresys Technology, LLC
16
- * This program is free software; you can redistribute it and/or modify
17
- * it under the terms of the GNU General Public License as published by
18
- * the Free Software Foundation, version 2.
1917 *
2018 * Updated: Yuichi Nakamura <ynakam@hitachisoft.jp>
2119 * Tuned number of hash slots for avtab to reduce memory usage
....@@ -24,7 +22,6 @@
2422 #define _SS_AVTAB_H_
2523
2624 #include "security.h"
27
-#include <linux/flex_array.h>
2825
2926 struct avtab_key {
3027 u16 source_type; /* source type */
....@@ -84,15 +81,15 @@
8481 };
8582
8683 struct avtab {
87
- struct flex_array *htable;
84
+ struct avtab_node **htable;
8885 u32 nel; /* number of elements */
8986 u32 nslot; /* number of hash slots */
9087 u32 mask; /* mask to compute hash func */
91
-
9288 };
9389
94
-int avtab_init(struct avtab *);
90
+void avtab_init(struct avtab *h);
9591 int avtab_alloc(struct avtab *, u32);
92
+int avtab_alloc_dup(struct avtab *new, const struct avtab *orig);
9693 struct avtab_datum *avtab_search(struct avtab *h, struct avtab_key *k);
9794 void avtab_destroy(struct avtab *h);
9895 void avtab_hash_eval(struct avtab *h, char *tag);