diff options
author | наб <[email protected]> | 2022-01-15 00:37:55 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2022-01-14 15:37:55 -0800 |
commit | 18168da727427e28914235137daebe06c23069cd (patch) | |
tree | 71a8769a2a12dd4add4f7abfb5a1e4f51f09cf18 /cmd | |
parent | 7adc19009817303af10c8b3b7617850994cfb9e2 (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 'cmd')
-rw-r--r-- | cmd/zhack/zhack.c | 13 | ||||
-rw-r--r-- | cmd/ztest/ztest.c | 2 |
2 files changed, 7 insertions, 8 deletions
diff --git a/cmd/zhack/zhack.c b/cmd/zhack/zhack.c index 96871d2aa..73ce888c0 100644 --- a/cmd/zhack/zhack.c +++ b/cmd/zhack/zhack.c @@ -53,7 +53,6 @@ #include <zfeature_common.h> #include <libzutil.h> -const char cmdname[] = "zhack"; static importargs_t g_importargs; static char *g_pool; static boolean_t g_readonly; @@ -62,9 +61,9 @@ static __attribute__((noreturn)) void usage(void) { (void) fprintf(stderr, - "Usage: %s [-c cachefile] [-d dir] <subcommand> <args> ...\n" + "Usage: zhack [-c cachefile] [-d dir] <subcommand> <args> ...\n" "where <subcommand> <args> is one of the following:\n" - "\n", cmdname); + "\n"); (void) fprintf(stderr, " feature stat <pool>\n" @@ -99,10 +98,10 @@ fatal(spa_t *spa, void *tag, const char *fmt, ...) } va_start(ap, fmt); - (void) fprintf(stderr, "%s: ", cmdname); + (void) fputs("zhack: ", stderr); (void) vfprintf(stderr, fmt, ap); va_end(ap); - (void) fprintf(stderr, "\n"); + (void) fputc('\n', stderr); exit(1); } @@ -277,7 +276,7 @@ zhack_do_feature_enable(int argc, char **argv) spa_t *spa; objset_t *mos; zfeature_info_t feature; - spa_feature_t nodeps[] = { SPA_FEATURE_NONE }; + const spa_feature_t nodeps[] = { SPA_FEATURE_NONE }; /* * Features are not added to the pool's label until their refcounts @@ -374,7 +373,7 @@ zhack_do_feature_ref(int argc, char **argv) spa_t *spa; objset_t *mos; zfeature_info_t feature; - spa_feature_t nodeps[] = { SPA_FEATURE_NONE }; + const spa_feature_t nodeps[] = { SPA_FEATURE_NONE }; /* * fi_desc does not matter here because it was written to disk diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index a99f60964..bb2f14298 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -253,7 +253,7 @@ extern uint64_t metaslab_force_ganging; extern uint64_t metaslab_df_alloc_threshold; extern unsigned long zfs_deadman_synctime_ms; extern int metaslab_preload_limit; -extern boolean_t zfs_compressed_arc_enabled; +extern int zfs_compressed_arc_enabled; extern int zfs_abd_scatter_enabled; extern int dmu_object_alloc_chunk_shift; extern boolean_t zfs_force_some_double_word_sm_entries; |