aboutsummaryrefslogtreecommitdiffstats
path: root/module/os/linux/spl/spl-proc.c
diff options
context:
space:
mode:
authorнаб <[email protected]>2022-01-15 00:37:55 +0100
committerGitHub <[email protected]>2022-01-14 15:37:55 -0800
commit18168da727427e28914235137daebe06c23069cd (patch)
tree71a8769a2a12dd4add4f7abfb5a1e4f51f09cf18 /module/os/linux/spl/spl-proc.c
parent7adc19009817303af10c8b3b7617850994cfb9e2 (diff)
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 <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12899
Diffstat (limited to 'module/os/linux/spl/spl-proc.c')
-rw-r--r--module/os/linux/spl/spl-proc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/module/os/linux/spl/spl-proc.c b/module/os/linux/spl/spl-proc.c
index c4af27a7f..f500492ea 100644
--- a/module/os/linux/spl/spl-proc.c
+++ b/module/os/linux/spl/spl-proc.c
@@ -35,6 +35,7 @@
#include <linux/seq_file.h>
#include <linux/uaccess.h>
#include <linux/version.h>
+#include "zfs_gitrev.h"
#if defined(CONSTIFY_PLUGIN) && LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
typedef struct ctl_table __no_const spl_ctl_table;
@@ -461,7 +462,7 @@ slab_seq_stop(struct seq_file *f, void *v)
up_read(&spl_kmem_cache_sem);
}
-static struct seq_operations slab_seq_ops = {
+static const struct seq_operations slab_seq_ops = {
.show = slab_seq_show,
.start = slab_seq_start,
.next = slab_seq_next,
@@ -494,14 +495,14 @@ taskq_seq_stop(struct seq_file *f, void *v)
up_read(&tq_list_sem);
}
-static struct seq_operations taskq_all_seq_ops = {
+static const struct seq_operations taskq_all_seq_ops = {
.show = taskq_all_seq_show,
.start = taskq_seq_start,
.next = taskq_seq_next,
.stop = taskq_seq_stop,
};
-static struct seq_operations taskq_seq_ops = {
+static const struct seq_operations taskq_seq_ops = {
.show = taskq_seq_show,
.start = taskq_seq_start,
.next = taskq_seq_next,
@@ -612,8 +613,8 @@ static struct ctl_table spl_table[] = {
*/
{
.procname = "gitrev",
- .data = spl_gitrev,
- .maxlen = sizeof (spl_gitrev),
+ .data = (char *)ZFS_META_GITREV,
+ .maxlen = sizeof (ZFS_META_GITREV),
.mode = 0444,
.proc_handler = &proc_dostring,
},