mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
module/*.ko: prune .data, global .rodata
Evaluated every variable that lives in .data (and globals in .rodata) in the kernel modules, and constified/eliminated/localised them appropriately. This means that all read-only data is now actually read-only data, and, if possible, at file scope. A lot of previously- global-symbols became inlinable (and inlined!) constants. Probably not in a big Wowee Performance Moment, but hey. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12899
This commit is contained in:
@@ -210,7 +210,7 @@ typedef struct kcf_provider_desc {
|
||||
struct kcf_provider_list *pd_provider_list;
|
||||
kcondvar_t pd_resume_cv;
|
||||
crypto_provider_handle_t pd_prov_handle;
|
||||
crypto_ops_t *pd_ops_vector;
|
||||
const crypto_ops_t *pd_ops_vector;
|
||||
ushort_t pd_mech_indx[KCF_OPS_CLASSSIZE]\
|
||||
[KCF_MAXMECHTAB];
|
||||
crypto_mech_info_t *pd_mechanisms;
|
||||
@@ -397,19 +397,6 @@ extern kcf_soft_conf_entry_t *soft_config_list;
|
||||
#define KCF_MAXKEYOPS 116 /* Key generation and derivation */
|
||||
#define KCF_MAXMISC 16 /* Others ... */
|
||||
|
||||
#define KCF_MAXMECHS KCF_MAXDIGEST + KCF_MAXCIPHER + KCF_MAXMAC + \
|
||||
KCF_MAXSIGN + KCF_MAXKEYOPS + \
|
||||
KCF_MAXMISC
|
||||
|
||||
extern kcf_mech_entry_t kcf_digest_mechs_tab[];
|
||||
extern kcf_mech_entry_t kcf_cipher_mechs_tab[];
|
||||
extern kcf_mech_entry_t kcf_mac_mechs_tab[];
|
||||
extern kcf_mech_entry_t kcf_sign_mechs_tab[];
|
||||
extern kcf_mech_entry_t kcf_keyops_mechs_tab[];
|
||||
extern kcf_mech_entry_t kcf_misc_mechs_tab[];
|
||||
|
||||
extern kmutex_t kcf_mech_tabs_lock;
|
||||
|
||||
typedef enum {
|
||||
KCF_DIGEST_CLASS = 1,
|
||||
KCF_CIPHER_CLASS,
|
||||
@@ -429,7 +416,7 @@ typedef struct kcf_mech_entry_tab {
|
||||
kcf_mech_entry_t *met_tab; /* the table */
|
||||
} kcf_mech_entry_tab_t;
|
||||
|
||||
extern kcf_mech_entry_tab_t kcf_mech_tabs_tab[];
|
||||
extern const kcf_mech_entry_tab_t kcf_mech_tabs_tab[];
|
||||
|
||||
#define KCF_MECHID(class, index) \
|
||||
(((crypto_mech_type_t)(class) << 32) | (crypto_mech_type_t)(index))
|
||||
@@ -1283,12 +1270,13 @@ extern int kcf_add_mech_provider(short, kcf_provider_desc_t *,
|
||||
kcf_prov_mech_desc_t **);
|
||||
extern void kcf_remove_mech_provider(char *, kcf_provider_desc_t *);
|
||||
extern int kcf_get_mech_entry(crypto_mech_type_t, kcf_mech_entry_t **);
|
||||
extern kcf_provider_desc_t *kcf_alloc_provider_desc(crypto_provider_info_t *);
|
||||
extern kcf_provider_desc_t *kcf_alloc_provider_desc(
|
||||
const crypto_provider_info_t *);
|
||||
extern void kcf_provider_zero_refcnt(kcf_provider_desc_t *);
|
||||
extern void kcf_free_provider_desc(kcf_provider_desc_t *);
|
||||
extern void kcf_soft_config_init(void);
|
||||
extern int get_sw_provider_for_mech(crypto_mech_name_t, char **);
|
||||
extern crypto_mech_type_t crypto_mech2id_common(char *, boolean_t);
|
||||
extern crypto_mech_type_t crypto_mech2id_common(const char *, boolean_t);
|
||||
extern void undo_register_provider(kcf_provider_desc_t *, boolean_t);
|
||||
extern void redo_register_provider(kcf_provider_desc_t *);
|
||||
extern void kcf_rnd_init(void);
|
||||
|
||||
@@ -457,12 +457,9 @@ typedef struct kcf_ntfy_elem {
|
||||
#define CRYPTO_TASKQ_MIN 64
|
||||
#define CRYPTO_TASKQ_MAX 2 * 1024 * 1024
|
||||
|
||||
extern int crypto_taskq_threads;
|
||||
extern int crypto_taskq_minalloc;
|
||||
extern int crypto_taskq_maxalloc;
|
||||
extern kcf_global_swq_t *gswq;
|
||||
extern int kcf_maxthreads;
|
||||
extern int kcf_minthreads;
|
||||
extern const int crypto_taskq_threads;
|
||||
extern const int crypto_taskq_minalloc;
|
||||
extern const int crypto_taskq_maxalloc;
|
||||
|
||||
/*
|
||||
* All pending crypto bufcalls are put on a list. cbuf_list_lock
|
||||
|
||||
@@ -498,10 +498,10 @@ typedef struct crypto_nostore_key_ops {
|
||||
* by calling crypto_register_provider(9F).
|
||||
*/
|
||||
typedef struct crypto_ops_v1 {
|
||||
crypto_control_ops_t *co_control_ops;
|
||||
crypto_digest_ops_t *co_digest_ops;
|
||||
crypto_cipher_ops_t *co_cipher_ops;
|
||||
crypto_mac_ops_t *co_mac_ops;
|
||||
const crypto_control_ops_t *co_control_ops;
|
||||
const crypto_digest_ops_t *co_digest_ops;
|
||||
const crypto_cipher_ops_t *co_cipher_ops;
|
||||
const crypto_mac_ops_t *co_mac_ops;
|
||||
crypto_sign_ops_t *co_sign_ops;
|
||||
crypto_verify_ops_t *co_verify_ops;
|
||||
crypto_dual_ops_t *co_dual_ops;
|
||||
@@ -511,7 +511,7 @@ typedef struct crypto_ops_v1 {
|
||||
crypto_object_ops_t *co_object_ops;
|
||||
crypto_key_ops_t *co_key_ops;
|
||||
crypto_provider_management_ops_t *co_provider_ops;
|
||||
crypto_ctx_ops_t *co_ctx_ops;
|
||||
const crypto_ctx_ops_t *co_ctx_ops;
|
||||
} crypto_ops_v1_t;
|
||||
|
||||
typedef struct crypto_ops_v2 {
|
||||
@@ -653,9 +653,9 @@ typedef struct crypto_provider_info_v1 {
|
||||
char *pi_provider_description;
|
||||
crypto_provider_type_t pi_provider_type;
|
||||
crypto_provider_handle_t pi_provider_handle;
|
||||
crypto_ops_t *pi_ops_vector;
|
||||
const crypto_ops_t *pi_ops_vector;
|
||||
uint_t pi_mech_list_count;
|
||||
crypto_mech_info_t *pi_mechanisms;
|
||||
const crypto_mech_info_t *pi_mechanisms;
|
||||
uint_t pi_logical_provider_count;
|
||||
crypto_kcf_provider_handle_t *pi_logical_providers;
|
||||
} crypto_provider_info_v1_t;
|
||||
@@ -711,7 +711,7 @@ typedef struct crypto_provider_info {
|
||||
* of state changes, and notify the kernel when a asynchronous request
|
||||
* completed.
|
||||
*/
|
||||
extern int crypto_register_provider(crypto_provider_info_t *,
|
||||
extern int crypto_register_provider(const crypto_provider_info_t *,
|
||||
crypto_kcf_provider_handle_t *);
|
||||
extern int crypto_unregister_provider(crypto_kcf_provider_handle_t);
|
||||
extern void crypto_provider_notification(crypto_kcf_provider_handle_t, uint_t);
|
||||
|
||||
Reference in New Issue
Block a user